I did something like this:
Code:
Configuration cfg = new Configuration();
Iterator mappings = cfg.getClassMappings();
while (mappings.hasNext) {
RootClass rootClass = (RootClass)mappings.next();
SimpleValue simpleValue = new SimpleValue(rootClass.getTable);
System.out.println(simpleValue.getIdentifierGenerationStrategy());
}
I figured I could use this to set the generator class for id:
Code:
simpleValue.setIdentifierGenerationStrategy()
Output:
assigned
The problem is i have my hbm.xml set like this:
Code:
<id name="id" type="integer" column="CAT_ID" unsaved-value="0">
<generator class="identity"/>
</id>
So, I was expecting the output as 'identity' and not 'assigned'.
Can anyone tell where I am going wrong?
I am using Hibernate 3.0rc1 with DB2 8.1.3 UDB
Thanks.