Problem with Views

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
Co
Posts: 15
Joined: Fri 28 Nov 2008 10:59

Problem with Views

Post by Co » Tue 02 Dec 2008 08:59

If I generate a model from the database ; the selected views(partials) are not generated. For this DB we only have views (i think this worked okay when i used the oradirect trial a while ago).
Views are selectable but code is not generated.

Message is that there is no primary key for a view??? and that it will be excluded.
Using OraDirect.NET

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Tue 02 Dec 2008 12:21

This is an internal limitation of the Entity Framework. In EDM Wizard for views that do not contain a primary key the Entity Key is inferred using NOT NULL columns. If there are no such columns, the view is excluded from the model.

Co
Posts: 15
Joined: Fri 28 Nov 2008 10:59

Post by Co » Tue 02 Dec 2008 13:37

Since i cannot force the NOT null on a colum(deferred from source tables(datawarehouse)) i added a primary key..I still get the same error: my test-view:
CREATE OR REPLACE FORCE VIEW "TESTV" ("ID", "DATUM",
CONSTRAINT "ID_PK" PRIMARY KEY ("ID") RELY DISABLE) AS
SELECT 1,SYSDATE AS datum FROM DUAL;

please can you provide me with an working view example? Looks like for a view disabled keys are not valid(and this is the only type oracle 9i will allow)

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 03 Dec 2008 07:35

Unfortunately, nothing can be done in current case.
As a temporary workaround you can create a table with primary key in your DB with the same column set as your view has,
add it to your Entity Data Model, and after that remap it manually to your view using XML Editor.
But we are working on the product which will allow to easily solve this and similar problems.

Co
Posts: 15
Joined: Fri 28 Nov 2008 10:59

Post by Co » Wed 03 Dec 2008 08:15

Thanks for the info.
Do you have any idea when this ( i assume i will be in a next version) will be available?

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 03 Dec 2008 09:11

Unfortunately, no timeframe is available at the moment.

Co
Posts: 15
Joined: Fri 28 Nov 2008 10:59

Post by Co » Thu 04 Dec 2008 06:49

Can you keep me posted on when this will become available? In my project (next timebox) i will have multiple views with only nullable columns and since (oracle 9i)indexes on the view are not used in dotNetConnect i will have to work-around this..I'd prefer not to use a work-around..however if the fix will be longer then let's say a month i will have to.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 04 Dec 2008 10:59

I advise you to use workarounds. The fix is really time-consuming.

Co
Posts: 15
Joined: Fri 28 Nov 2008 10:59

Post by Co » Tue 09 Dec 2008 09:34

okay i will proceed as you indicated (modify mapping afterwards)

Post Reply