Search found 16 matches

by nbonne
Wed 01 Sep 2010 20:05
Forum: Entity Developer
Topic: Issue to define Referential constraints on association
Replies: 5
Views: 2312

Confirm the issue is resolved in the ED version 3.0.10 beta release.

thanks
by nbonne
Mon 23 Aug 2010 07:46
Forum: Entity Developer
Topic: Issue to define Referential constraints on association
Replies: 5
Views: 2312

For clarity : We are using Entity Developer against Oracle database. I have no MySQL instance running so can not provide feedback at this point. Assume the fix will also be delivered for "dotConnect for Oracle" provider.
by nbonne
Fri 06 Aug 2010 12:35
Forum: Entity Developer
Topic: Issue to define Referential constraints on association
Replies: 5
Views: 2312

Issue to define Referential constraints on association

version of EntityDevelper = 2.80.143

Executed following sequence of steps in ED.

Created model from database selecting tables TSpecification, TProduct, TItem and TProductItem. Tables TProduct (key productId) and TItem (key itemId) have a 0.1 to 1 relationship with table TSpecification (key specId).

Tables TProduct and TItem have a FK (1 to many) relation with table TProductItem. TProductItem acts as a cross-reference table between TProduct and TItem.

The Entity model validates correctly at this point.

Now We want class Specification to become base class for Product and Item entities.

So we add "Table per Type inheritance" and define Specification as abstract. We also remove the EntityProperties productId from Product and itemId from Item. Then on Product and Item we need to re-add the mapping between column SpecId and property SpecId.

After removing the 0.1 associations between Product and Specification and between Item and Specification the entityModel does not validate. It gives error "No mapping specified for the following EntitySet/AssociationSet - Product_ProductItemSet" (same error on Item_ProductItemSet).

When you open the Association Editor on e.g. association Product_ProductItem you can see that the Referential Constraint properties are no longer defined and blanked out. You can re-select these (Product property = SpecId and ProductItem propery = ProductSpecId) but when you click on the OK button nothing happens or you get a fatal error to restart Entity Developer.

The way to make it work is to open up the edml file with a text editor and add the ReferentialConstraint on the Association name Product_ProductItem manually. Save and reopening the model in ED validates with no error.

Also you can initially not add TProductItem to the model and first define the inheritance tree. Once inheritance is defined you can add TProductItem and the model will validate with no error.

Doing the same set of operations in VS-2010 EF designer did not give an issue. I also tried to delete and recreate the association in the ED but I got an exception "Object reference not set to an instance of an object".
by nbonne
Wed 03 Jun 2009 06:54
Forum: Entity Developer
Topic: Map custom entity to output parameter of a stored procedure
Replies: 2
Views: 4725

Map custom entity to output parameter of a stored procedure

Using the entity developer what would be the approach to map an output parameter of type REF CURSOR to a custom class

I proceeded as follow :

The Stored procedure has a definition like :

PROCEDURE BOM_BY_PRODUCT (componentID in NUMBER, p_recordset OUT SYS_REFCURSOR);


- Drag and drop the stored procedure on the design surface of the ED
- This generated a method in the DataSourceModel with input parameter of type decimal and output parameter of type binary.
- I added an entity class Class1 and defined a property for each field as defined in the recordset of the output parameter.
- Then I selected the generated method and via the parameters property I selected the entity Class1 as the return type.

Now the model still does not validate as it says No mapping specified for the following EntitySet/AssociationSet - Class1.

Before using the Entity developer I managed to do this by defining the appropriate mappings manually in the msdl file. Is the entity developer supporting this mapping in a different way ? If not any plans to do so ?
by nbonne
Wed 03 Jun 2009 06:14
Forum: Entity Developer
Topic: The specified metadata path is not valid
Replies: 41
Views: 35577

The proposed workaround does the job ! Thanks.
by nbonne
Tue 02 Jun 2009 06:28
Forum: Entity Developer
Topic: The specified metadata path is not valid
Replies: 41
Views: 35577

Unfortunately the workaround does not help. I changed this property to CopyToOutputDirectory and additionaly copied the csdl, msl and ssdl files to the output directory of my test project (that is referencing the entity model project) but still same error (see below). Anything else I can try ? I am eager to use the entity developer ...

System.Data.MetadataException occurred
Message="The specified metadata path is not valid. A valid path must be either an existing directory, an existing file with extension '.csdl', '.ssdl', or '.msl', or a URI that identifies an embedded resource."
Source="System.Data.Entity"
StackTrace:
at System.Data.Metadata.Edm.MetadataArtifactLoader.Create(String path, ExtensionCheck extensionCheck, String validExtension, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)
at System.Data.EntityClient.EntityConnection.SplitPaths(String paths)
at System.Data.EntityClient.EntityConnection.GetMetadataWorkspace(Boolean initializeAllCollections)
at System.Data.Objects.ObjectContext.RetrieveMetadataWorkspaceFromConnection()
at System.Data.Objects.ObjectContext..ctor(EntityConnection connection, Boolean isConnectionConstructor)
at System.Data.Objects.ObjectContext..ctor(String connectionString, String defaultContainerName)
at Gps.DavinciGPSModel.DavinciGPSModel..ctor() in c:\projects\levis\gps\main\davincientitymodel\davincigpsmodel.designer.cs:line 29
InnerException:
by nbonne
Fri 29 May 2009 13:03
Forum: Entity Developer
Topic: The specified metadata path is not valid
Replies: 41
Views: 35577

The specified metadata path is not valid

I have added a Devart Entity model in VS2008 (Add new Item) and added 4 tables generated from an Oracle DB. The model validates in the Entity Developer,the appropriate classes are generated and the project builds successfully.

When I instantiate the entities model I get an exception on the (auto-generated) constructor.

The error I get = "The specified metadata path is not valid"

Example code below (I cleared out the password)

public DavinciGpsModel2Entities() :
base(@"metadata=DavinciGpsModel2.csdl|DavinciGpsModel2.ssdl|DavinciGpsModel2.msl;provider=Devart.Data.Oracle;provider connection string=""User Id=sysadm;Password=;Server=das01.dal.na.levi.com;Home=orahome92;Persist Security Info=True""", "DavinciGpsModel2Entities")
{
this.OnContextCreated();
}

I am using oracle dotconnect version = 5.20.33.0 and entity developer version =2.0.21.0 and receive the same error even if I add another Entity model.
by nbonne
Thu 05 Mar 2009 12:10
Forum: Entity Framework support
Topic: Imported Function does not create class method
Replies: 4
Views: 3099

Indeed that explains. The stored procedure does not map to any entity type. Whereas for the SQL2005 case, that I was referring to, I do have a return type mapped to an entity type.
by nbonne
Wed 04 Mar 2009 22:07
Forum: Entity Developer
Topic: Mapping Exception : no corresponding parameter was found
Replies: 1
Views: 5380

Mapping Exception : no corresponding parameter was found

I have a Entity framework project created with Entity Developer 2.05beta.

I can select a stored procedure from the database explorer and drag that on the design surface. The project validates and generates succesfully.

Running code against the generated class I get a mapping exception error when opening the connection on the datacontext object even before I can call the method.

using (DavinciModelEntities entities = new DavinciModelEntities())
{

if (entities.Connection.State != ConnectionState.Open)
entities.Connection.Open();
entities.Getmastersdetail( ....)

System.Data.MappingException was unhandled
Message="Schema specified is not valid. Errors: \r\nModel.msl(4,6) : error 2055: Storage function has a parameter 'INMASTER_PDC' but no corresponding parameter was found in the FunctionImport.\r\nModel.msl(4,6)

Below extract of my ssdl :






csdl :





msl :








Where/how do I need to map the parameters. Should the Entity developer not generate the mappings for the parameters automatically ?
by nbonne
Wed 04 Mar 2009 14:29
Forum: Entity Developer
Topic: Unable to load the specified metadata resource
Replies: 5
Views: 8221

I did not add the Devart Entity Model but just the generated class from the Entity Developer. When I add the edml file (even as existing item) I get across the issue and the entities class instantiates successfully
by nbonne
Wed 04 Mar 2009 13:07
Forum: Entity Developer
Topic: Unable to load the specified metadata resource
Replies: 5
Views: 8221

Unable to load the specified metadata resource

I have generated a C# class entities in testmodel.cs using the entity developer 2.0b. In VS2008 I have added this generated class as an existing item. It builds OK. I did not put the connection string in the app.config file but rely on the connectionstring that is hardcoded as a parameter in the constructor of the base entities class.

However when I run the code I get "Unable to load the specified metadata resource" when instantiating the Entities class. I tried both options for MetaData Artifact Processing (EmbedInOutputAssembly and CopyToOutputDirectory) with same bad results.

In VS2008 I first added the enties class in a class library that was referenced from the UI project. But even adding the entities class directly to the UI project does not help.

The documentation does not seem to provide more detail on this.
by nbonne
Wed 04 Mar 2009 12:20
Forum: Entity Framework support
Topic: Imported Function does not create class method
Replies: 4
Views: 3099

Indeed all OK with the Entity Developer 2.0b. It does generate the class method. Do you still plan to patch the current 5.0.22.0 version ?

thanks
by nbonne
Wed 04 Mar 2009 10:15
Forum: Entity Framework support
Topic: Imported Function does not create class method
Replies: 4
Views: 3099

Imported Function does not create class method

I am using dotconnect version 5.0.22.0 and oracle instance 9.2

I have selected and added a stored procedure to the entity model via the "update model from database" wizard. This results in the storage model as :







Then I do a function import (via edm wizard) selecting the stored
procedure and mapping it to a function import name 'CopyPage'.

This results in the conceptual model as :

FunctionImport Name="CopyPage">




and in the mapping layer as :



All looks correct and the project builds successfully in VS2008. However there is no method generated in the EntityModel.Designer.cs class. So I can not access the imported function from code. I did a similar excercise

with SQL server 2005 following same steps and that created the method after the build.

From this forum I am reading this is working for quite some other users. So Any idea what I may be doing wrong or is it a version related issue ?
by nbonne
Fri 20 Feb 2009 13:34
Forum: Entity Framework support
Topic: Force use of the LIKE operator
Replies: 2
Views: 3665

Force use of the LIKE operator

Is there a .NET string method that can force the use of the LIKE operator in the resulting Oracle SQL query ?

I am having an entity Linq query that goes like this :

var productsQuery = from product in entities.products
where product.name.StartsWith("Food")
select product;

When you run this code and trace the generated SQL with the Oracle monitor class it ends up in the where clause of the Oracle SQL as "where INSTR(PRODUCT, 'Food') = 1". This makes the SQL execution much slower compared to an SQL where clause "Where product LIKE 'Food%'"

I tried the .NET Substring method instead of StartWith which results in the Oracle SUBSTR function but with similar poor performance of the SQL execution.

Is it worth to try with Entity SQL using Object Services instead of LINQ queries using Object Services ?

I am using Devart DotConnect 5.0.20.
by nbonne
Thu 11 Dec 2008 07:58
Forum: Entity Framework support
Topic: Not selected dbojects added to the model
Replies: 2
Views: 3229

Re-tested this with the latest build 5.0.16.0 and confirm the problem is solved. Thanks!