Hello...I have a simple question, but I really don't know how to solve it.
I'm using this generator
<generator class="org.hibernate.id.enhanced.SequenceStyleGenerator">
<param name="initial_value">100</param>
<param name="sequence_name">UserSequence</param>
</generator>
The sequence starts at 100 on purpose, because I need to insert some users with pre-defined ids (admin == id - 0)...and that is the problem...I have sequence, so I cannot save it, because I have specified id (and I am not using assigned generator), if i try to persist it, it is detached entity...and I cannot use assigned ID's, because except of these few predefined users I want hibernate to take care of ids for me....and i really dont want to insert it via sql, because I dont want to depend on specific SQL...
Thanks (and sorry for my english).
|