public final class ForeignKeys extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ForeignKeys.Nullifier |
Modifier and Type | Method and Description |
---|---|
static NonNullableTransientDependencies |
findNonNullableTransientEntities(String entityName,
Object entity,
Object[] values,
boolean isEarlyInsert,
SessionImplementor session)
Find all non-nullable references to entities that have not yet
been inserted in the database, where the foreign key
is a reference to an unsaved transient entity.
|
static Serializable |
getEntityIdentifierIfNotUnsaved(String entityName,
Object object,
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.
|
static boolean |
isNotTransient(String entityName,
Object entity,
Boolean assumed,
SessionImplementor session)
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.
|
static boolean |
isTransient(String entityName,
Object entity,
Boolean assumed,
SessionImplementor session)
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.
|
public static boolean isNotTransient(String entityName, Object entity, Boolean assumed, SessionImplementor session) throws HibernateException
HibernateException
public static boolean isTransient(String entityName, Object entity, Boolean assumed, SessionImplementor session) throws HibernateException
HibernateException
public static Serializable getEntityIdentifierIfNotUnsaved(String entityName, Object object, SessionImplementor session) throws HibernateException
HibernateException
public static NonNullableTransientDependencies findNonNullableTransientEntities(String entityName, Object entity, Object[] values, boolean isEarlyInsert, SessionImplementor session)
entityName
- - the entity nameentity
- - the entity instancevalues
- - insertable properties of the object (including backrefs),
possibly with substitutionsisEarlyInsert
- - true if the entity needs to be executed as soon as possible
(e.g., to generate an ID)session
- - the sessionCopyright © 2018 JBoss by Red Hat. All rights reserved.