Hi,
I'm developing a project where frequently i need to import existing data from xml files and where all the attributes of the instances, including the id, are already set. To cope with that, i'm using the "assigned" id generation strategy of hibernate. The problem is that i will need to create new instances, and for that i would like hibernate to generate the ids, according to the native strategy. Is there a way to use the combination of this two strategies, to generate the id only when the field is empty or not set? Has anyone did something similar? If it's not possible how can i create my own id generator to resolve this issue?
Thanks in advance for the reply!
MAD
|