Mapping Oracle user-type column and entity-side relation
Mapping Oracle user-type column and entity-side relation
Is there a way to map an Oracle user-type column?
-- EDIT --
Also is there a way to create entity association from the designer? I'm trying to create a one-to-many relation using a primary key for the "one" side and a non-primary column on the "many" size (a normal relation between master-detail tables).
Thanks
-- EDIT --
Also is there a way to create entity association from the designer? I'm trying to create a one-to-many relation using a primary key for the "one" side and a non-primary column on the "many" size (a normal relation between master-detail tables).
Thanks
There is no support for Oracle Object types neither in Entity Framework, nor in LinqConnect.
Could you please specify the approach you are using to create association?
Is there a corresponding foreign key in database (in this case the association should be generated automatically during Database First model creating)? In this case we will need the script of the database objects to reproduce the issue.
If you are using the Model First approach, you can simply right-click the model surface (or any entity) and select the "Add Association" option.
If you encounter any errors in this scenario, please provide us with the error message and some steps for reproducing the problem.
Could you please specify the approach you are using to create association?
Is there a corresponding foreign key in database (in this case the association should be generated automatically during Database First model creating)? In this case we will need the script of the database objects to reproduce the issue.
If you are using the Model First approach, you can simply right-click the model surface (or any entity) and select the "Add Association" option.
If you encounter any errors in this scenario, please provide us with the error message and some steps for reproducing the problem.
I'll try to explain my situation:
I have two tables without any foreign key and I can't change the DB.
I'd like to create an association between them like
so I can use
Is it possible to create this relation/association using Entity Developer?
I have two tables without any foreign key and I can't change the DB.
Code: Select all
Table MASTER(ID,...)
Table DETAIL(ID,IDMASTER,...)
Code: Select all
DETAIL.IDMASTER=MASTER.ID
Code: Select all
Master.Details -> all related Detail entities
Detail.Master -> the related Master entity
I tried and it gave me an error.
These are my tables:
The relation I want to create is Attivita.IdChiamata = Chiamata.Id
My exact steps are:
What can I do?
These are my tables:
Code: Select all
AprocManChiamate(Id, ...) PK=Id
AprocManAttivita(Id, IdChiamata, ...) PK=Id
My exact steps are:
- Right click an entity and select "Add association" (I chose the entity that is on the "one" side)
- Change the Child Class to the "many" entity
- Add Referential Constraint Properties for the two tables (Id IdChiamata)
- Click OK
I think the designer want the column (IdChiamata) to be part of the entity key (which I think is not needed to create the relation).Error 2 The referenced Dependent Role AprocManAttivitas must be a subset of key EntityType DataModel.AprocManAttivita referenced in the referential constraint for Dependent Role Relationship DataModel.AprocManChiamate_AprocManAttivita.
What can I do?
I am unable to reproduce the error.
Here are the steps I was performing:
1. Right-click the model->Add Association.
2. Set the Master class as Parent Class, set 0..1 multiplicity for this association end
3. Set the Detail table as Child Class, set * multiplicity for this association end.
4. Click OK. Designer creates an unnecessary Id1 field in the Detail entity (a foreign key column). I delete this column in designer.
5. I edit the created association setting the Master and Detail properties.
I have sent a model to the e-mail address provided in your forum profile.
Here are the steps I was performing:
1. Right-click the model->Add Association.
2. Set the Master class as Parent Class, set 0..1 multiplicity for this association end
3. Set the Detail table as Child Class, set * multiplicity for this association end.
4. Click OK. Designer creates an unnecessary Id1 field in the Detail entity (a foreign key column). I delete this column in designer.
5. I edit the created association setting the Master and Detail properties.
I have sent a model to the e-mail address provided in your forum profile.
I opened your sample model and there isn't any error in the relation but I see many parsing error (about attributes and namespaces).
I'm using the latest dotConnect for Oracle (trial, 6.00.70) and my version of Entity Developer is 3.0.60
May be this is the problem? Comparing our files the only difference I see are the "xmlns" attributes.
I created the same exact model as the one you sent me and I still get the previous error.
I replied your e-mail with my model attached.
I'm using the latest dotConnect for Oracle (trial, 6.00.70) and my version of Entity Developer is 3.0.60
May be this is the problem? Comparing our files the only difference I see are the "xmlns" attributes.
I created the same exact model as the one you sent me and I still get the previous error.
I replied your e-mail with my model attached.
After a couple of test I recreated the exact steps that create my error:
These are the table scripts I use (Oracle 10.2.0.3.0):
After I add a "Devart Entity Model", connect to the database and create an empty model.
I add the two tables by dragging them from my "Database Explorer".
Then I try to add an association using these settings:
http://freeebayimagehost.com/images/ybu ... lfclgm.png
After clicking "OK" my association is in red and I get the error I posted some days ago (translated by Google):
These are the table scripts I use (Oracle 10.2.0.3.0):
Code: Select all
CREATE TABLE TEST
(
ID NUMBER,
FIELD VARCHAR2(10 BYTE)
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
CREATE TABLE TEST_DETAIL
(
ID NUMBER,
PARENT_ID NUMBER,
FIELD VARCHAR2(10 BYTE)
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
CREATE UNIQUE INDEX TEST_PK ON TEST
(ID)
LOGGING
NOPARALLEL;
CREATE UNIQUE INDEX TEST_DETAIL_PK ON TEST_DETAIL
(ID)
LOGGING
NOPARALLEL;
ALTER TABLE TEST ADD (
CONSTRAINT TEST_PK
PRIMARY KEY
(ID));
ALTER TABLE TEST_DETAIL ADD (
CONSTRAINT TEST_DETAIL_PK
PRIMARY KEY
(ID));
I add the two tables by dragging them from my "Database Explorer".
Then I try to add an association using these settings:
http://freeebayimagehost.com/images/ybu ... lfclgm.png
After clicking "OK" my association is in red and I get the error I posted some days ago (translated by Google):
What's going on?The properties referenced Dependent Role TestDetails must be a subset of key EntityType INTRATESTModel.TestDetail referenced in the referential constraint for Dependent Role Relationship INTRATESTModel.Test_TestDetail.
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
Could you please send us the model with which this issue can be reproduced?
I've created a model for the tables you've specified, and created an association as described on the scrennshot. The association was created successfully, and no errors were found in the model. I will send you this model in a letter, please check that it was not blocked by your mail filter.
I've created a model for the tables you've specified, and created an association as described on the scrennshot. The association was created successfully, and no errors were found in the model. I will send you this model in a letter, please check that it was not blocked by your mail filter.
I sent the model through the contact form.
Your model when opened by Entity Developer shows error about some namespaces:
and
May be I'm missing some patch/service pack?
Your model when opened by Entity Developer shows error about some namespaces:
Code: Select all
(error) http://schemas.microsoft.com/ado/2009/02/edm/ssdl
(expected) http://schemas.microsoft.com/ado/2006/04/edm/ssdl
Code: Select all
(error) http://schemas.microsoft.com/ado/2008/09/edm
(expected) http://schemas.microsoft.com/ado/2006/04/edm OR http://schemas.microsoft.com/ado/2007/05/edm
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
The difference is that the model I've sent is generated for Entity Framework 4.0, whereas yours one was generated for EF 1.0. You can change the framework that should be used in the model properties (e.g., select 'Edit Model Properties' from the pop-up menu).
To set the association under EF 1.0, you can perform the following:
- in the model properties, select the Synchronization -> Mapping node;
- enable the 'Enable automatic synchronization ...' check box;
- add the association with the 'Add association' item of the pop-up menu;
- remove the ParentId property from the TestDetail entity.
To set the association under EF 1.0, you can perform the following:
- in the model properties, select the Synchronization -> Mapping node;
- enable the 'Enable automatic synchronization ...' check box;
- add the association with the 'Add association' item of the pop-up menu;
- remove the ParentId property from the TestDetail entity.