After another day of searching and a new set of eyes, I found the answer:
Googled:
Quote:
migrate hibernate session save
and found this:
https://forum.hibernate.org/viewtopic.php?f=1&t=959631&start=0The save method in the current documentation (
http://docs.jboss.org/hibernate/stable/core/reference/en/html/objectstate-makingpersistent.html) describes the Deprecated Session.save method that is now in the
org.hibernate.classic package.
I found the link here in the forum that suggests using session.replicate when all the fields are set with known values to insert.
See here for details.
https://forum.hibernate.org/viewtopic.php?f=1&t=959631&start=0For more information see:
https://forum.hibernate.org/viewtopic.php?f=1&t=957045&view=previoushttp://www.hibernate.org/250.html - Hibernate3 Migration Guide
Original Post Below:To All:
I am looking for a way to override the sequence generator on a session.save()
I want to be able to assign an id (like the default assigned strategy) sometimes, and have the sequence assign the id at other times.
Is this possible?
I see the method declaration in the documentation is different from what is described in this post:
Code:
Serializable save(String entityName, Object object)
Persist the given transient instance, first assigning a generated identifier.
Is the entityName the property of the id?
Will it use the value of that property in object?
I'm trying to provide a primary key instead of having the generated one saved (in this case generated from a trigger)
Can the generator be overridden?
Thanks.
see here from other post (posted in nhibernate inadvertantly)
https://forum.hibernate.org/viewtopic.php?f=25&t=983700