anishanc wrote:
Iam using a idgenerator class to generate id to the corresponding argument, That means this idgenerator class contains getNextid(String tableName) , The tableName argument may be "sales" or "purchase";
If we gave "sales" to getNextid it will return next value.
Table look like
idgenerator
id table_name value
1 sales 12
2 purchase 5
So if we call getNextid with "sales" argument it will return 13, i think u got the idea.
I need to used it in hibernate mapping file (sales.hbm.xml)'s <id> section
Wow can i do this ? which generator is used for that ? please give me some advice .. thanks to all[/list]
I think there is something in the doc about this :
Code:
<id name="id" type="long" column="cat_id">
<generator class="org.hibernate.id.TableHiLoGenerator">
<param name="table">uid_table</param>
<param name="column">next_hi_value_column</param>
</generator>
</id>
Your class generating codes have to implement org.hibernate.id.IdentifierGenerator. So you can use it after in the mapping...