FNH Mappings with DB2 GeneratedBy Identity -
i trying map table identity key field. when try save error sql0803 duplicate key value specified
insert libpjk/audit (auditid, auditdate, userid, keys, valbefore, valafter, fieldid) values (default, ?, ?, ?, ?, ?, ?)
i'm thinking auditid should not appear in field list , value of default should not there either. don't know how this.
sql table creation:
create table libpjk.audit ( auditid integer not null generated identity (start 1, increment 1), auditdate timestamp not null, userid char(10) not null, fieldid integer not null, keys varchar(50) not null, valbefore varchar(50), valafter varchar(50), constraint libpjk.pk_audit primary key(fieldid))
here's how auditid defined in audit class:
<required()> public overridable property auditid integer
here's mappings:
mybase.new() table("libpjk/audit") lazyload() id(function(x) x.auditid).column("auditid").generatedby.identity() references(function(x) x.auditfield).column("fieldid") map(function(x) x.timestamp).column("auditdate").not.nullable() map(function(x) x.userid).column("userid").not.nullable() map(function(x) x.keys).column("keys").not.nullable() map(function(x) x.value_before).column("valbefore") map(function(x) x.value_after).column("valafter")
thanks help
Comments
Post a Comment