Hello
All
I'm starting to use
Hibernate and i have the following problem
I'm working with an
Oracle 9 DB hibernate 2.0.2 jdk1.4.2 .
The Database is
created with some Trigger on INSERT for generating id's . Those Trigger
populate ids but also populate some other default values and do some other
stuff.
I cannot modify
those trigger because there is some already existing application which are using
them.
First in the
hbm file i ve tryied to set the generator on identity, it's not working because
the dialect Oracle 9i has no generic request for retreive the last inserted
id.
And in fact there is
no generic request for retreiving the id of the last inserted row.( of course
the name of the id column differ on each table :/)
So my the only way
for me is to select the value from the ID column on each insert or
to replace the insert request by something like this "INSERT INTO
TEST (VAL) " + "VALUES (?) RETURNING ID INTO ?". But i need help doing this
correctly. I was thinking first to use my Dialect but like i need to retrieve
the Table name , the column id name to build the request for
getIdentitySelectString . So i'm stuck.
I don't see
any simple solution to solve it. Is anybody can help me ?
B.R
Thierry