new new association
new new association
I understand it is not possible to create relation if the two columns do not match.
I have table 1 containing column DOCUMENT_ID NUMBER NOT NULL
table 2 has the same column but this column is NULLABLE
devart would not let me create relation between two tables since the seconds column is specified as NULLABLE.
Is there any way around?
I cannot change the database structure since other applications are using it.
thanks
Nermin
I have table 1 containing column DOCUMENT_ID NUMBER NOT NULL
table 2 has the same column but this column is NULLABLE
devart would not let me create relation between two tables since the seconds column is specified as NULLABLE.
Is there any way around?
I cannot change the database structure since other applications are using it.
thanks
Nermin
Re: new new association
You are working with a LinqConnect model and trying to add a 1-to-1 association, aren't you?
If yes, then the possibility to add 1-to-1 associations with nullable foreign key properties was added in LinqConnect 4.2.306/dotConnect for Oracle 7.8.301 (released on 08-Aug-13):
http://forums.devart.com/viewtopic.php?f=1&t=27701.
If it is your case, please upgrade your dotConnect for Oracle to a newer one.
If yes, then the possibility to add 1-to-1 associations with nullable foreign key properties was added in LinqConnect 4.2.306/dotConnect for Oracle 7.8.301 (released on 08-Aug-13):
http://forums.devart.com/viewtopic.php?f=1&t=27701.
If it is your case, please upgrade your dotConnect for Oracle to a newer one.
Re: new new association
I have another question.
I imported a table definition in diagram (.lqlml) by pasting XML like indicated below.
I run a custom tool on my diagram and it did create this entity.
However - I can't find this entity in a diagram, I mean I can find it when I do the search, but the entity itself does not show up in diagram. I can access this entity, intelisense is working fine and all that - but it does not show in a diagram. I have dotConnect version 7.7.267
Please advice.
thank you
I imported a table definition in diagram (.lqlml) by pasting XML like indicated below.
I run a custom tool on my diagram and it did create this entity.
However - I can't find this entity in a diagram, I mean I can find it when I do the search, but the entity itself does not show up in diagram. I can access this entity, intelisense is working fine and all that - but it does not show in a diagram. I have dotConnect version 7.7.267
Please advice.
thank you
Code: Select all
<Table Name="OPL.ESP_EDGAR_DOCUMENTS" Member="EspEdgarDocuments">
<Type Name="EspEdgarDocument" ed:Guid="953b0167-b067-485a-b6eb-b75505022007">
<Column Name="DOCUMENT_ID" Member="DocumentId" Type="System.Int64" DbType="NUMBER(16) NOT NULL" IsPrimaryKey="true" CanBeNull="false" Precision="16" ed:ValidateRequired="True" ed:Guid="0863a945-571f-4de2-9d4a-40a91ad9e457" />
<Column Name="SUBMISSION_TYPE_ID" Member="SubmissionTypeId" Type="System.Int32" DbType="NUMBER(3) NULL" CanBeNull="true" UpdateCheck="Never" Precision="3" ed:ValidateRequired="False" ed:Guid="f01aa5a9-96ab-4514-8eba-79c7951a48e2" />
</Type>
</Table>
Re: new new association
Please open Model Explorer-> YourDataContext-> Classes and:
- drag the "EspEdgarDocument" class on the diagram
or
- right-click the "EspEdgarDocument" class and select "Add On Diagram" from the shortcut menu.
- drag the "EspEdgarDocument" class on the diagram
or
- right-click the "EspEdgarDocument" class and select "Add On Diagram" from the shortcut menu.
Re: new new association
If you have any further questions, feel free to contact us.
Re: new new association
I do have another question.
I need to create a "clone row" functionality. For example I have table called JOB, and I want to clone one job to another. First I need to retrieve the original record from database, change the primary key and insert new record in back to database.
Of course dotConnect would not let me do this, since it has a self-tracking feature.
It won't let me change the primary key.
is there a way to detach entity once retrieved from database, so I could just change pk for the records and insert in into database as new record?
thanks
I need to create a "clone row" functionality. For example I have table called JOB, and I want to clone one job to another. First I need to retrieve the original record from database, change the primary key and insert new record in back to database.
Of course dotConnect would not let me do this, since it has a self-tracking feature.
It won't let me change the primary key.
is there a way to detach entity once retrieved from database, so I could just change pk for the records and insert in into database as new record?
thanks
Re: new new association
It is impossible to detach objects from the DataContext, please refer to: http://www.devart.com/linqconnect/docs/?attach.htmlis there a way to detach entity once retrieved from database, so I could just change pk for the records and insert in into database as new record?
You can try using this code to implement your scenario:
Code: Select all
SCOTTContext.SCOTTDataContext dt = new SCOTTContext.SCOTTDataContext();
SCOTTContext.DEPT entOld = dt.DEPTs.First();
SCOTTContext.SCOTTDataContext dt2 = new SCOTTContext.SCOTTDataContext() { Log = Console.Out };
SCOTTContext.DEPT entNew = entOld;
entNew.DEPTNO = 10;// new id
dt2.DEPTs.InsertOnSubmit(entNew);
dt2.SubmitChanges();