List of usage examples for org.hibernate.id IdentifierGeneratorHelper POST_INSERT_INDICATOR
Serializable POST_INSERT_INDICATOR
To view the source code for org.hibernate.id IdentifierGeneratorHelper POST_INSERT_INDICATOR.
Click Source Link
From source file:org.primeframework.persistence.hibernate.GeneratedKeysGenerator.java
License:Open Source License
/** * If the Entity is Identifiable and has an ID, this returns that ID. Otherwise, this returns the * POST_INSERT_INDICATOR to tell Hibernate to not send anything in the insert statement and let the database generate * it./*w w w .j ava 2s . c o m*/ * * @param s Not used. * @param obj Checked to see if it is Identifiable. * @return The Identifiable ID or the POST_INSERT_INDICATOR. */ @Override public Serializable generate(SessionImplementor s, Object obj) { if (obj instanceof Identifiable) { Identifiable i = (Identifiable) obj; if (i.getId() != null) { return i.getId(); } } return IdentifierGeneratorHelper.POST_INSERT_INDICATOR; }