Page 1 of 1
Problem with Views
Posted: Tue 02 Dec 2008 08:59
by Co
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
Posted: Tue 02 Dec 2008 12:21
by AndreyR
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.
Posted: Tue 02 Dec 2008 13:37
by Co
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)
Posted: Wed 03 Dec 2008 07:35
by AndreyR
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.
Posted: Wed 03 Dec 2008 08:15
by Co
Thanks for the info.
Do you have any idea when this ( i assume i will be in a next version) will be available?
Posted: Wed 03 Dec 2008 09:11
by AndreyR
Unfortunately, no timeframe is available at the moment.
Posted: Thu 04 Dec 2008 06:49
by Co
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.
Posted: Thu 04 Dec 2008 10:59
by AndreyR
I advise you to use workarounds. The fix is really time-consuming.
Posted: Tue 09 Dec 2008 09:34
by Co
okay i will proceed as you indicated (modify mapping afterwards)