| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Serializable | getEntityIdentifierIfNotUnsaved(final String entityName, final Object object, final SessionImplementor session)
Return the identifier of the persistent or transient object, or throw an exception if the instance is "unsaved" Used by OneToOneType and ManyToOneType to determine what id value should be used for an object that may or may not be associated with the session. |
| public static boolean | isNotTransient(String entityName, Object entity, Boolean assumed, SessionImplementor session)
Is this instance persistent or detached? |
| public static boolean | isTransient(String entityName, Object entity, Boolean assumed, SessionImplementor session)
Is this instance, which we know is not persistent, actually transient? |
| ForeignKeys | back to summary |
|---|---|
| private ForeignKeys() | |
| getEntityIdentifierIfNotUnsaved | back to summary |
|---|---|
| public static Serializable getEntityIdentifierIfNotUnsaved(final String entityName, final Object object, final SessionImplementor session) throws HibernateException Return the identifier of the persistent or transient object, or throw an exception if the instance is "unsaved" Used by OneToOneType and ManyToOneType to determine what id value should be used for an object that may or may not be associated with the session. This does a "best guess" using any/all info available to use (not just the EntityEntry). | |
| isNotTransient | back to summary |
|---|---|
| public static boolean isNotTransient(String entityName, Object entity, Boolean assumed, SessionImplementor session) throws HibernateException Is this instance persistent or detached? If assumed is non-null, don't hit the database to make the determination, instead assume that value; the client code must be prepared to "recover" in the case that this assumed result is incorrect. | |
| isTransient | back to summary |
|---|---|
| public static boolean isTransient(String entityName, Object entity, Boolean assumed, SessionImplementor session) throws HibernateException Is this instance, which we know is not persistent, actually transient? If assumed is non-null, don't hit the database to make the determination, instead assume that value; the client code must be prepared to "recover" in the case that this assumed result is incorrect. | |
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private final boolean | |
| private final Object | |
| private final SessionImplementor |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private boolean | isNullifiable(final String entityName, Object object)
Determine if the object already exists in the database, using a "best guess" |
| public void | nullifyTransientReferences(final Object[] values, final Type[] types)
Nullify all references to entities that have not yet been inserted in the database, where the foreign key points toward that entity |
| private Object | nullifyTransientReferences(final Object value, final Type type)
Return null if the argument is an "unsaved" entity (ie. |
| isDelete | back to summary |
|---|---|
| private final boolean isDelete | |
| isEarlyInsert | back to summary |
|---|---|
| private final boolean isEarlyInsert | |
| self | back to summary |
|---|---|
| private final Object self | |
| session | back to summary |
|---|---|
| private final SessionImplementor session | |
| Nullifier | back to summary |
|---|---|
| public Nullifier(Object self, boolean isDelete, boolean isEarlyInsert, SessionImplementor session) | |
| isNullifiable | back to summary |
|---|---|
| private boolean isNullifiable(final String entityName, Object object) throws HibernateException Determine if the object already exists in the database, using a "best guess" | |
| nullifyTransientReferences | back to summary |
|---|---|
| public void nullifyTransientReferences(final Object[] values, final Type[] types) throws HibernateException Nullify all references to entities that have not yet been inserted in the database, where the foreign key points toward that entity | |
| nullifyTransientReferences | back to summary |
|---|---|
| private Object nullifyTransientReferences(final Object value, final Type type) throws HibernateException Return null if the argument is an "unsaved" entity (ie. one with no existing database row), or the input argument otherwise. This is how Hibernate avoids foreign key constraint violations. | |