Model-First Scenario, no join table?

5 posts, 0 answers
  1. Aerion
    Aerion avatar
    13 posts
    Member since:
    Aug 2011

    Posted 01 Sep 2011 Link to this post

    I'm new to the OpenAccess ORM, and was looking through some of the documentation to get my bearings. I attempted the "Getting Started with Model First Scenario" from this page: http://www.telerik.com/help/openaccess-orm/getting-started-root-getting-started-with-update-schema-tools.html
    I followed the steps on that page exactly as directed, but the generated script does not include the join table for the many-to-many relationship between Product and Order. I might be missing something really simple, but I'm sure I followed the tutorial correctly. Any ideas what I've done wrong?

    For reference, here is the script that OpenAccess generated:
    -- Category
    CREATE TABLE [category] (
        [description] varchar(255) NULL,        -- _description
        [cetegory_id] int NOT NULL,             -- _cetegoryId
        [category_name] varchar(255) NULL,      -- _categoryName
        CONSTRAINT [pk_category] PRIMARY KEY ([cetegory_id])
    )
    go
     
    -- Ordr
    CREATE TABLE [ordr] (
        [ship_address] varchar(255) NULL,       -- _shipAddress
        [order_id] int NOT NULL,                -- _orderId
        [order_date] datetime NOT NULL,         -- _orderDate
        CONSTRAINT [pk_ordr] PRIMARY KEY ([order_id])
    )
    go
     
    -- Product
    CREATE TABLE [product] (
        [unit_price] NUMERIC(20,10) NOT NULL,   -- _unitPrice
        [product_name] varchar(255) NULL,       -- _productName
        [product_id] int NOT NULL,              -- _productId
        [discontinued] tinyint NOT NULL,        -- _discontinued
        [cetegory_id] int NULL,                 -- _cetegoryId
        CONSTRAINT [pk_product] PRIMARY KEY ([product_id])
    )
    go
  2. Ivailo
    Admin
    Ivailo avatar
    318 posts

    Posted 06 Sep 2011 Link to this post

    Hello Anthony,

    You are not doing anything wrong - this is a known issue of Q2 2011 release. It is already addressed and the Service Pack we are about to release soon will include the fix.

    In the meantime, if you want to create many-to-many relationships in your models, you will have to create the join table manually before you update the database from the model. After you create it, set it on the Associations Editor instead of choosing (default).

    Do not hesitate to contact us if you have any other questions.

    All the best,
    Ivailo
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's SQL Server Community Awards. We are competing in TWO categories and every vote counts! VOTE for Telerik NOW >>

  3. DevCraft banner
  4. Aerion
    Aerion avatar
    13 posts
    Member since:
    Aug 2011

    Posted 06 Sep 2011 Link to this post

    Thanks for the reply. I was sure I was doing something wrong, but it's good to know a fix is on the way. I'm still evaluating the OpenAccess ORM to see if it's worth buying for our needs and am looking forward to the fix.
    Thanks again.
  5. Colin
    Colin avatar
    19 posts
    Member since:
    Jun 2011

    Posted 30 Sep 2011 Link to this post

    Hi, when is a fix to be released as having the same issue :(
  6. Ivailo
    Admin
    Ivailo avatar
    318 posts

    Posted 30 Sep 2011 Link to this post

    Hi Guys,

    The fix has been released in our latest internal build (2011.2.908.1). I hope you will find it useful.
     
    Further information about the build and its improvements can be found in the related blog post.

    Do not hesitate to let us know if you have any questions.

    Regards,
    Ivailo
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's SQL Server Community Awards. We are competing in TWO categories and every vote counts! VOTE for Telerik NOW >>

Back to Top
DevCraft banner