Hi
I posted this query on the wrong board:
I wrote:
Is it possible to set the identity field of an entity and have session.save persist the class using the specified value for the identity field ? Currently it just seems to be ignoring the value, using the new one retrieved from the mysql auto_increment id field instead.
I know it's not the normal behaviour but for running unit tests driven by data loaded from csv's for example it is by far the easiest way of doing things.
And got in reply
emmanuel wrote:
this is not an ejb3 question.
use generator="assigned"
to which I would like to continue with...
I would rather not change the generator to "assigned" because then the auto number creation would not happen when running under normal conditions if I understand it correctly. Ideally the number would be taken from the auto_increment when zero, and otherwise taken as if the generator was "assigned" when non-zero. Is the only solution to create my own generator ?
David