Hi there,
I have a problem with the generation of primary keys:
I am using
Oracle 9.2
hibernate3 (3.2.4.sp1)
JBOSS
I use the following xml-mapping code for generating the key
Code:
<id name="passwordId" type="java.lang.Long">
<column name="PASSWORD_ID" precision="11" scale="0" />
<generator class="increment" />
</id>
The generation of the next id works fine - and as the log says - and debuging show it will be set in the pojo before persisting the Object
Code:
2007-07-26 14:43:45,796 DEBUG [org.hibernate.type.LongType] binding '321' to parameter: 1
But a look into the database does not show the' 321' but a number like '00000000000000000000000123034'.
The property of the Pojo is defined as java.lang.Long and the attribute in the Database is defined as Number(11).
By the way the same behaviour can be recognized on using other generator classes too.
Surprisingly some other tables work well although the same definitions for pk-generation are set.
Thanks for help!![/code]