Hello,
Am working on the mapping Composite Keys(NUMBER+ CLIENTID) for
Table , Here both these keys are primary Keys and NUMBER field is
autogenerated and set as Identity in Database. am facing a problem
for mapping these fields as composite keys.
Error : "a different object with the same identifier value was already
associated with the session"..---> this is becoz in Database this
column is already set as Identity Column ..
Please refer the below code
public cliPendingBankruptcyMap()
{
Table("cliPendingBankruptcy");
LazyLoad();
CompositeId()
.KeyReference(x => x.usrClient, "CLIENTID")
.KeyProperty(x => x.NUMBER, "NUMBER");// HOW TO SET
THIS FIELD AS IDENTITY.
Map(x => x.NAME).Column("NAME");
Map(x => x.CASENO).Column("CASENO");
Map(x => x.DATE).Column("DATE");
Map(x => x.DISTRICT).Column("DISTRICT");
Map(x => x.RELATION).Column("RELATION");
Map(x => x.JUDGE).Column("JUDGE");
}
How can we set the Identity property for NUMBER field in the above
CompositeId()?? , So what approach should we need to follow for
mapping the NUMBER field as Identity in the above code.
Your thoughts?
Mapping Problems : Composite Key for Identity column
1.
2.
b) - If you encounter a problem with functionality (or interface) of this ORM tool, please contact its support team.
- If the problem is caused by dotConnect for Oracle, please send us a small test project with the corresponding DDL/DML script so that we can reproduce the issue in our environment. Also specify your version (x.xx.xxx) of dotConnect for Oracle.
While debugging, try using dbMonitor tool to perform per-component tracing of database events such as commit, rollback, SQL statement execute etc.
Download link: http://www.devart.com/dbmonitor/dbmon3.exe
Documentation: http://www.devart.com/dotconnect/oracle ... nitor.html
We offer our own ORM solutions: LinqConnect and the Entity Framework support.
Do you mean that you have a sequence and a corresponding OnInsert trigger for NUMBER's table in your database?rvadone wrote:NUMBER field is autogenerated and set as Identity in Database.
2.
a) which ORM and its version are you using?rvadone wrote:Error : "a different object with the same identifier value was already
associated with the session"..---> this is becoz in Database this
column is already set as Identity Column ..
b) - If you encounter a problem with functionality (or interface) of this ORM tool, please contact its support team.
- If the problem is caused by dotConnect for Oracle, please send us a small test project with the corresponding DDL/DML script so that we can reproduce the issue in our environment. Also specify your version (x.xx.xxx) of dotConnect for Oracle.
While debugging, try using dbMonitor tool to perform per-component tracing of database events such as commit, rollback, SQL statement execute etc.
Download link: http://www.devart.com/dbmonitor/dbmon3.exe
Documentation: http://www.devart.com/dotconnect/oracle ... nitor.html
We offer our own ORM solutions: LinqConnect and the Entity Framework support.