Hey,
I am using hibernate 3.1.3 version.
I have a USER table in oracle database with two fields OJBECTID and NAME. I have created a function "createObjId(arg1, arg2)" in oracle to generate a primary key value (for OBJECTID field).
My question is in mapping file how I can call this function so that an id can be generated using this function when inserting record. And how I will pass the args to the method while inserting a record.
I can do this using direct JDBC by:
insert into USER (OBJECTID, NAME) values (createObjId('key1', 'key2'), 'user2');
I am looking to perform the same using hibernate.
Thanks.
Sanjeev Singal
|