|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hibernate.persister.entity.AbstractEntityPersister
public abstract class AbstractEntityPersister
Basic functionality for persisting an entity via JDBC through either generated or custom SQL
Nested Class Summary | |
---|---|
protected static interface |
AbstractEntityPersister.InclusionChecker
|
Nested classes/interfaces inherited from interface org.hibernate.persister.entity.Queryable |
---|
Queryable.Declarer |
Field Summary | |
---|---|
protected String[] |
customSQLDelete
|
protected String[] |
customSQLInsert
|
protected String[] |
customSQLUpdate
|
protected boolean[] |
deleteCallable
|
protected ExecuteUpdateResultCheckStyle[] |
deleteResultCheckStyles
|
static String |
ENTITY_CLASS
|
protected boolean[] |
insertCallable
|
protected ExecuteUpdateResultCheckStyle[] |
insertResultCheckStyles
|
protected BasicEntityPropertyMapping |
propertyMapping
|
protected String |
rowIdName
|
protected boolean[] |
updateCallable
|
protected ExecuteUpdateResultCheckStyle[] |
updateResultCheckStyles
|
Fields inherited from interface org.hibernate.persister.entity.Loadable |
---|
ROWID_ALIAS |
Fields inherited from interface org.hibernate.persister.entity.EntityPersister |
---|
ENTITY_ID |
Fields inherited from interface org.hibernate.intercept.LazyPropertyInitializer |
---|
UNFETCHED_PROPERTY |
Constructor Summary | |
---|---|
AbstractEntityPersister(PersistentClass persistentClass,
EntityRegionAccessStrategy cacheAccessStrategy,
SessionFactoryImplementor factory)
|
Method Summary | |
---|---|
protected void |
addDiscriminatorToInsert(Insert insert)
|
protected void |
addDiscriminatorToSelect(SelectFragment select,
String name,
String suffix)
|
void |
afterInitialize(Object entity,
boolean lazyPropertiesAreUnfetched,
SessionImplementor session)
Called just after the entities properties have been initialized |
void |
afterReassociate(Object entity,
SessionImplementor session)
Called just after the entity has been reassociated with the session |
boolean |
canExtractIdOutOfEntity()
Determine whether detached instances of this entity carry their own identifier value. |
protected boolean |
check(int rows,
Serializable id,
int tableNumber,
Expectation expectation,
PreparedStatement statement)
|
protected String |
concretePropertySelectFragment(String alias,
AbstractEntityPersister.InclusionChecker inclusionChecker)
|
protected String |
concretePropertySelectFragment(String alias,
boolean[] includeProperty)
|
protected String |
concretePropertySelectFragment(String alias,
ValueInclusion[] inclusions)
|
protected String |
concretePropertySelectFragmentSansLeadingComma(String alias,
boolean[] include)
|
boolean |
consumesCollectionAlias()
Very, very, very ugly... |
boolean |
consumesEntityAlias()
Very, very, very ugly... |
int |
countSubclassProperties()
How many properties are there, for this class and all subclasses? |
protected UniqueEntityLoader |
createEntityLoader(LockMode lockMode)
|
protected UniqueEntityLoader |
createEntityLoader(LockMode lockMode,
LoadQueryInfluencers loadQueryInfluencers)
|
protected UniqueEntityLoader |
createEntityLoader(LockOptions lockOptions,
LoadQueryInfluencers loadQueryInfluencers)
|
protected String |
createFrom(int tableNumber,
String alias)
|
protected JoinFragment |
createJoin(int[] tableNumbers,
String drivingAlias)
|
protected JoinFragment |
createJoin(String name,
boolean innerJoin,
boolean includeSubclasses)
|
protected void |
createLoaders()
|
Object |
createProxy(Serializable id,
SessionImplementor session)
Create a new proxy instance |
protected void |
createQueryLoader()
|
protected SelectFragment |
createSelect(int[] subclassColumnNumbers,
int[] subclassFormulaNumbers)
|
protected void |
createUniqueKeyLoaders()
|
protected String |
createWhereByKey(int tableNumber,
String alias)
|
protected int |
dehydrate(Serializable id,
Object[] fields,
boolean[] includeProperty,
boolean[][] includeColumns,
int j,
PreparedStatement st,
SessionImplementor session)
|
protected int |
dehydrate(Serializable id,
Object[] fields,
Object rowId,
boolean[] includeProperty,
boolean[][] includeColumns,
int j,
PreparedStatement ps,
SessionImplementor session,
int index)
Marshall the fields of a persistent instance to a prepared statement |
protected void |
delete(Serializable id,
Object version,
int j,
Object object,
String sql,
SessionImplementor session,
Object[] loadedState)
Perform an SQL DELETE |
void |
delete(Serializable id,
Object version,
Object object,
SessionImplementor session)
Delete an object |
protected abstract String |
filterFragment(String alias)
|
String |
filterFragment(String alias,
Map enabledFilters)
Get the where clause filter, given a query alias and considering enabled session filters |
int[] |
findDirty(Object[] currentState,
Object[] previousState,
Object entity,
SessionImplementor session)
Locate the property-indices of all properties considered to be dirty. |
int[] |
findModified(Object[] old,
Object[] current,
Object entity,
SessionImplementor session)
Locate the property-indices of all properties considered to be dirty. |
Object |
forceVersionIncrement(Serializable id,
Object currentVersion,
SessionImplementor session)
|
String |
fromJoinFragment(String alias,
boolean innerJoin,
boolean includeSubclasses)
Get the from clause part of any joins (optional operation) |
protected String |
generateDeleteString(int j)
Generate the SQL that deletes a row by id (and version) |
String |
generateFilterConditionAlias(String rootAlias)
The alias used for any filter conditions (mapped where-fragments or enabled-filters). |
protected String |
generateIdentityInsertString(boolean[] includeProperty)
Used to generate an insery statement against the root table in the case of identifier generation strategies where the insert statement executions actually generates the identifier value. |
protected String |
generateInsertGeneratedValuesSelectString()
|
protected String |
generateInsertString(boolean[] includeProperty,
int j)
|
protected String |
generateInsertString(boolean identityInsert,
boolean[] includeProperty)
|
protected String |
generateInsertString(boolean identityInsert,
boolean[] includeProperty,
int j)
Generate the SQL that inserts a row |
protected String |
generateLazySelectString()
|
protected LockingStrategy |
generateLocker(LockMode lockMode)
|
protected String |
generateSelectVersionString()
Generate the SQL that selects the version number by id |
protected String |
generateSnapshotSelectString()
|
protected String |
generateTableAlias(String rootAlias,
int tableNumber)
|
protected String |
generateUpdateGeneratedValuesSelectString()
|
protected String |
generateUpdateString(boolean[] includeProperty,
int j,
boolean useRowId)
|
protected String |
generateUpdateString(boolean[] includeProperty,
int j,
Object[] oldFields,
boolean useRowId)
Generate the SQL that updates a row by id (and version) |
EntityRegionAccessStrategy |
getCacheAccessStrategy()
Get the cache (optional operation) |
CacheEntryStructure |
getCacheEntryStructure()
Get the cache structure |
CascadeStyle |
getCascadeStyle(int i)
Get the cascade style of this (subclass closure) property |
ClassMetadata |
getClassMetadata()
Get the user-visible metadata for the class (optional operation) |
Class |
getConcreteProxyClass(EntityMode entityMode)
Get the proxy interface that instances of this concrete class will be cast to (optional operation). |
Object |
getCurrentVersion(Serializable id,
SessionImplementor session)
Retrieve the version number |
Object[] |
getDatabaseSnapshot(Serializable id,
SessionImplementor session)
Get the current database state of the object, in a "hydrated" form, without resolving identifiers |
protected String |
getDiscriminatorAlias()
|
String |
getDiscriminatorAlias(String suffix)
Get the result set aliases used for the identifier columns, given a suffix |
String |
getDiscriminatorColumnName()
|
String |
getDiscriminatorColumnReaders()
|
String |
getDiscriminatorColumnReaderTemplate()
|
protected String |
getDiscriminatorFormulaTemplate()
|
EntityMetamodel |
getEntityMetamodel()
Retrieve the underlying entity metamodel instance... |
String |
getEntityName()
The entity name which this persister maps. |
EntityType |
getEntityType()
|
SessionFactoryImplementor |
getFactory()
Return the SessionFactory to which this persister "belongs". |
FetchMode |
getFetchMode(int i)
May this (subclass closure) property be fetched using an SQL outerjoin? |
Serializable |
getIdentifier(Object object,
EntityMode entityMode)
Get the identifier of an instance (throw an exception if no identifier property) |
Serializable |
getIdentifier(Object entity,
SessionImplementor session)
Get the identifier of an instance (throw an exception if no identifier property) |
protected String[] |
getIdentifierAliases()
|
String[] |
getIdentifierAliases(String suffix)
Get the result set aliases used for the identifier columns, given a suffix |
String[] |
getIdentifierColumnNames()
Get the names of columns used to persist the identifier |
String[] |
getIdentifierColumnReaders()
|
String[] |
getIdentifierColumnReaderTemplates()
|
protected int |
getIdentifierColumnSpan()
|
IdentifierGenerator |
getIdentifierGenerator()
Determine which identifier generation strategy is used for this entity. |
String |
getIdentifierPropertyName()
Get the name of the identifier property (or return null) - need not return the name of an actual Java property |
Type |
getIdentifierType()
Get the identifier type |
String |
getIdentitySelectString()
Get the database-specific SQL command to retrieve the last generated IDENTITY value. |
String[] |
getKeyColumnNames()
The columns to join on |
protected abstract String[] |
getKeyColumns(int j)
|
protected Set |
getLazyProperties()
|
protected Map |
getLoaders()
|
Class |
getMappedClass(EntityMode entityMode)
The persistent class, or null |
String |
getMappedSuperclass()
Get the class that this class is mapped as a subclass of - not necessarily the direct superclass |
String |
getName()
An identifying name; a class name or collection role name. |
int[] |
getNaturalIdentifierProperties()
If the entity defines a natural id ( EntityPersister.hasNaturalIdentifier() ), which
properties make up the natural id. |
Object[] |
getNaturalIdentifierSnapshot(Serializable id,
SessionImplementor session)
Retrieve the current state of the natural-id properties from the database. |
boolean[] |
getNonLazyPropertyUpdateability()
|
protected boolean[] |
getPropertiesToInsert(Object[] fields)
Transform the array of property indexes to an array of booleans, true when the property is insertable and non-null |
protected boolean[] |
getPropertiesToUpdate(int[] dirtyProperties,
boolean hasDirtyCollection)
Transform the array of property indexes to an array of booleans, true when the property is dirty |
String[] |
getPropertyAliases(String suffix,
int i)
Get the result set aliases used for the property columns, given a suffix (properties of this class, only). |
CascadeStyle[] |
getPropertyCascadeStyles()
Get the cascade styles of the properties (optional operation) |
boolean[] |
getPropertyCheckability()
Get the "checkability" of the properties of this class (is the property dirty checked, does the cache need to be updated) |
protected boolean[][] |
getPropertyColumnInsertable()
|
String[] |
getPropertyColumnNames(int i)
Get the result set column names mapped for this property (properties of this class, only). |
String[] |
getPropertyColumnNames(String propertyName)
Get the column names for the given property path |
protected int |
getPropertyColumnSpan(int i)
|
protected boolean[][] |
getPropertyColumnUpdateable()
|
String[] |
getPropertyColumnWriters(int i)
|
int |
getPropertyIndex(String propertyName)
Get the property number of the unique key property |
boolean[] |
getPropertyInsertability()
Get the "insertability" of the properties of this class (does the property appear in an SQL INSERT) |
ValueInclusion[] |
getPropertyInsertGenerationInclusions()
Which of the properties of this class are database generated values on insert? |
boolean[] |
getPropertyLaziness()
Get the "laziness" of the properties of this class |
String[] |
getPropertyNames()
Get the names of the class properties - doesn't have to be the names of the actual Java properties (used for XML generation only) |
boolean[] |
getPropertyNullability()
Get the nullability of the properties of this class |
protected boolean[] |
getPropertySelectable()
|
protected int |
getPropertySpan()
|
protected String[] |
getPropertySubclassNames()
|
protected abstract int[] |
getPropertyTableNumbers()
|
protected abstract int[] |
getPropertyTableNumbersInSelect()
|
Type |
getPropertyType(String propertyName)
Get the type of a particular property by name. |
Type[] |
getPropertyTypes()
Get the Hibernate types of the class properties |
boolean[] |
getPropertyUniqueness()
|
boolean[] |
getPropertyUpdateability()
Get the "updateability" of the properties of this class (does the property appear in an SQL UPDATE) |
protected boolean[] |
getPropertyUpdateability(Object entity,
EntityMode entityMode)
Which properties appear in the SQL update? (Initialized, updateable ones!) |
ValueInclusion[] |
getPropertyUpdateGenerationInclusions()
Which of the properties of this class are database generated values on update? |
Object |
getPropertyValue(Object object,
int i,
EntityMode entityMode)
Get the value of a particular property |
Object |
getPropertyValue(Object object,
String propertyName,
EntityMode entityMode)
Get the value of a particular property |
Object[] |
getPropertyValues(Object object,
EntityMode entityMode)
Return the (loaded) values of the mapped properties of the object (not including backrefs) |
Object[] |
getPropertyValuesToInsert(Object object,
Map mergeMap,
SessionImplementor session)
Return the values of the insertable properties of the object (including backrefs) |
boolean[] |
getPropertyVersionability()
Get the "versionability" of the properties of this class (is the property optimistic-locked) |
Serializable[] |
getQuerySpaces()
Returns an array of objects that identify spaces in which properties of this entity are persisted, for instances of this class and its subclasses. |
String |
getRootEntityName()
Returns an object that identifies the space in which identifiers of this entity hierarchy are unique. |
String |
getRootTableAlias(String drivingAlias)
Get the SQL alias this persister would use for the root table given the passed driving alias. |
String[] |
getRootTableIdentifierColumnNames()
Get the names of columns on the root table used to persist the identifier. |
String[] |
getRootTableKeyColumnNames()
The names of the primary key columns in the root table. |
String |
getRootTableName()
Locks are always applied to the "root table". |
String |
getSelectByUniqueKeyString(String propertyName)
Get a SQL select string that performs a select based on a unique key determined by the given property name). |
protected String |
getSequentialSelect(String entityName)
|
protected String[] |
getSQLDeleteStrings()
|
protected String |
getSQLIdentityInsertString()
The query that inserts a row, letting the database generate an id |
protected String[] |
getSQLInsertStrings()
|
protected String |
getSQLLazySelectString()
|
protected String[] |
getSQLLazyUpdateByRowIdStrings()
|
protected String[] |
getSQLLazyUpdateStrings()
|
protected String |
getSQLSnapshotSelectString()
|
protected String[] |
getSQLUpdateByRowIdStrings()
|
protected String[] |
getSQLUpdateStrings()
|
protected String |
getSQLWhereString(String alias)
|
protected String[] |
getSubclassColumnAliasClosure()
|
protected String[] |
getSubclassColumnClosure()
|
protected boolean[] |
getSubclassColumnLazyiness()
|
String[] |
getSubclassColumnReaderTemplateClosure()
|
protected abstract int[] |
getSubclassColumnTableNumberClosure()
|
EntityPersister |
getSubclassEntityPersister(Object instance,
SessionFactoryImplementor factory,
EntityMode entityMode)
A request has already identified the entity-name of this persister as the mapping for the given instance. |
protected String[] |
getSubclassFormulaAliasClosure()
|
protected String[] |
getSubclassFormulaClosure()
|
protected boolean[] |
getSubclassFormulaLazyiness()
|
protected abstract int[] |
getSubclassFormulaTableNumberClosure()
|
protected String[] |
getSubclassFormulaTemplateClosure()
|
String[] |
getSubclassPropertyColumnAliases(String propertyName,
String suffix)
Return the column alias names used to persist/query the named property of the class or a subclass (optional operation). |
protected String[][] |
getSubclassPropertyColumnNameClosure()
|
String[] |
getSubclassPropertyColumnNames(int i)
Return the column names used to persist the numbered property of the class or a subclass. |
String[] |
getSubclassPropertyColumnNames(String propertyName)
Return the column names used to persist/query the named property of the class or a subclass (optional operation). |
String[][] |
getSubclassPropertyColumnReaderClosure()
|
String[][] |
getSubclassPropertyColumnReaderTemplateClosure()
|
Queryable.Declarer |
getSubclassPropertyDeclarer(String propertyPath)
Determine whether the given property is declared by our mapped class, our super class, or one of our subclasses... |
protected String[][] |
getSubclassPropertyFormulaTemplateClosure()
|
String |
getSubclassPropertyName(int i)
Get the name of the numbered property of the class or a subclass. |
protected String[] |
getSubclassPropertyNameClosure()
|
protected String[] |
getSubclassPropertySubclassNameClosure()
|
protected abstract int |
getSubclassPropertyTableNumber(int i)
|
int |
getSubclassPropertyTableNumber(String propertyPath)
Warning: When there are duplicated property names in the subclasses of the class, this method may return the wrong table number for the duplicated subclass property (note that SingleTableEntityPersister defines an overloaded form which takes the entity name. |
Type |
getSubclassPropertyType(int i)
Get the type of the numbered property of the class or a subclass. |
protected Type[] |
getSubclassPropertyTypeClosure()
|
protected abstract String[] |
getSubclassTableKeyColumns(int j)
|
abstract String |
getSubclassTableName(int j)
Get the name of the table with the given index from the internal array. |
protected abstract int |
getSubclassTableSpan()
|
protected abstract String |
getTableName(int j)
|
protected abstract int |
getTableSpan()
|
protected boolean[] |
getTableUpdateNeeded(int[] dirtyProperties,
boolean hasDirtyCollection)
Decide which tables need to be updated. |
String |
getTemporaryIdTableDDL()
Get the appropriate DDL command for generating the temporary table to be used to (potentially) store id values when performing bulk update/deletes. |
String |
getTemporaryIdTableName()
Get the name of the temporary table to be used to (potentially) store id values when performing bulk update/deletes. |
protected EntityTuplizer |
getTuplizer(EntityMode entityMode)
|
protected EntityTuplizer |
getTuplizer(SessionImplementor session)
|
Type |
getType()
Get the type of the thing containing the properties |
DiscriminatorMetadata |
getTypeDiscriminatorMetadata()
Retrieve the information needed to properly deal with this entity's discriminator in a query. |
Object |
getVersion(Object object,
EntityMode entityMode)
Get the version number (or timestamp) from the object's version property (or return null if not versioned) |
String |
getVersionColumnName()
For versioned entities, get the name of the column (again, expected on the root table) used to store the version values. |
Comparator |
getVersionComparator()
Get the comparator used to compare two different version values. |
protected String |
getVersionedTableName()
|
int |
getVersionProperty()
If EntityPersister.isVersioned() , then what is the index of the property
holding the locking value. |
protected String |
getVersionSelectString()
|
VersionType |
getVersionType()
If EntityPersister.isVersioned() , then what is the type of the property
holding the locking value. |
EntityMode |
guessEntityMode(Object object)
Try to discover the entity mode from the entity instance |
boolean |
hasCache()
Does this class have a cache. |
boolean |
hasCascades()
Determine whether this entity has any non-none cascading. |
boolean |
hasCollections()
Determine whether this entity contains references to persistent collections. |
protected boolean |
hasEmbeddedCompositeIdentifier()
|
protected boolean |
hasFormulaProperties()
|
boolean |
hasIdentifierProperty()
Determine whether the entity has a particular property holding the identifier value. |
boolean |
hasInsertGeneratedProperties()
Does this entity define any properties as being database generated on insert? |
boolean |
hasLazyProperties()
Determine whether this entity defines any lazy properties (ala bytecode instrumentation). |
boolean |
hasMutableProperties()
Determine whether any properties of this entity are considered mutable. |
boolean |
hasNaturalIdentifier()
Determine whether this entity defines a natural identifier. |
boolean |
hasProxy()
Determine whether this entity supports dynamic proxies. |
boolean |
hasRowId()
Does the result set contain rowids? |
boolean |
hasSequentialSelect()
|
boolean |
hasSubclasses()
Does this persistent class have subclasses? |
boolean |
hasSubselectLoadableCollections()
Determine whether this entity contains references to persistent collections which are fetchable by subselect? |
boolean |
hasUninitializedLazyProperties(Object object,
EntityMode entityMode)
Does the given instance have any uninitialized lazy properties? |
boolean |
hasUpdateGeneratedProperties()
Does this entity define any properties as being database generated on update? |
protected boolean |
hasWhere()
|
Object[] |
hydrate(ResultSet rs,
Serializable id,
Object object,
Loadable rootLoadable,
String[][] suffixedPropertyColumns,
boolean allProperties,
SessionImplementor session)
Unmarshall the fields of a persistent instance from a result set, without resolving associations or collections. |
String |
identifierSelectFragment(String name,
String suffix)
Given a query alias and an identifying suffix, render the intentifier select fragment. |
boolean |
implementsLifecycle(EntityMode entityMode)
Does the class implement the Lifecycle interface. |
boolean |
implementsValidatable(EntityMode entityMode)
Does the class implement the Validatable interface. |
Object |
initializeLazyProperty(String fieldName,
Object entity,
SessionImplementor session)
Initialize the property, and return its new value |
protected void |
initLockers()
|
protected void |
initPropertyPaths(Mapping mapping)
|
protected void |
initSubclassPropertyAliasesMap(PersistentClass model)
Must be called by subclasses, at the end of their constructors |
protected Serializable |
insert(Object[] fields,
boolean[] notNull,
String sql,
Object object,
SessionImplementor session)
Perform an SQL INSERT, and then retrieve a generated identifier. |
Serializable |
insert(Object[] fields,
Object object,
SessionImplementor session)
Persist an instance, using a natively generated identifier (optional operation) |
protected void |
insert(Serializable id,
Object[] fields,
boolean[] notNull,
int j,
String sql,
Object object,
SessionImplementor session)
Perform an SQL INSERT. |
void |
insert(Serializable id,
Object[] fields,
Object object,
SessionImplementor session)
Persist an instance |
Object |
instantiate(Serializable id,
EntityMode entityMode)
Create a class instance initialized with the given identifier |
Object |
instantiate(Serializable id,
SessionImplementor session)
Create a class instance initialized with the given identifier |
boolean |
isAbstract()
Is this an abstract class? |
boolean |
isBatchable()
|
boolean |
isBatchLoadable()
Is batch loading enabled? |
boolean |
isCacheInvalidationRequired()
We can't immediately add to the cache if we have formulas which must be evaluated, or if we have the possibility of two concurrent updates to the same item being merged on the database. |
protected abstract boolean |
isClassOrSuperclassTable(int j)
|
boolean |
isCollection()
Is this instance actually a CollectionPersister? |
boolean |
isDefinedOnSubclass(int i)
Is this property defined on a subclass of the mapped class. |
protected boolean |
isDeleteCallable(int j)
|
boolean |
isExplicitPolymorphism()
Is this class explicit polymorphism only? |
boolean |
isIdentifierAssignedByInsert()
Are identifiers of this entity assigned known before the insert execution? Or, are they generated (in the database) by the insert execution. |
boolean |
isInherited()
Determine whether the entity is inherited one or more other entities. |
protected boolean |
isInsertCallable(int j)
|
boolean |
isInstance(Object object,
EntityMode entityMode)
Is the given object an instance of this entity? |
boolean |
isInstrumented(EntityMode entityMode)
Has the class actually been bytecode instrumented? |
protected boolean |
isInverseSubclassTable(int j)
|
protected boolean |
isInverseTable(int j)
|
boolean |
isLazyPropertiesCacheable()
Should lazy properties of this entity be cached? |
boolean |
isMultiTable()
Is the inheritence hierarchy described by this persister contained across multiple tables? |
boolean |
isMutable()
Determine whether instances of this entity are considered mutable. |
protected boolean |
isNullableSubclassTable(int j)
|
protected boolean |
isNullableTable(int j)
|
boolean |
isPolymorphic()
|
protected abstract boolean |
isPropertyOfTable(int property,
int j)
|
boolean |
isSelectBeforeUpdateRequired()
Is select snapshot before update enabled? |
boolean |
isSubclassEntityName(String entityName)
Determine whether the given name represents a subclass entity (or this entity itself) of the entity mapped by this persister. |
protected boolean |
isSubclassPropertyDeferred(String propertyName,
String entityName)
|
boolean |
isSubclassPropertyNullable(int i)
Is the numbered property of the class of subclass nullable? |
protected boolean |
isSubclassTableLazy(int j)
|
protected boolean |
isSubclassTableSequentialSelect(int j)
|
protected abstract boolean |
isTableCascadeDeleteEnabled(int j)
|
Boolean |
isTransient(Object entity,
SessionImplementor session)
Is this a new transient instance? |
protected boolean |
isUpdateCallable(int j)
|
boolean |
isVersioned()
Determine whether optimistic locking by column is enabled for this entity. |
boolean |
isVersionPropertyGenerated()
Does this entity contain a version property that is defined to be database generated? |
boolean |
isVersionPropertyInsertable()
Is the version property included in insert statements? |
Object |
load(Serializable id,
Object optionalObject,
LockMode lockMode,
SessionImplementor session)
Load an instance using either the forUpdateLoader or the outer joining loader, depending upon the value of the lock parameter |
Object |
load(Serializable id,
Object optionalObject,
LockOptions lockOptions,
SessionImplementor session)
Load an instance using either the forUpdateLoader or the outer joining loader, depending upon the value of the lock parameter |
Object |
loadByUniqueKey(String propertyName,
Object uniqueKey,
SessionImplementor session)
Load an instance of the persistent class, by a unique key other than the primary key. |
void |
lock(Serializable id,
Object version,
Object object,
LockMode lockMode,
SessionImplementor session)
Do a version check (optional operation) |
void |
lock(Serializable id,
Object version,
Object object,
LockOptions lockOptions,
SessionImplementor session)
Do a version check (optional operation) |
protected void |
logStaticSQL()
|
String |
oneToManyFilterFragment(String alias)
|
protected int |
optimisticLockMode()
|
protected void |
postConstruct(Mapping mapping)
|
void |
postInstantiate()
Finish the initialization of this object. |
void |
processInsertGeneratedProperties(Serializable id,
Object entity,
Object[] state,
SessionImplementor session)
Perform a select to retrieve the values of any generated properties back from the database, injecting these generated values into the given entity as well as writing this state to the PersistenceContext . |
void |
processUpdateGeneratedProperties(Serializable id,
Object entity,
Object[] state,
SessionImplementor session)
Perform a select to retrieve the values of any generated properties back from the database, injecting these generated values into the given entity as well as writing this state to the PersistenceContext . |
String |
propertySelectFragment(String tableAlias,
String suffix,
boolean allProperties)
Given a query alias and an identifying suffix, render the property select fragment. |
SelectFragment |
propertySelectFragmentFragment(String tableAlias,
String suffix,
boolean allProperties)
|
void |
registerAffectingFetchProfile(String fetchProfileName)
Register the name of a fetch profile determined to have an affect on the underlying loadable in regards to the fact that the underlying load SQL needs to be adjust when the given fetch profile is enabled. |
protected String |
renderSelect(int[] tableNumbers,
int[] columnNumbers,
int[] formulaNumbers)
|
void |
resetIdentifier(Object entity,
Serializable currentId,
Object currentVersion,
EntityMode entityMode)
Set the identifier and version of the given instance back to its "unsaved" value. |
void |
resetIdentifier(Object entity,
Serializable currentId,
Object currentVersion,
SessionImplementor session)
Set the identifier and version of the given instance back to its "unsaved" value. |
String |
selectFragment(Joinable rhs,
String rhsAlias,
String lhsAlias,
String entitySuffix,
String collectionSuffix,
boolean includeCollectionColumns)
All columns to select, when loading. |
String |
selectFragment(String alias,
String suffix)
Generate a list of collection index, key and element columns |
void |
setIdentifier(Object entity,
Serializable id,
EntityMode entityMode)
Inject the identifier value into the given entity. |
void |
setIdentifier(Object entity,
Serializable id,
SessionImplementor session)
Inject the identifier value into the given entity. |
void |
setPropertyValue(Object object,
int i,
Object value,
EntityMode entityMode)
Set the value of a particular property |
void |
setPropertyValue(Object object,
String propertyName,
Object value,
EntityMode entityMode)
Set the value of a particular (named) property |
void |
setPropertyValues(Object object,
Object[] values,
EntityMode entityMode)
Set the given values to the mapped properties of the given object |
String[] |
toColumns(String propertyName)
Given a property path, return the corresponding column name(s). |
String[] |
toColumns(String name,
int i)
Given the number of a property of a subclass, and a table alias, return the aliased column names. |
String[] |
toColumns(String alias,
String propertyName)
Given a query alias and a property path, return the qualified column name |
String |
toString()
|
Type |
toType(String propertyName)
Given a component path expression, get the type of the property |
void |
update(Serializable id,
Object[] fields,
int[] dirtyFields,
boolean hasDirtyCollection,
Object[] oldFields,
Object oldVersion,
Object object,
Object rowId,
SessionImplementor session)
Update an object |
protected boolean |
update(Serializable id,
Object[] fields,
Object[] oldFields,
Object rowId,
boolean[] includeProperty,
int j,
Object oldVersion,
Object object,
String sql,
SessionImplementor session)
|
protected void |
updateOrInsert(Serializable id,
Object[] fields,
Object[] oldFields,
Object rowId,
boolean[] includeProperty,
int j,
Object oldVersion,
Object object,
String sql,
SessionImplementor session)
Perform an SQL UPDATE or SQL INSERT |
protected boolean |
useDynamicInsert()
|
protected boolean |
useDynamicUpdate()
|
protected boolean |
useGetGeneratedKeys()
|
protected boolean |
useInsertSelectIdentity()
|
String |
whereJoinFragment(String alias,
boolean innerJoin,
boolean includeSubclasses)
Get the where clause part of any joins (optional operation) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.hibernate.persister.entity.OuterJoinLoadable |
---|
fromTableFragment, getPropertyTableName, getSubclassPropertyTableName |
Methods inherited from interface org.hibernate.persister.entity.Queryable |
---|
getConstraintOrderedTableNameClosure, getContraintOrderedTableKeyColumnClosure, getDiscriminatorSQLValue |
Methods inherited from interface org.hibernate.persister.entity.Joinable |
---|
getTableName |
Methods inherited from interface org.hibernate.persister.entity.Loadable |
---|
getDiscriminatorType, getSubclassForDiscriminatorValue |
Methods inherited from interface org.hibernate.persister.entity.EntityPersister |
---|
getPropertySpaces |
Field Detail |
---|
public static final String ENTITY_CLASS
protected final String rowIdName
protected boolean[] insertCallable
protected boolean[] updateCallable
protected boolean[] deleteCallable
protected String[] customSQLInsert
protected String[] customSQLUpdate
protected String[] customSQLDelete
protected ExecuteUpdateResultCheckStyle[] insertResultCheckStyles
protected ExecuteUpdateResultCheckStyle[] updateResultCheckStyles
protected ExecuteUpdateResultCheckStyle[] deleteResultCheckStyles
protected final BasicEntityPropertyMapping propertyMapping
Constructor Detail |
---|
public AbstractEntityPersister(PersistentClass persistentClass, EntityRegionAccessStrategy cacheAccessStrategy, SessionFactoryImplementor factory) throws HibernateException
HibernateException
Method Detail |
---|
protected void addDiscriminatorToInsert(Insert insert)
protected void addDiscriminatorToSelect(SelectFragment select, String name, String suffix)
protected abstract int[] getSubclassColumnTableNumberClosure()
protected abstract int[] getSubclassFormulaTableNumberClosure()
public abstract String getSubclassTableName(int j)
Queryable
getSubclassTableName
in interface Queryable
j
- The index into the internal array.
protected abstract String[] getSubclassTableKeyColumns(int j)
protected abstract boolean isClassOrSuperclassTable(int j)
protected abstract int getSubclassTableSpan()
protected abstract int getTableSpan()
protected abstract boolean isTableCascadeDeleteEnabled(int j)
protected abstract String getTableName(int j)
protected abstract String[] getKeyColumns(int j)
protected abstract boolean isPropertyOfTable(int property, int j)
protected abstract int[] getPropertyTableNumbersInSelect()
protected abstract int[] getPropertyTableNumbers()
protected abstract int getSubclassPropertyTableNumber(int i)
protected abstract String filterFragment(String alias) throws MappingException
MappingException
public String getDiscriminatorColumnName()
getDiscriminatorColumnName
in interface Loadable
public String getDiscriminatorColumnReaders()
public String getDiscriminatorColumnReaderTemplate()
protected String getDiscriminatorAlias()
protected String getDiscriminatorFormulaTemplate()
protected boolean isInverseTable(int j)
protected boolean isNullableTable(int j)
protected boolean isNullableSubclassTable(int j)
protected boolean isInverseSubclassTable(int j)
public boolean isSubclassEntityName(String entityName)
EntityPersister
isSubclassEntityName
in interface EntityPersister
entityName
- The entity name to be checked.
public String[] getRootTableKeyColumnNames()
PostInsertIdentityPersister
getRootTableKeyColumnNames
in interface PostInsertIdentityPersister
protected String[] getSQLUpdateByRowIdStrings()
protected String[] getSQLLazyUpdateByRowIdStrings()
protected String getSQLSnapshotSelectString()
protected String getSQLLazySelectString()
protected String[] getSQLDeleteStrings()
protected String[] getSQLInsertStrings()
protected String[] getSQLUpdateStrings()
protected String[] getSQLLazyUpdateStrings()
protected String getSQLIdentityInsertString()
protected String getVersionSelectString()
protected boolean isInsertCallable(int j)
protected boolean isUpdateCallable(int j)
protected boolean isDeleteCallable(int j)
protected boolean isSubclassPropertyDeferred(String propertyName, String entityName)
protected boolean isSubclassTableSequentialSelect(int j)
public boolean hasSequentialSelect()
protected boolean[] getTableUpdateNeeded(int[] dirtyProperties, boolean hasDirtyCollection)
dirtyProperties
- The indices of all the entity properties considered dirty.hasDirtyCollection
- Whether any collections owned by the entity which were considered dirty.
public boolean hasRowId()
Loadable
hasRowId
in interface Loadable
protected boolean[][] getPropertyColumnUpdateable()
protected boolean[][] getPropertyColumnInsertable()
protected boolean[] getPropertySelectable()
protected String generateLazySelectString()
public Object initializeLazyProperty(String fieldName, Object entity, SessionImplementor session) throws HibernateException
LazyPropertyInitializer
initializeLazyProperty
in interface LazyPropertyInitializer
HibernateException
public boolean isBatchable()
public Serializable[] getQuerySpaces()
EntityPersister
EntityPersister.getPropertySpaces()
, except that here we include subclass
entity spaces.
getQuerySpaces
in interface EntityPersister
protected Set getLazyProperties()
public boolean isBatchLoadable()
EntityPersister
isBatchLoadable
in interface EntityPersister
public String[] getIdentifierColumnNames()
Loadable
getIdentifierColumnNames
in interface PostInsertIdentityPersister
getIdentifierColumnNames
in interface Loadable
getIdentifierColumnNames
in interface Queryable
public String[] getIdentifierColumnReaders()
public String[] getIdentifierColumnReaderTemplates()
protected int getIdentifierColumnSpan()
protected String[] getIdentifierAliases()
public String getVersionColumnName()
Lockable
getVersionColumnName
in interface Lockable
protected String getVersionedTableName()
protected boolean[] getSubclassColumnLazyiness()
protected boolean[] getSubclassFormulaLazyiness()
public boolean isCacheInvalidationRequired()
isCacheInvalidationRequired
in interface EntityPersister
public boolean isLazyPropertiesCacheable()
EntityPersister
isLazyPropertiesCacheable
in interface EntityPersister
public String selectFragment(String alias, String suffix)
OuterJoinLoadable
selectFragment
in interface OuterJoinLoadable
selectFragment
in interface SQLLoadable
public String[] getIdentifierAliases(String suffix)
Loadable
getIdentifierAliases
in interface Loadable
public String[] getPropertyAliases(String suffix, int i)
Loadable
getPropertyAliases
in interface Loadable
public String getDiscriminatorAlias(String suffix)
Loadable
getDiscriminatorAlias
in interface Loadable
public String identifierSelectFragment(String name, String suffix)
Queryable
identifierSelectFragment
in interface Queryable
public String propertySelectFragment(String tableAlias, String suffix, boolean allProperties)
Queryable
propertySelectFragment
in interface Queryable
public SelectFragment propertySelectFragmentFragment(String tableAlias, String suffix, boolean allProperties)
propertySelectFragmentFragment
in interface Queryable
public Object[] getDatabaseSnapshot(Serializable id, SessionImplementor session) throws HibernateException
EntityPersister
getDatabaseSnapshot
in interface EntityPersister
HibernateException
protected String generateSelectVersionString()
public boolean[] getPropertyUniqueness()
protected String generateInsertGeneratedValuesSelectString()
protected String generateUpdateGeneratedValuesSelectString()
protected String concretePropertySelectFragment(String alias, ValueInclusion[] inclusions)
protected String concretePropertySelectFragment(String alias, boolean[] includeProperty)
protected String concretePropertySelectFragment(String alias, AbstractEntityPersister.InclusionChecker inclusionChecker)
protected String generateSnapshotSelectString()
public Object forceVersionIncrement(Serializable id, Object currentVersion, SessionImplementor session)
forceVersionIncrement
in interface EntityPersister
public Object getCurrentVersion(Serializable id, SessionImplementor session) throws HibernateException
getCurrentVersion
in interface EntityPersister
HibernateException
protected void initLockers()
protected LockingStrategy generateLocker(LockMode lockMode)
public void lock(Serializable id, Object version, Object object, LockMode lockMode, SessionImplementor session) throws HibernateException
EntityPersister
lock
in interface EntityPersister
HibernateException
public void lock(Serializable id, Object version, Object object, LockOptions lockOptions, SessionImplementor session) throws HibernateException
EntityPersister
lock
in interface EntityPersister
HibernateException
public String getRootTableName()
Lockable
getRootTableName
in interface Lockable
public String getRootTableAlias(String drivingAlias)
Lockable
getRootTableAlias
in interface Lockable
drivingAlias
- The driving alias; or the alias for the table
mapped by this persister in the hierarchy.
public String[] getRootTableIdentifierColumnNames()
Lockable
getRootTableIdentifierColumnNames
in interface Lockable
public String[] toColumns(String alias, String propertyName) throws QueryException
PropertyMapping
toColumns
in interface PropertyMapping
QueryException
public String[] toColumns(String propertyName) throws QueryException
PropertyMapping
toColumns
in interface PropertyMapping
QueryException
public Type toType(String propertyName) throws QueryException
PropertyMapping
toType
in interface PropertyMapping
QueryException
public String[] getPropertyColumnNames(String propertyName)
OuterJoinLoadable
getPropertyColumnNames
in interface OuterJoinLoadable
public int getSubclassPropertyTableNumber(String propertyPath)
getSubclassPropertyTableNumber
in interface Queryable
propertyPath
- The name of the property.
public Queryable.Declarer getSubclassPropertyDeclarer(String propertyPath)
Queryable
Queryable.getSubclassPropertyTableNumber(java.lang.String)
getSubclassPropertyDeclarer
in interface Queryable
propertyPath
- The property name.
public DiscriminatorMetadata getTypeDiscriminatorMetadata()
Queryable
getTypeDiscriminatorMetadata
in interface Queryable
protected String generateTableAlias(String rootAlias, int tableNumber)
public String[] toColumns(String name, int i)
OuterJoinLoadable
toColumns
in interface OuterJoinLoadable
protected String[] getPropertySubclassNames()
public String[] getPropertyColumnNames(int i)
Loadable
getPropertyColumnNames
in interface Loadable
public String[] getPropertyColumnWriters(int i)
protected int getPropertyColumnSpan(int i)
protected boolean hasFormulaProperties()
public FetchMode getFetchMode(int i)
OuterJoinLoadable
getFetchMode
in interface OuterJoinLoadable
public CascadeStyle getCascadeStyle(int i)
OuterJoinLoadable
getCascadeStyle
in interface OuterJoinLoadable
public Type getSubclassPropertyType(int i)
OuterJoinLoadable
getSubclassPropertyType
in interface OuterJoinLoadable
public String getSubclassPropertyName(int i)
OuterJoinLoadable
getSubclassPropertyName
in interface OuterJoinLoadable
public int countSubclassProperties()
OuterJoinLoadable
countSubclassProperties
in interface OuterJoinLoadable
public String[] getSubclassPropertyColumnNames(int i)
OuterJoinLoadable
getSubclassPropertyColumnNames
in interface OuterJoinLoadable
public boolean isDefinedOnSubclass(int i)
OuterJoinLoadable
isDefinedOnSubclass
in interface OuterJoinLoadable
protected String[][] getSubclassPropertyFormulaTemplateClosure()
protected Type[] getSubclassPropertyTypeClosure()
protected String[][] getSubclassPropertyColumnNameClosure()
public String[][] getSubclassPropertyColumnReaderClosure()
public String[][] getSubclassPropertyColumnReaderTemplateClosure()
protected String[] getSubclassPropertyNameClosure()
protected String[] getSubclassPropertySubclassNameClosure()
protected String[] getSubclassColumnClosure()
protected String[] getSubclassColumnAliasClosure()
public String[] getSubclassColumnReaderTemplateClosure()
protected String[] getSubclassFormulaClosure()
protected String[] getSubclassFormulaTemplateClosure()
protected String[] getSubclassFormulaAliasClosure()
public String[] getSubclassPropertyColumnAliases(String propertyName, String suffix)
SQLLoadable
getSubclassPropertyColumnAliases
in interface SQLLoadable
public String[] getSubclassPropertyColumnNames(String propertyName)
SQLLoadable
getSubclassPropertyColumnNames
in interface SQLLoadable
protected void initSubclassPropertyAliasesMap(PersistentClass model) throws MappingException
MappingException
public Object loadByUniqueKey(String propertyName, Object uniqueKey, SessionImplementor session) throws HibernateException
UniqueKeyLoadable
loadByUniqueKey
in interface UniqueKeyLoadable
HibernateException
public int getPropertyIndex(String propertyName)
UniqueKeyLoadable
getPropertyIndex
in interface UniqueKeyLoadable
protected void createUniqueKeyLoaders() throws MappingException
MappingException
protected String getSQLWhereString(String alias)
protected boolean hasWhere()
protected void initPropertyPaths(Mapping mapping) throws MappingException
MappingException
protected UniqueEntityLoader createEntityLoader(LockMode lockMode, LoadQueryInfluencers loadQueryInfluencers) throws MappingException
MappingException
protected UniqueEntityLoader createEntityLoader(LockOptions lockOptions, LoadQueryInfluencers loadQueryInfluencers) throws MappingException
MappingException
protected UniqueEntityLoader createEntityLoader(LockMode lockMode) throws MappingException
MappingException
protected boolean check(int rows, Serializable id, int tableNumber, Expectation expectation, PreparedStatement statement) throws HibernateException
HibernateException
protected String generateUpdateString(boolean[] includeProperty, int j, boolean useRowId)
protected String generateUpdateString(boolean[] includeProperty, int j, Object[] oldFields, boolean useRowId)
protected String generateInsertString(boolean[] includeProperty, int j)
protected String generateInsertString(boolean identityInsert, boolean[] includeProperty)
protected String generateInsertString(boolean identityInsert, boolean[] includeProperty, int j)
protected String generateIdentityInsertString(boolean[] includeProperty)
includeProperty
- indices of the properties to include in the
insert statement.
protected String generateDeleteString(int j)
protected int dehydrate(Serializable id, Object[] fields, boolean[] includeProperty, boolean[][] includeColumns, int j, PreparedStatement st, SessionImplementor session) throws HibernateException, SQLException
HibernateException
SQLException
protected int dehydrate(Serializable id, Object[] fields, Object rowId, boolean[] includeProperty, boolean[][] includeColumns, int j, PreparedStatement ps, SessionImplementor session, int index) throws SQLException, HibernateException
SQLException
HibernateException
public Object[] hydrate(ResultSet rs, Serializable id, Object object, Loadable rootLoadable, String[][] suffixedPropertyColumns, boolean allProperties, SessionImplementor session) throws SQLException, HibernateException
hydrate
in interface Loadable
SQLException
HibernateException
protected boolean useInsertSelectIdentity()
protected boolean useGetGeneratedKeys()
protected String getSequentialSelect(String entityName)
protected Serializable insert(Object[] fields, boolean[] notNull, String sql, Object object, SessionImplementor session) throws HibernateException
HibernateException
public String getIdentitySelectString()
PostInsertIdentityPersister
getIdentitySelectString
in interface PostInsertIdentityPersister
public String getSelectByUniqueKeyString(String propertyName)
PostInsertIdentityPersister
getSelectByUniqueKeyString
in interface PostInsertIdentityPersister
propertyName
- The name of the property which maps to the
column(s) to use in the select statement restriction.
protected void insert(Serializable id, Object[] fields, boolean[] notNull, int j, String sql, Object object, SessionImplementor session) throws HibernateException
HibernateException
protected void updateOrInsert(Serializable id, Object[] fields, Object[] oldFields, Object rowId, boolean[] includeProperty, int j, Object oldVersion, Object object, String sql, SessionImplementor session) throws HibernateException
HibernateException
protected boolean update(Serializable id, Object[] fields, Object[] oldFields, Object rowId, boolean[] includeProperty, int j, Object oldVersion, Object object, String sql, SessionImplementor session) throws HibernateException
HibernateException
protected void delete(Serializable id, Object version, int j, Object object, String sql, SessionImplementor session, Object[] loadedState) throws HibernateException
HibernateException
public void update(Serializable id, Object[] fields, int[] dirtyFields, boolean hasDirtyCollection, Object[] oldFields, Object oldVersion, Object object, Object rowId, SessionImplementor session) throws HibernateException
update
in interface EntityPersister
HibernateException
public Serializable insert(Object[] fields, Object object, SessionImplementor session) throws HibernateException
EntityPersister
insert
in interface EntityPersister
HibernateException
public void insert(Serializable id, Object[] fields, Object object, SessionImplementor session) throws HibernateException
EntityPersister
insert
in interface EntityPersister
HibernateException
public void delete(Serializable id, Object version, Object object, SessionImplementor session) throws HibernateException
delete
in interface EntityPersister
HibernateException
protected void logStaticSQL()
public String filterFragment(String alias, Map enabledFilters) throws MappingException
Joinable
filterFragment
in interface Joinable
MappingException
public String generateFilterConditionAlias(String rootAlias)
Queryable
generateFilterConditionAlias
in interface Queryable
rootAlias
- The root alias
public String oneToManyFilterFragment(String alias) throws MappingException
oneToManyFilterFragment
in interface Joinable
MappingException
public String fromJoinFragment(String alias, boolean innerJoin, boolean includeSubclasses)
Joinable
fromJoinFragment
in interface Joinable
public String whereJoinFragment(String alias, boolean innerJoin, boolean includeSubclasses)
Joinable
whereJoinFragment
in interface Joinable
protected boolean isSubclassTableLazy(int j)
protected JoinFragment createJoin(String name, boolean innerJoin, boolean includeSubclasses)
protected JoinFragment createJoin(int[] tableNumbers, String drivingAlias)
protected SelectFragment createSelect(int[] subclassColumnNumbers, int[] subclassFormulaNumbers)
protected String createFrom(int tableNumber, String alias)
protected String createWhereByKey(int tableNumber, String alias)
protected String renderSelect(int[] tableNumbers, int[] columnNumbers, int[] formulaNumbers)
protected void postConstruct(Mapping mapping) throws MappingException
MappingException
public void postInstantiate() throws MappingException
EntityPersister
SessionFactory
lifecycle,
after all entity persisters have been instantiated.
postInstantiate
in interface EntityPersister
MappingException
- Indicates an issue in the metadata.protected Map getLoaders()
protected void createLoaders()
protected void createQueryLoader()
public Object load(Serializable id, Object optionalObject, LockMode lockMode, SessionImplementor session)
load
in interface EntityPersister
public Object load(Serializable id, Object optionalObject, LockOptions lockOptions, SessionImplementor session) throws HibernateException
load
in interface EntityPersister
HibernateException
public void registerAffectingFetchProfile(String fetchProfileName)
Loadable
registerAffectingFetchProfile
in interface Loadable
fetchProfileName
- The name of the profile affecting this.public boolean isSubclassPropertyNullable(int i)
OuterJoinLoadable
isSubclassPropertyNullable
in interface OuterJoinLoadable
protected final boolean[] getPropertiesToUpdate(int[] dirtyProperties, boolean hasDirtyCollection)
protected boolean[] getPropertiesToInsert(Object[] fields)
public int[] findDirty(Object[] currentState, Object[] previousState, Object entity, SessionImplementor session) throws HibernateException
findDirty
in interface EntityPersister
currentState
- The current state of the entity (the state to be checked).previousState
- The previous state of the entity (the state to be checked against).entity
- The entity for which we are checking state dirtiness.session
- The session in which the check is ccurring.
HibernateException
public int[] findModified(Object[] old, Object[] current, Object entity, SessionImplementor session) throws HibernateException
findModified
in interface EntityPersister
old
- The old state of the entity.current
- The current state of the entity.entity
- The entity for which we are checking state modification.session
- The session in which the check is ccurring.
HibernateException
protected boolean[] getPropertyUpdateability(Object entity, EntityMode entityMode)
protected EntityTuplizer getTuplizer(SessionImplementor session)
protected EntityTuplizer getTuplizer(EntityMode entityMode)
public SessionFactoryImplementor getFactory()
EntityPersister
getFactory
in interface EntityPersister
public EntityMetamodel getEntityMetamodel()
EntityPersister
getEntityMetamodel
in interface EntityPersister
public boolean hasCache()
EntityPersister
hasCache
in interface EntityPersister
public EntityRegionAccessStrategy getCacheAccessStrategy()
EntityPersister
getCacheAccessStrategy
in interface EntityPersister
public CacheEntryStructure getCacheEntryStructure()
EntityPersister
getCacheEntryStructure
in interface EntityPersister
public Comparator getVersionComparator()
OptimisticCacheSource
OptimisticCacheSource.isVersioned()
returns false.
getVersionComparator
in interface OptimisticCacheSource
public final String getEntityName()
EntityPersister
getEntityName
in interface ClassMetadata
getEntityName
in interface EntityPersister
public EntityType getEntityType()
getEntityType
in interface OuterJoinLoadable
public boolean isPolymorphic()
public boolean isInherited()
EntityPersister
isInherited
in interface ClassMetadata
isInherited
in interface EntityPersister
public boolean hasCascades()
EntityPersister
hasCascades
in interface EntityPersister
public boolean hasIdentifierProperty()
EntityPersister
hasIdentifierProperty
in interface ClassMetadata
hasIdentifierProperty
in interface EntityPersister
public VersionType getVersionType()
EntityPersister
EntityPersister.isVersioned()
, then what is the type of the property
holding the locking value.
getVersionType
in interface EntityPersister
public int getVersionProperty()
EntityPersister
EntityPersister.isVersioned()
, then what is the index of the property
holding the locking value.
getVersionProperty
in interface ClassMetadata
getVersionProperty
in interface EntityPersister
public boolean isVersioned()
EntityPersister
isVersioned
in interface OptimisticCacheSource
isVersioned
in interface ClassMetadata
isVersioned
in interface EntityPersister
public boolean isIdentifierAssignedByInsert()
EntityPersister
isIdentifierAssignedByInsert
in interface EntityPersister
public boolean hasLazyProperties()
EntityPersister
hasLazyProperties
in interface EntityPersister
public void afterReassociate(Object entity, SessionImplementor session)
EntityPersister
afterReassociate
in interface EntityPersister
public Boolean isTransient(Object entity, SessionImplementor session) throws HibernateException
EntityPersister
isTransient
in interface EntityPersister
HibernateException
public boolean hasCollections()
EntityPersister
hasCollections
in interface EntityPersister
public boolean hasMutableProperties()
EntityPersister
hasMutableProperties
in interface EntityPersister
public boolean isMutable()
EntityPersister
isMutable
in interface ClassMetadata
isMutable
in interface EntityPersister
public boolean isAbstract()
Queryable
isAbstract
in interface Loadable
isAbstract
in interface Queryable
public boolean hasSubclasses()
Loadable
hasSubclasses
in interface ClassMetadata
hasSubclasses
in interface Loadable
public boolean hasProxy()
EntityPersister
hasProxy
in interface ClassMetadata
hasProxy
in interface EntityPersister
public IdentifierGenerator getIdentifierGenerator() throws HibernateException
EntityPersister
getIdentifierGenerator
in interface EntityPersister
HibernateException
public String getRootEntityName()
EntityPersister
getRootEntityName
in interface EntityPersister
public ClassMetadata getClassMetadata()
EntityPersister
getClassMetadata
in interface EntityPersister
public String getMappedSuperclass()
Queryable
getMappedSuperclass
in interface Queryable
public boolean isExplicitPolymorphism()
Queryable
isExplicitPolymorphism
in interface Queryable
protected boolean useDynamicUpdate()
protected boolean useDynamicInsert()
protected boolean hasEmbeddedCompositeIdentifier()
public boolean canExtractIdOutOfEntity()
EntityPersister
canExtractIdOutOfEntity
in interface EntityPersister
EntityPersister.hasIdentifierProperty()
or
(2) the identifier is an embedded composite identifier; false otherwise.public String[] getKeyColumnNames()
Joinable
getKeyColumnNames
in interface Joinable
public String getName()
Joinable
getName
in interface Joinable
public boolean isCollection()
Joinable
isCollection
in interface Joinable
public boolean consumesEntityAlias()
Joinable
consumesEntityAlias
in interface Joinable
public boolean consumesCollectionAlias()
Joinable
consumesCollectionAlias
in interface Joinable
public Type getPropertyType(String propertyName) throws MappingException
EntityPersister
getPropertyType
in interface ClassMetadata
getPropertyType
in interface EntityPersister
propertyName
- The name of the property for which to retrieve
the type.
MappingException
- Typically indicates an unknown
property name.public Type getType()
PropertyMapping
getType
in interface PropertyMapping
getType
in interface SQLLoadable
public boolean isSelectBeforeUpdateRequired()
EntityPersister
isSelectBeforeUpdateRequired
in interface EntityPersister
protected final int optimisticLockMode()
public Object createProxy(Serializable id, SessionImplementor session) throws HibernateException
EntityPersister
createProxy
in interface EntityPersister
HibernateException
public String toString()
toString
in class Object
public final String selectFragment(Joinable rhs, String rhsAlias, String lhsAlias, String entitySuffix, String collectionSuffix, boolean includeCollectionColumns)
Joinable
selectFragment
in interface Joinable
public boolean isInstrumented(EntityMode entityMode)
EntityPersister
isInstrumented
in interface EntityPersister
public boolean hasInsertGeneratedProperties()
EntityPersister
hasInsertGeneratedProperties
in interface EntityPersister
public boolean hasUpdateGeneratedProperties()
EntityPersister
hasUpdateGeneratedProperties
in interface EntityPersister
public boolean isVersionPropertyGenerated()
EntityPersister
isVersionPropertyGenerated
in interface EntityPersister
public boolean isVersionPropertyInsertable()
Queryable
isVersionPropertyInsertable
in interface Queryable
public void afterInitialize(Object entity, boolean lazyPropertiesAreUnfetched, SessionImplementor session)
EntityPersister
afterInitialize
in interface EntityPersister
public String[] getPropertyNames()
EntityPersister
getPropertyNames
in interface ClassMetadata
getPropertyNames
in interface EntityPersister
public Type[] getPropertyTypes()
EntityPersister
getPropertyTypes
in interface ClassMetadata
getPropertyTypes
in interface EntityPersister
public boolean[] getPropertyLaziness()
ClassMetadata
getPropertyLaziness
in interface ClassMetadata
getPropertyLaziness
in interface EntityPersister
public boolean[] getPropertyUpdateability()
EntityPersister
getPropertyUpdateability
in interface EntityPersister
public boolean[] getPropertyCheckability()
EntityPersister
getPropertyCheckability
in interface EntityPersister
public boolean[] getNonLazyPropertyUpdateability()
public boolean[] getPropertyInsertability()
EntityPersister
getPropertyInsertability
in interface EntityPersister
public ValueInclusion[] getPropertyInsertGenerationInclusions()
EntityPersister
getPropertyInsertGenerationInclusions
in interface EntityPersister
public ValueInclusion[] getPropertyUpdateGenerationInclusions()
EntityPersister
getPropertyUpdateGenerationInclusions
in interface EntityPersister
public boolean[] getPropertyNullability()
EntityPersister
getPropertyNullability
in interface ClassMetadata
getPropertyNullability
in interface EntityPersister
public boolean[] getPropertyVersionability()
EntityPersister
getPropertyVersionability
in interface EntityPersister
public CascadeStyle[] getPropertyCascadeStyles()
EntityPersister
getPropertyCascadeStyles
in interface EntityPersister
public final Class getMappedClass(EntityMode entityMode)
EntityPersister
getMappedClass
in interface ClassMetadata
getMappedClass
in interface EntityPersister
public boolean implementsLifecycle(EntityMode entityMode)
EntityPersister
implementsLifecycle
in interface ClassMetadata
implementsLifecycle
in interface EntityPersister
public boolean implementsValidatable(EntityMode entityMode)
EntityPersister
implementsValidatable
in interface ClassMetadata
implementsValidatable
in interface EntityPersister
public Class getConcreteProxyClass(EntityMode entityMode)
EntityPersister
getConcreteProxyClass
in interface EntityPersister
public void setPropertyValues(Object object, Object[] values, EntityMode entityMode) throws HibernateException
EntityPersister
setPropertyValues
in interface ClassMetadata
setPropertyValues
in interface EntityPersister
HibernateException
public void setPropertyValue(Object object, int i, Object value, EntityMode entityMode) throws HibernateException
EntityPersister
setPropertyValue
in interface EntityPersister
HibernateException
public Object[] getPropertyValues(Object object, EntityMode entityMode) throws HibernateException
EntityPersister
getPropertyValues
in interface ClassMetadata
getPropertyValues
in interface EntityPersister
object
- The entity from which to extract the property values.entityMode
- The entity-mode of the given entity
HibernateException
public Object getPropertyValue(Object object, int i, EntityMode entityMode) throws HibernateException
EntityPersister
getPropertyValue
in interface EntityPersister
HibernateException
public Object getPropertyValue(Object object, String propertyName, EntityMode entityMode) throws HibernateException
EntityPersister
getPropertyValue
in interface ClassMetadata
getPropertyValue
in interface EntityPersister
HibernateException
public Serializable getIdentifier(Object object, EntityMode entityMode) throws HibernateException
EntityPersister
getIdentifier
in interface ClassMetadata
getIdentifier
in interface EntityPersister
HibernateException
public Serializable getIdentifier(Object entity, SessionImplementor session)
EntityPersister
getIdentifier
in interface ClassMetadata
getIdentifier
in interface EntityPersister
entity
- The entity for which to get the identifiersession
- The session from which the request originated
public void setIdentifier(Object entity, Serializable id, EntityMode entityMode) throws HibernateException
setIdentifier
in interface ClassMetadata
setIdentifier
in interface EntityPersister
entity
- The entity to inject with the identifier value.id
- The value to be injected as the identifier.entityMode
- The entity mode
HibernateException
public void setIdentifier(Object entity, Serializable id, SessionImplementor session)
setIdentifier
in interface ClassMetadata
setIdentifier
in interface EntityPersister
entity
- The entity to inject with the identifier value.id
- The value to be injected as the identifier.session
- The session from which is requests originatespublic Object getVersion(Object object, EntityMode entityMode) throws HibernateException
EntityPersister
getVersion
in interface ClassMetadata
getVersion
in interface EntityPersister
HibernateException
public Object instantiate(Serializable id, EntityMode entityMode) throws HibernateException
instantiate
in interface ClassMetadata
instantiate
in interface EntityPersister
HibernateException
public Object instantiate(Serializable id, SessionImplementor session) throws HibernateException
instantiate
in interface ClassMetadata
instantiate
in interface EntityPersister
id
- The identifier value to use (may be null to represent no value)session
- The session from which the request originated.
HibernateException
public boolean isInstance(Object object, EntityMode entityMode)
EntityPersister
isInstance
in interface EntityPersister
public boolean hasUninitializedLazyProperties(Object object, EntityMode entityMode)
EntityPersister
hasUninitializedLazyProperties
in interface EntityPersister
public void resetIdentifier(Object entity, Serializable currentId, Object currentVersion, EntityMode entityMode)
EntityPersister
resetIdentifier
in interface EntityPersister
entity
- The entity instancecurrentId
- The currently assigned identifier value.currentVersion
- The currently assigned version value.entityMode
- The entity mode represented by the entity instance.public void resetIdentifier(Object entity, Serializable currentId, Object currentVersion, SessionImplementor session)
EntityPersister
resetIdentifier
in interface EntityPersister
entity
- The entity instancecurrentId
- The currently assigned identifier value.currentVersion
- The currently assigned version value.session
- The session from which the request originated.public EntityPersister getSubclassEntityPersister(Object instance, SessionFactoryImplementor factory, EntityMode entityMode)
getSubclassEntityPersister
in interface EntityPersister
instance
- The entity instancefactory
- Reference to the SessionFactoryentityMode
- The entity mode represented by the entity instance.
public EntityMode guessEntityMode(Object object)
EntityPersister
guessEntityMode
in interface EntityPersister
public boolean isMultiTable()
Queryable
isMultiTable
in interface Queryable
public String getTemporaryIdTableName()
Queryable
getTemporaryIdTableName
in interface Queryable
public String getTemporaryIdTableDDL()
Queryable
getTemporaryIdTableDDL
in interface Queryable
protected int getPropertySpan()
public Object[] getPropertyValuesToInsert(Object object, Map mergeMap, SessionImplementor session) throws HibernateException
EntityPersister
getPropertyValuesToInsert
in interface ClassMetadata
getPropertyValuesToInsert
in interface EntityPersister
HibernateException
public void processInsertGeneratedProperties(Serializable id, Object entity, Object[] state, SessionImplementor session)
EntityPersister
PersistenceContext
.
Note, that because we update the PersistenceContext here, callers
need to take care that they have already written the initial snapshot
to the PersistenceContext before calling this method.
processInsertGeneratedProperties
in interface EntityPersister
id
- The entity's id value.entity
- The entity for which to get the state.session
- The sessionpublic void processUpdateGeneratedProperties(Serializable id, Object entity, Object[] state, SessionImplementor session)
EntityPersister
PersistenceContext
.
Note, that because we update the PersistenceContext here, callers
need to take care that they have already written the initial snapshot
to the PersistenceContext before calling this method.
processUpdateGeneratedProperties
in interface EntityPersister
id
- The entity's id value.entity
- The entity for which to get the state.session
- The sessionpublic String getIdentifierPropertyName()
EntityPersister
getIdentifierPropertyName
in interface ClassMetadata
getIdentifierPropertyName
in interface EntityPersister
public Type getIdentifierType()
EntityPersister
getIdentifierType
in interface ClassMetadata
getIdentifierType
in interface EntityPersister
public boolean hasSubselectLoadableCollections()
EntityPersister
hasSubselectLoadableCollections
in interface EntityPersister
public int[] getNaturalIdentifierProperties()
EntityPersister
EntityPersister.hasNaturalIdentifier()
), which
properties make up the natural id.
getNaturalIdentifierProperties
in interface ClassMetadata
getNaturalIdentifierProperties
in interface EntityPersister
public Object[] getNaturalIdentifierSnapshot(Serializable id, SessionImplementor session) throws HibernateException
EntityPersister
getNaturalIdentifierSnapshot
in interface EntityPersister
id
- The identifier of the entity for which to retrieve the natural-id values.session
- The session from which the request originated.
HibernateException
protected String concretePropertySelectFragmentSansLeadingComma(String alias, boolean[] include)
public boolean hasNaturalIdentifier()
EntityPersister
hasNaturalIdentifier
in interface ClassMetadata
hasNaturalIdentifier
in interface EntityPersister
public void setPropertyValue(Object object, String propertyName, Object value, EntityMode entityMode) throws HibernateException
ClassMetadata
setPropertyValue
in interface ClassMetadata
HibernateException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |