This is a migrated thread and some comments may be shown as answers.

Model-First Scenario, no join table?

4 Answers 58 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Aerion
Top achievements
Rank 1
Aerion asked on 02 Sep 2011, 02:40 AM
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

4 Answers, 1 is accepted

Sort by
0
Ivailo
Telerik team
answered on 06 Sep 2011, 04:58 PM
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 >>

0
Aerion
Top achievements
Rank 1
answered on 07 Sep 2011, 12:31 AM
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.
0
Colin
Top achievements
Rank 2
answered on 30 Sep 2011, 01:06 PM
Hi, when is a fix to be released as having the same issue :(
0
Ivailo
Telerik team
answered on 30 Sep 2011, 01:49 PM
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 >>

Tags
Getting Started
Asked by
Aerion
Top achievements
Rank 1
Answers by
Ivailo
Telerik team
Aerion
Top achievements
Rank 1
Colin
Top achievements
Rank 2
Share this question
or