|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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 java.lang.String[] |
customSQLDelete
|
protected java.lang.String[] |
customSQLInsert
|
protected java.lang.String[] |
customSQLUpdate
|
protected boolean[] |
deleteCallable
|
protected ExecuteUpdateResultCheckStyle[] |
deleteResultCheckStyles
|
static java.lang.String |
ENTITY_CLASS
|
protected boolean[] |
insertCallable
|
protected ExecuteUpdateResultCheckStyle[] |
insertResultCheckStyles
|
protected BasicEntityPropertyMapping |
propertyMapping
|
protected java.lang.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.persister.entity.Loadable |
|---|
ROWID_ALIAS |
| Fields inherited from interface org.hibernate.persister.entity.EntityPersister |
|---|
ENTITY_ID |
| 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.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,
java.lang.String name,
java.lang.String suffix)
|
void |
afterInitialize(java.lang.Object entity,
boolean lazyPropertiesAreUnfetched,
SessionImplementor session)
Called just after the entities properties have been initialized |
void |
afterReassociate(java.lang.Object entity,
SessionImplementor session)
Called just after the entity has been reassociated with the session |
boolean |
canExtractIdOutOfEntity()
Determine whether detahced instances of this entity carry their own identifier value. |
protected boolean |
check(int rows,
java.io.Serializable id,
int tableNumber,
Expectation expectation,
java.sql.PreparedStatement statement)
|
protected java.lang.String |
concretePropertySelectFragment(java.lang.String alias,
AbstractEntityPersister.InclusionChecker inclusionChecker)
|
protected java.lang.String |
concretePropertySelectFragment(java.lang.String alias,
boolean[] includeProperty)
|
protected java.lang.String |
concretePropertySelectFragment(java.lang.String alias,
ValueInclusion[] inclusions)
|
protected java.lang.String |
concretePropertySelectFragmentSansLeadingComma(java.lang.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,
java.util.Map enabledFilters)
|
protected java.lang.String |
createFrom(int tableNumber,
java.lang.String alias)
|
protected JoinFragment |
createJoin(int[] tableNumbers,
java.lang.String drivingAlias)
|
protected JoinFragment |
createJoin(java.lang.String name,
boolean innerJoin,
boolean includeSubclasses)
|
java.lang.Object |
createProxy(java.io.Serializable id,
SessionImplementor session)
Create a new proxy instance |
protected void |
createQueryLoader()
|
protected SelectFragment |
createSelect(int[] subclassColumnNumbers,
int[] subclassFormulaNumbers)
|
protected void |
createUniqueKeyLoaders()
|
protected java.lang.String |
createWhereByKey(int tableNumber,
java.lang.String alias)
|
protected int |
dehydrate(java.io.Serializable id,
java.lang.Object[] fields,
boolean[] includeProperty,
boolean[][] includeColumns,
int j,
java.sql.PreparedStatement st,
SessionImplementor session)
|
protected int |
dehydrate(java.io.Serializable id,
java.lang.Object[] fields,
java.lang.Object rowId,
boolean[] includeProperty,
boolean[][] includeColumns,
int j,
java.sql.PreparedStatement ps,
SessionImplementor session,
int index)
Marshall the fields of a persistent instance to a prepared statement |
protected void |
delete(java.io.Serializable id,
java.lang.Object version,
int j,
java.lang.Object object,
java.lang.String sql,
SessionImplementor session,
java.lang.Object[] loadedState)
Perform an SQL DELETE |
void |
delete(java.io.Serializable id,
java.lang.Object version,
java.lang.Object object,
SessionImplementor session)
Delete an object |
protected abstract java.lang.String |
filterFragment(java.lang.String alias)
|
java.lang.String |
filterFragment(java.lang.String alias,
java.util.Map enabledFilters)
Get the where clause filter, given a query alias and considering enabled session filters |
int[] |
findDirty(java.lang.Object[] currentState,
java.lang.Object[] previousState,
java.lang.Object entity,
SessionImplementor session)
Locate the property-indices of all properties considered to be dirty. |
int[] |
findModified(java.lang.Object[] old,
java.lang.Object[] current,
java.lang.Object entity,
SessionImplementor session)
Locate the property-indices of all properties considered to be dirty. |
java.lang.Object |
forceVersionIncrement(java.io.Serializable id,
java.lang.Object currentVersion,
SessionImplementor session)
|
java.lang.String |
fromJoinFragment(java.lang.String alias,
boolean innerJoin,
boolean includeSubclasses)
Get the from clause part of any joins (optional operation) |
protected java.lang.String |
generateDeleteString(int j)
Generate the SQL that deletes a row by id (and version) |
java.lang.String |
generateFilterConditionAlias(java.lang.String rootAlias)
The alias used for any filter conditions (mapped where-fragments or enabled-filters). |
protected java.lang.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 java.lang.String |
generateInsertGeneratedValuesSelectString()
|
protected java.lang.String |
generateInsertString(boolean[] includeProperty,
int j)
|
protected java.lang.String |
generateInsertString(boolean identityInsert,
boolean[] includeProperty)
|
protected java.lang.String |
generateInsertString(boolean identityInsert,
boolean[] includeProperty,
int j)
Generate the SQL that inserts a row |
protected java.lang.String |
generateLazySelectString()
|
protected LockingStrategy |
generateLocker(LockMode lockMode)
|
protected java.lang.String |
generateSelectVersionString()
Generate the SQL that selects the version number by id |
protected java.lang.String |
generateSnapshotSelectString()
|
protected java.lang.String |
generateTableAlias(java.lang.String rootAlias,
int tableNumber)
|
protected java.lang.String |
generateUpdateGeneratedValuesSelectString()
|
protected java.lang.String |
generateUpdateString(boolean[] includeProperty,
int j,
boolean useRowId)
|
protected java.lang.String |
generateUpdateString(boolean[] includeProperty,
int j,
java.lang.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) |
java.lang.Class |
getConcreteProxyClass(EntityMode entityMode)
Get the proxy interface that instances of this concrete class will be cast to (optional operation). |
java.lang.Object |
getCurrentVersion(java.io.Serializable id,
SessionImplementor session)
Retrieve the version number |
java.lang.Object[] |
getDatabaseSnapshot(java.io.Serializable id,
SessionImplementor session)
Get the current database state of the object, in a "hydrated" form, without resolving identifiers |
protected java.lang.String |
getDiscriminatorAlias()
|
java.lang.String |
getDiscriminatorAlias(java.lang.String suffix)
Get the result set aliases used for the identifier columns, given a suffix |
java.lang.String |
getDiscriminatorColumnName()
|
protected java.lang.String |
getDiscriminatorFormulaTemplate()
|
EntityMetamodel |
getEntityMetamodel()
Retrieve the underlying entity metamodel instance... |
java.lang.String |
getEntityName()
The name of the entity |
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? |
java.io.Serializable |
getIdentifier(java.lang.Object object,
EntityMode entityMode)
Get the identifier of an instance (throw an exception if no identifier property) |
protected java.lang.String[] |
getIdentifierAliases()
|
java.lang.String[] |
getIdentifierAliases(java.lang.String suffix)
Get the result set aliases used for the identifier columns, given a suffix |
java.lang.String[] |
getIdentifierColumnNames()
Get the names of columns used to persist the identifier |
protected int |
getIdentifierColumnSpan()
|
IdentifierGenerator |
getIdentifierGenerator()
Determine which identifier generation strategy is used for this entity. |
java.lang.String |
getIdentifierPropertyName()
Get the name of the identifier property (or return null) |
Type |
getIdentifierType()
Get the identifier Hibernate type |
java.lang.String |
getIdentitySelectString()
Get the database-specific SQL command to retrieve the last generated IDENTITY value. |
java.lang.String[] |
getKeyColumnNames()
The columns to join on |
protected abstract java.lang.String[] |
getKeyColumns(int j)
|
protected java.util.Set |
getLazyProperties()
|
java.lang.Class |
getMappedClass(EntityMode entityMode)
The persistent class, or null |
java.lang.String |
getMappedSuperclass()
Get the class that this class is mapped as a subclass of - not necessarily the direct superclass |
java.lang.String |
getName()
An identifying name; a class name or collection role name. |
int[] |
getNaturalIdentifierProperties()
Which properties hold the natural id? |
java.lang.Object[] |
getNaturalIdentifierSnapshot(java.io.Serializable id,
SessionImplementor session)
Retrieve the current state of the natural-id properties from the database. |
boolean[] |
getNonLazyPropertyUpdateability()
|
protected boolean[] |
getPropertiesToInsert(java.lang.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 |
java.lang.String[] |
getPropertyAliases(java.lang.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 propertes (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) |
java.lang.String[] |
getPropertyColumnNames(int i)
Get the result set column names mapped for this property (properties of this class, only). |
java.lang.String[] |
getPropertyColumnNames(java.lang.String propertyName)
Get the column names for the given property path |
protected int |
getPropertyColumnSpan(int i)
|
int |
getPropertyIndex(java.lang.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 |
java.lang.String[] |
getPropertyNames()
Get the names of the class' persistent properties |
boolean[] |
getPropertyNullability()
Get the nullability of the class' persistent properties |
protected int |
getPropertySpan()
|
protected java.lang.String[] |
getPropertySubclassNames()
|
protected abstract int[] |
getPropertyTableNumbers()
|
protected abstract int[] |
getPropertyTableNumbersInSelect()
|
Type |
getPropertyType(java.lang.String propertyName)
Get the type of a particular (named) property |
Type[] |
getPropertyTypes()
Get the Hibernate types of the class properties |
boolean[] |
getPropertyUpdateability()
Get the "updateability" of the properties of this class (does the property appear in an SQL UPDATE) |
protected boolean[] |
getPropertyUpdateability(java.lang.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? |
java.lang.Object |
getPropertyValue(java.lang.Object object,
int i,
EntityMode entityMode)
Get the value of a particular property |
java.lang.Object |
getPropertyValue(java.lang.Object object,
java.lang.String propertyName,
EntityMode entityMode)
Get the value of a particular (named) property |
java.lang.Object[] |
getPropertyValues(java.lang.Object object,
EntityMode entityMode)
Extract the property values from the given entity. |
java.lang.Object[] |
getPropertyValuesToInsert(java.lang.Object object,
java.util.Map mergeMap,
SessionImplementor session)
Return the values of the mapped properties of the object |
boolean[] |
getPropertyVersionability()
Get the "versionability" of the properties of this class (is the property optimistic-locked) |
java.io.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. |
java.lang.String |
getRootEntityName()
Returns an object that identifies the space in which identifiers of this entity hierarchy are unique. |
java.lang.String |
getRootTableAlias(java.lang.String drivingAlias)
Get the SQL alias this persister would use for the root table given the passed driving alias. |
java.lang.String[] |
getRootTableIdentifierColumnNames()
Get the names of columns on the root table used to persist the identifier. |
java.lang.String[] |
getRootTableKeyColumnNames()
The names of the primary key columns in the root table. |
java.lang.String |
getRootTableName()
Locks are always applied to the "root table". |
java.lang.String |
getSelectByUniqueKeyString(java.lang.String propertyName)
Get a SQL select string that performs a select based on a unique key determined by the given property name). |
protected java.lang.String |
getSequentialSelect(java.lang.String entityName)
|
protected java.lang.String[] |
getSQLDeleteStrings()
|
protected java.lang.String |
getSQLIdentityInsertString()
The query that inserts a row, letting the database generate an id |
protected java.lang.String[] |
getSQLInsertStrings()
|
protected java.lang.String |
getSQLLazySelectString()
|
protected java.lang.String[] |
getSQLLazyUpdateByRowIdStrings()
|
protected java.lang.String[] |
getSQLLazyUpdateStrings()
|
protected java.lang.String |
getSQLSnapshotSelectString()
|
protected java.lang.String[] |
getSQLUpdateByRowIdStrings()
|
protected java.lang.String[] |
getSQLUpdateStrings()
|
protected java.lang.String |
getSQLWhereString(java.lang.String alias)
|
protected java.lang.String[] |
getSubclassColumnAliasClosure()
|
protected java.lang.String[] |
getSubclassColumnClosure()
|
protected boolean[] |
getSubclassColumnLazyiness()
|
protected abstract int[] |
getSubclassColumnTableNumberClosure()
|
EntityPersister |
getSubclassEntityPersister(java.lang.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 java.lang.String[] |
getSubclassFormulaAliasClosure()
|
protected java.lang.String[] |
getSubclassFormulaClosure()
|
protected boolean[] |
getSubclassFormulaLazyiness()
|
protected abstract int[] |
getSubclassFormulaTableNumberClosure()
|
protected java.lang.String[] |
getSubclassFormulaTemplateClosure()
|
java.lang.String[] |
getSubclassPropertyColumnAliases(java.lang.String propertyName,
java.lang.String suffix)
Return the column alias names used to persist/query the named property of the class or a subclass (optional operation). |
protected java.lang.String[][] |
getSubclassPropertyColumnNameClosure()
|
java.lang.String[] |
getSubclassPropertyColumnNames(int i)
Return the column names used to persist the numbered property of the class or a subclass. |
java.lang.String[] |
getSubclassPropertyColumnNames(java.lang.String propertyName)
Return the column names used to persist/query the named property of the class or a subclass (optional operation). |
Queryable.Declarer |
getSubclassPropertyDeclarer(java.lang.String propertyPath)
Determine whether the given property is declared by our mapped class, our super class, or one of our subclasses... |
protected java.lang.String[][] |
getSubclassPropertyFormulaTemplateClosure()
|
java.lang.String |
getSubclassPropertyName(int i)
Get the name of the numbered property of the class or a subclass. |
protected java.lang.String[] |
getSubclassPropertyNameClosure()
|
protected java.lang.String[] |
getSubclassPropertySubclassNameClosure()
|
protected abstract int |
getSubclassPropertyTableNumber(int i)
|
int |
getSubclassPropertyTableNumber(java.lang.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 java.lang.String[] |
getSubclassTableKeyColumns(int j)
|
abstract java.lang.String |
getSubclassTableName(int j)
Get the name of the table with the given index from the internal array. |
protected abstract int |
getSubclassTableSpan()
|
protected abstract java.lang.String |
getTableName(int j)
|
protected abstract int |
getTableSpan()
|
protected boolean[] |
getTableUpdateNeeded(int[] dirtyProperties,
boolean hasDirtyCollection)
Decide which tables need to be updated. |
java.lang.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. |
java.lang.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 |
java.lang.Object |
getVersion(java.lang.Object object,
EntityMode entityMode)
Get the version number (or timestamp) from the object's version property (or return null if not versioned) |
java.lang.String |
getVersionColumnName()
For versioned entities, get the name of the column (again, expected on the root table) used to store the version values. |
java.util.Comparator |
getVersionComparator()
Get the comparator used to compare two different version values. |
protected java.lang.String |
getVersionedTableName()
|
int |
getVersionProperty()
Get the index of the version property |
protected java.lang.String |
getVersionSelectString()
|
VersionType |
getVersionType()
If EntityPersister.isVersioned(), then what is the type of the property
holding the locking value. |
EntityMode |
guessEntityMode(java.lang.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()
Does this class have an identifier property? |
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()
Does this entity declare a natural id? |
boolean |
hasProxy()
Does this class support dynamic proxies? |
boolean |
hasRowId()
Does the result set contain rowids? |
boolean |
hasSequentialSelect()
|
boolean |
hasSubclasses()
Does this entity have mapped subclasses? |
boolean |
hasSubselectLoadableCollections()
Determine whether this entity contains references to persistent collections which are fetchable by subselect? |
boolean |
hasUninitializedLazyProperties(java.lang.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()
|
java.lang.Object[] |
hydrate(java.sql.ResultSet rs,
java.io.Serializable id,
java.lang.Object object,
Loadable rootLoadable,
java.lang.String[][] suffixedPropertyColumns,
boolean allProperties,
SessionImplementor session)
Unmarshall the fields of a persistent instance from a result set, without resolving associations or collections. |
java.lang.String |
identifierSelectFragment(java.lang.String name,
java.lang.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? |
java.lang.Object |
initializeLazyProperty(java.lang.String fieldName,
java.lang.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 java.io.Serializable |
insert(java.lang.Object[] fields,
boolean[] notNull,
java.lang.String sql,
java.lang.Object object,
SessionImplementor session)
Perform an SQL INSERT, and then retrieve a generated identifier. |
java.io.Serializable |
insert(java.lang.Object[] fields,
java.lang.Object object,
SessionImplementor session)
Persist an instance, using a natively generated identifier (optional operation) |
protected void |
insert(java.io.Serializable id,
java.lang.Object[] fields,
boolean[] notNull,
int j,
java.lang.String sql,
java.lang.Object object,
SessionImplementor session)
Perform an SQL INSERT. |
void |
insert(java.io.Serializable id,
java.lang.Object[] fields,
java.lang.Object object,
SessionImplementor session)
Persist an instance |
java.lang.Object |
instantiate(java.io.Serializable id,
EntityMode entityMode)
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()
Does this entity extend a mapped superclass? |
protected boolean |
isInsertCallable(int j)
|
boolean |
isInstance(java.lang.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()
Are instances of this class 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(java.lang.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(java.lang.String propertyName,
java.lang.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)
|
java.lang.Boolean |
isTransient(java.lang.Object entity,
SessionImplementor session)
Is this a new transient instance? |
protected boolean |
isUpdateCallable(int j)
|
boolean |
isVersioned()
Is the data to be cached considered versioned? If true, it is illegal for OptimisticCacheSource.getVersionComparator() to return
null. |
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? |
java.lang.Object |
load(java.io.Serializable id,
java.lang.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 |
java.lang.Object |
loadByUniqueKey(java.lang.String propertyName,
java.lang.Object uniqueKey,
SessionImplementor session)
Load an instance of the persistent class, by a unique key other than the primary key. |
void |
lock(java.io.Serializable id,
java.lang.Object version,
java.lang.Object object,
LockMode lockMode,
SessionImplementor session)
Do a version check (optional operation) |
protected void |
logStaticSQL()
|
java.lang.String |
oneToManyFilterFragment(java.lang.String alias)
|
protected int |
optimisticLockMode()
|
protected void |
postConstruct(Mapping mapping)
|
void |
postInstantiate()
Finish the initialization of this object. |
void |
processInsertGeneratedProperties(java.io.Serializable id,
java.lang.Object entity,
java.lang.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(java.io.Serializable id,
java.lang.Object entity,
java.lang.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. |
java.lang.String |
propertySelectFragment(java.lang.String name,
java.lang.String suffix,
boolean allProperties)
Given a query alias and an identifying suffix, render the property select fragment. |
protected java.lang.String |
renderSelect(int[] tableNumbers,
int[] columnNumbers,
int[] formulaNumbers)
|
void |
resetIdentifier(java.lang.Object entity,
java.io.Serializable currentId,
java.lang.Object currentVersion,
EntityMode entityMode)
Set the identifier and version of the given instance back to its "unsaved" value. |
java.lang.String |
selectFragment(Joinable rhs,
java.lang.String rhsAlias,
java.lang.String lhsAlias,
java.lang.String entitySuffix,
java.lang.String collectionSuffix,
boolean includeCollectionColumns)
All columns to select, when loading. |
java.lang.String |
selectFragment(java.lang.String alias,
java.lang.String suffix)
Generate a list of collection index, key and element columns |
void |
setIdentifier(java.lang.Object object,
java.io.Serializable id,
EntityMode entityMode)
Set the identifier of an instance (or do nothing if no identifier property) |
void |
setPropertyValue(java.lang.Object object,
int i,
java.lang.Object value,
EntityMode entityMode)
Set the value of a particular property |
void |
setPropertyValue(java.lang.Object object,
java.lang.String propertyName,
java.lang.Object value,
EntityMode entityMode)
Set the value of a particular (named) property |
void |
setPropertyValues(java.lang.Object object,
java.lang.Object[] values,
EntityMode entityMode)
Set the given values to the mapped properties of the given object |
java.lang.String[] |
toColumns(java.lang.String propertyName)
Given a property path, return the corresponding column name(s). |
java.lang.String[] |
toColumns(java.lang.String name,
int i)
Given the number of a property of a subclass, and a table alias, return the aliased column names. |
java.lang.String[] |
toColumns(java.lang.String alias,
java.lang.String propertyName)
Given a query alias and a property path, return the qualified column name |
java.lang.String |
toString()
|
Type |
toType(java.lang.String propertyName)
Given a component path expression, get the type of the property |
void |
update(java.io.Serializable id,
java.lang.Object[] fields,
int[] dirtyFields,
boolean hasDirtyCollection,
java.lang.Object[] oldFields,
java.lang.Object oldVersion,
java.lang.Object object,
java.lang.Object rowId,
SessionImplementor session)
Update an object |
protected boolean |
update(java.io.Serializable id,
java.lang.Object[] fields,
java.lang.Object[] oldFields,
java.lang.Object rowId,
boolean[] includeProperty,
int j,
java.lang.Object oldVersion,
java.lang.Object object,
java.lang.String sql,
SessionImplementor session)
|
protected void |
updateOrInsert(java.io.Serializable id,
java.lang.Object[] fields,
java.lang.Object[] oldFields,
java.lang.Object rowId,
boolean[] includeProperty,
int j,
java.lang.Object oldVersion,
java.lang.Object object,
java.lang.String sql,
SessionImplementor session)
Perform an SQL UPDATE or SQL INSERT |
protected boolean |
useDynamicInsert()
|
protected boolean |
useDynamicUpdate()
|
protected boolean |
useGetGeneratedKeys()
|
protected boolean |
useInsertSelectIdentity()
|
java.lang.String |
whereJoinFragment(java.lang.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.Loadable |
|---|
getDiscriminatorType, getSubclassForDiscriminatorValue |
| Methods inherited from interface org.hibernate.persister.entity.EntityPersister |
|---|
getPropertySpaces |
| Methods inherited from interface org.hibernate.persister.entity.Joinable |
|---|
getTableName |
| Methods inherited from interface org.hibernate.persister.entity.Queryable |
|---|
getConstraintOrderedTableNameClosure, getContraintOrderedTableKeyColumnClosure, getDiscriminatorSQLValue |
| Methods inherited from interface org.hibernate.persister.entity.Loadable |
|---|
getDiscriminatorType, getSubclassForDiscriminatorValue |
| Methods inherited from interface org.hibernate.persister.entity.EntityPersister |
|---|
getPropertySpaces |
| 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 |
| 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 java.lang.String ENTITY_CLASS
protected final java.lang.String rowIdName
protected boolean[] insertCallable
protected boolean[] updateCallable
protected boolean[] deleteCallable
protected java.lang.String[] customSQLInsert
protected java.lang.String[] customSQLUpdate
protected java.lang.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,
java.lang.String name,
java.lang.String suffix)
protected abstract int[] getSubclassColumnTableNumberClosure()
protected abstract int[] getSubclassFormulaTableNumberClosure()
public abstract java.lang.String getSubclassTableName(int j)
Queryable
getSubclassTableName in interface Queryablej - The index into the internal array.
protected abstract java.lang.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 java.lang.String getTableName(int j)
protected abstract java.lang.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 java.lang.String filterFragment(java.lang.String alias)
throws MappingException
MappingExceptionpublic java.lang.String getDiscriminatorColumnName()
getDiscriminatorColumnName in interface Loadableprotected java.lang.String getDiscriminatorAlias()
protected java.lang.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(java.lang.String entityName)
EntityPersister
isSubclassEntityName in interface EntityPersisterentityName - The entity name to be checked.
public java.lang.String[] getRootTableKeyColumnNames()
PostInsertIdentityPersister
getRootTableKeyColumnNames in interface PostInsertIdentityPersisterprotected java.lang.String[] getSQLUpdateByRowIdStrings()
protected java.lang.String[] getSQLLazyUpdateByRowIdStrings()
protected java.lang.String getSQLSnapshotSelectString()
protected java.lang.String getSQLLazySelectString()
protected java.lang.String[] getSQLDeleteStrings()
protected java.lang.String[] getSQLInsertStrings()
protected java.lang.String[] getSQLUpdateStrings()
protected java.lang.String[] getSQLLazyUpdateStrings()
protected java.lang.String getSQLIdentityInsertString()
protected java.lang.String getVersionSelectString()
protected boolean isInsertCallable(int j)
protected boolean isUpdateCallable(int j)
protected boolean isDeleteCallable(int j)
protected boolean isSubclassPropertyDeferred(java.lang.String propertyName,
java.lang.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 Loadableprotected java.lang.String generateLazySelectString()
public java.lang.Object initializeLazyProperty(java.lang.String fieldName,
java.lang.Object entity,
SessionImplementor session)
throws HibernateException
LazyPropertyInitializer
initializeLazyProperty in interface LazyPropertyInitializerHibernateExceptionpublic boolean isBatchable()
public java.io.Serializable[] getQuerySpaces()
EntityPersisterEntityPersister.getPropertySpaces(), except that here we include subclass
entity spaces.
getQuerySpaces in interface EntityPersisterprotected java.util.Set getLazyProperties()
public boolean isBatchLoadable()
EntityPersister
isBatchLoadable in interface EntityPersisterpublic java.lang.String[] getIdentifierColumnNames()
Loadable
getIdentifierColumnNames in interface LoadablegetIdentifierColumnNames in interface Queryableprotected int getIdentifierColumnSpan()
protected java.lang.String[] getIdentifierAliases()
public java.lang.String getVersionColumnName()
Lockable
getVersionColumnName in interface Lockableprotected java.lang.String getVersionedTableName()
protected boolean[] getSubclassColumnLazyiness()
protected boolean[] getSubclassFormulaLazyiness()
public boolean isCacheInvalidationRequired()
isCacheInvalidationRequired in interface EntityPersisterpublic boolean isLazyPropertiesCacheable()
EntityPersister
isLazyPropertiesCacheable in interface EntityPersister
public java.lang.String selectFragment(java.lang.String alias,
java.lang.String suffix)
OuterJoinLoadable
selectFragment in interface OuterJoinLoadableselectFragment in interface SQLLoadablepublic java.lang.String[] getIdentifierAliases(java.lang.String suffix)
Loadable
getIdentifierAliases in interface Loadable
public java.lang.String[] getPropertyAliases(java.lang.String suffix,
int i)
Loadable
getPropertyAliases in interface Loadablepublic java.lang.String getDiscriminatorAlias(java.lang.String suffix)
Loadable
getDiscriminatorAlias in interface Loadable
public java.lang.String identifierSelectFragment(java.lang.String name,
java.lang.String suffix)
Queryable
identifierSelectFragment in interface Queryable
public java.lang.String propertySelectFragment(java.lang.String name,
java.lang.String suffix,
boolean allProperties)
Queryable
propertySelectFragment in interface Queryable
public java.lang.Object[] getDatabaseSnapshot(java.io.Serializable id,
SessionImplementor session)
throws HibernateException
EntityPersister
getDatabaseSnapshot in interface EntityPersisterHibernateExceptionprotected java.lang.String generateSelectVersionString()
protected java.lang.String generateInsertGeneratedValuesSelectString()
protected java.lang.String generateUpdateGeneratedValuesSelectString()
protected java.lang.String concretePropertySelectFragment(java.lang.String alias,
ValueInclusion[] inclusions)
protected java.lang.String concretePropertySelectFragment(java.lang.String alias,
boolean[] includeProperty)
protected java.lang.String concretePropertySelectFragment(java.lang.String alias,
AbstractEntityPersister.InclusionChecker inclusionChecker)
protected java.lang.String generateSnapshotSelectString()
public java.lang.Object forceVersionIncrement(java.io.Serializable id,
java.lang.Object currentVersion,
SessionImplementor session)
forceVersionIncrement in interface EntityPersister
public java.lang.Object getCurrentVersion(java.io.Serializable id,
SessionImplementor session)
throws HibernateException
getCurrentVersion in interface EntityPersisterHibernateExceptionprotected void initLockers()
protected LockingStrategy generateLocker(LockMode lockMode)
public void lock(java.io.Serializable id,
java.lang.Object version,
java.lang.Object object,
LockMode lockMode,
SessionImplementor session)
throws HibernateException
EntityPersister
lock in interface EntityPersisterHibernateExceptionpublic java.lang.String getRootTableName()
Lockable
getRootTableName in interface Lockablepublic java.lang.String getRootTableAlias(java.lang.String drivingAlias)
Lockable
getRootTableAlias in interface LockabledrivingAlias - The driving alias; or the alias for the table
mapped by this persister in the hierarchy.
public java.lang.String[] getRootTableIdentifierColumnNames()
Lockable
getRootTableIdentifierColumnNames in interface Lockable
public java.lang.String[] toColumns(java.lang.String alias,
java.lang.String propertyName)
throws QueryException
PropertyMapping
toColumns in interface PropertyMappingQueryException
public java.lang.String[] toColumns(java.lang.String propertyName)
throws QueryException
PropertyMapping
toColumns in interface PropertyMappingQueryException
public Type toType(java.lang.String propertyName)
throws QueryException
PropertyMapping
toType in interface PropertyMappingQueryExceptionpublic java.lang.String[] getPropertyColumnNames(java.lang.String propertyName)
OuterJoinLoadable
getPropertyColumnNames in interface OuterJoinLoadablepublic int getSubclassPropertyTableNumber(java.lang.String propertyPath)
getSubclassPropertyTableNumber in interface QueryablepropertyPath - The name of the property.
public Queryable.Declarer getSubclassPropertyDeclarer(java.lang.String propertyPath)
QueryableQueryable.getSubclassPropertyTableNumber(java.lang.String)
getSubclassPropertyDeclarer in interface QueryablepropertyPath - The property name.
protected java.lang.String generateTableAlias(java.lang.String rootAlias,
int tableNumber)
public java.lang.String[] toColumns(java.lang.String name,
int i)
OuterJoinLoadable
toColumns in interface OuterJoinLoadableprotected java.lang.String[] getPropertySubclassNames()
public java.lang.String[] getPropertyColumnNames(int i)
Loadable
getPropertyColumnNames in interface Loadableprotected int getPropertyColumnSpan(int i)
protected boolean hasFormulaProperties()
public FetchMode getFetchMode(int i)
OuterJoinLoadable
getFetchMode in interface OuterJoinLoadablepublic CascadeStyle getCascadeStyle(int i)
OuterJoinLoadable
getCascadeStyle in interface OuterJoinLoadablepublic Type getSubclassPropertyType(int i)
OuterJoinLoadable
getSubclassPropertyType in interface OuterJoinLoadablepublic java.lang.String getSubclassPropertyName(int i)
OuterJoinLoadable
getSubclassPropertyName in interface OuterJoinLoadablepublic int countSubclassProperties()
OuterJoinLoadable
countSubclassProperties in interface OuterJoinLoadablepublic java.lang.String[] getSubclassPropertyColumnNames(int i)
OuterJoinLoadable
getSubclassPropertyColumnNames in interface OuterJoinLoadablepublic boolean isDefinedOnSubclass(int i)
OuterJoinLoadable
isDefinedOnSubclass in interface OuterJoinLoadableprotected java.lang.String[][] getSubclassPropertyFormulaTemplateClosure()
protected Type[] getSubclassPropertyTypeClosure()
protected java.lang.String[][] getSubclassPropertyColumnNameClosure()
protected java.lang.String[] getSubclassPropertyNameClosure()
protected java.lang.String[] getSubclassPropertySubclassNameClosure()
protected java.lang.String[] getSubclassColumnClosure()
protected java.lang.String[] getSubclassColumnAliasClosure()
protected java.lang.String[] getSubclassFormulaClosure()
protected java.lang.String[] getSubclassFormulaTemplateClosure()
protected java.lang.String[] getSubclassFormulaAliasClosure()
public java.lang.String[] getSubclassPropertyColumnAliases(java.lang.String propertyName,
java.lang.String suffix)
SQLLoadable
getSubclassPropertyColumnAliases in interface SQLLoadablepublic java.lang.String[] getSubclassPropertyColumnNames(java.lang.String propertyName)
SQLLoadable
getSubclassPropertyColumnNames in interface SQLLoadable
protected void initSubclassPropertyAliasesMap(PersistentClass model)
throws MappingException
MappingException
public java.lang.Object loadByUniqueKey(java.lang.String propertyName,
java.lang.Object uniqueKey,
SessionImplementor session)
throws HibernateException
UniqueKeyLoadable
loadByUniqueKey in interface UniqueKeyLoadableHibernateExceptionpublic int getPropertyIndex(java.lang.String propertyName)
UniqueKeyLoadable
getPropertyIndex in interface UniqueKeyLoadable
protected void createUniqueKeyLoaders()
throws MappingException
MappingExceptionprotected java.lang.String getSQLWhereString(java.lang.String alias)
protected boolean hasWhere()
protected void initPropertyPaths(Mapping mapping)
throws MappingException
MappingException
protected UniqueEntityLoader createEntityLoader(LockMode lockMode,
java.util.Map enabledFilters)
throws MappingException
MappingException
protected UniqueEntityLoader createEntityLoader(LockMode lockMode)
throws MappingException
MappingException
protected boolean check(int rows,
java.io.Serializable id,
int tableNumber,
Expectation expectation,
java.sql.PreparedStatement statement)
throws HibernateException
HibernateException
protected java.lang.String generateUpdateString(boolean[] includeProperty,
int j,
boolean useRowId)
protected java.lang.String generateUpdateString(boolean[] includeProperty,
int j,
java.lang.Object[] oldFields,
boolean useRowId)
protected java.lang.String generateInsertString(boolean[] includeProperty,
int j)
protected java.lang.String generateInsertString(boolean identityInsert,
boolean[] includeProperty)
protected java.lang.String generateInsertString(boolean identityInsert,
boolean[] includeProperty,
int j)
protected java.lang.String generateIdentityInsertString(boolean[] includeProperty)
includeProperty - indices of the properties to include in the
insert statement.
protected java.lang.String generateDeleteString(int j)
protected int dehydrate(java.io.Serializable id,
java.lang.Object[] fields,
boolean[] includeProperty,
boolean[][] includeColumns,
int j,
java.sql.PreparedStatement st,
SessionImplementor session)
throws HibernateException,
java.sql.SQLException
HibernateException
java.sql.SQLException
protected int dehydrate(java.io.Serializable id,
java.lang.Object[] fields,
java.lang.Object rowId,
boolean[] includeProperty,
boolean[][] includeColumns,
int j,
java.sql.PreparedStatement ps,
SessionImplementor session,
int index)
throws java.sql.SQLException,
HibernateException
java.sql.SQLException
HibernateException
public java.lang.Object[] hydrate(java.sql.ResultSet rs,
java.io.Serializable id,
java.lang.Object object,
Loadable rootLoadable,
java.lang.String[][] suffixedPropertyColumns,
boolean allProperties,
SessionImplementor session)
throws java.sql.SQLException,
HibernateException
hydrate in interface Loadablejava.sql.SQLException
HibernateExceptionprotected boolean useInsertSelectIdentity()
protected boolean useGetGeneratedKeys()
protected java.lang.String getSequentialSelect(java.lang.String entityName)
protected java.io.Serializable insert(java.lang.Object[] fields,
boolean[] notNull,
java.lang.String sql,
java.lang.Object object,
SessionImplementor session)
throws HibernateException
HibernateExceptionpublic java.lang.String getIdentitySelectString()
PostInsertIdentityPersister
getIdentitySelectString in interface PostInsertIdentityPersisterpublic java.lang.String getSelectByUniqueKeyString(java.lang.String propertyName)
PostInsertIdentityPersister
getSelectByUniqueKeyString in interface PostInsertIdentityPersisterpropertyName - The name of the property which maps to the
column(s) to use in the select statement restriction.
protected void insert(java.io.Serializable id,
java.lang.Object[] fields,
boolean[] notNull,
int j,
java.lang.String sql,
java.lang.Object object,
SessionImplementor session)
throws HibernateException
HibernateException
protected void updateOrInsert(java.io.Serializable id,
java.lang.Object[] fields,
java.lang.Object[] oldFields,
java.lang.Object rowId,
boolean[] includeProperty,
int j,
java.lang.Object oldVersion,
java.lang.Object object,
java.lang.String sql,
SessionImplementor session)
throws HibernateException
HibernateException
protected boolean update(java.io.Serializable id,
java.lang.Object[] fields,
java.lang.Object[] oldFields,
java.lang.Object rowId,
boolean[] includeProperty,
int j,
java.lang.Object oldVersion,
java.lang.Object object,
java.lang.String sql,
SessionImplementor session)
throws HibernateException
HibernateException
protected void delete(java.io.Serializable id,
java.lang.Object version,
int j,
java.lang.Object object,
java.lang.String sql,
SessionImplementor session,
java.lang.Object[] loadedState)
throws HibernateException
HibernateException
public void update(java.io.Serializable id,
java.lang.Object[] fields,
int[] dirtyFields,
boolean hasDirtyCollection,
java.lang.Object[] oldFields,
java.lang.Object oldVersion,
java.lang.Object object,
java.lang.Object rowId,
SessionImplementor session)
throws HibernateException
update in interface EntityPersisterHibernateException
public java.io.Serializable insert(java.lang.Object[] fields,
java.lang.Object object,
SessionImplementor session)
throws HibernateException
EntityPersister
insert in interface EntityPersisterHibernateException
public void insert(java.io.Serializable id,
java.lang.Object[] fields,
java.lang.Object object,
SessionImplementor session)
throws HibernateException
EntityPersister
insert in interface EntityPersisterHibernateException
public void delete(java.io.Serializable id,
java.lang.Object version,
java.lang.Object object,
SessionImplementor session)
throws HibernateException
delete in interface EntityPersisterHibernateExceptionprotected void logStaticSQL()
public java.lang.String filterFragment(java.lang.String alias,
java.util.Map enabledFilters)
throws MappingException
Joinable
filterFragment in interface JoinableMappingExceptionpublic java.lang.String generateFilterConditionAlias(java.lang.String rootAlias)
Queryable
generateFilterConditionAlias in interface QueryablerootAlias - The root alias
public java.lang.String oneToManyFilterFragment(java.lang.String alias)
throws MappingException
oneToManyFilterFragment in interface JoinableMappingException
public java.lang.String fromJoinFragment(java.lang.String alias,
boolean innerJoin,
boolean includeSubclasses)
Joinable
fromJoinFragment in interface Joinable
public java.lang.String whereJoinFragment(java.lang.String alias,
boolean innerJoin,
boolean includeSubclasses)
Joinable
whereJoinFragment in interface Joinableprotected boolean isSubclassTableLazy(int j)
protected JoinFragment createJoin(java.lang.String name,
boolean innerJoin,
boolean includeSubclasses)
protected JoinFragment createJoin(int[] tableNumbers,
java.lang.String drivingAlias)
protected SelectFragment createSelect(int[] subclassColumnNumbers,
int[] subclassFormulaNumbers)
protected java.lang.String createFrom(int tableNumber,
java.lang.String alias)
protected java.lang.String createWhereByKey(int tableNumber,
java.lang.String alias)
protected java.lang.String renderSelect(int[] tableNumbers,
int[] columnNumbers,
int[] formulaNumbers)
protected void postConstruct(Mapping mapping)
throws MappingException
MappingException
public void postInstantiate()
throws MappingException
EntityPersisterSessionFactory lifecycle,
after all entity persisters have been instantiated.
postInstantiate in interface EntityPersisterMappingException - Indicates an issue in the metdata.protected void createQueryLoader()
public java.lang.Object load(java.io.Serializable id,
java.lang.Object optionalObject,
LockMode lockMode,
SessionImplementor session)
throws HibernateException
load in interface EntityPersisterHibernateExceptionpublic boolean isSubclassPropertyNullable(int i)
OuterJoinLoadable
isSubclassPropertyNullable in interface OuterJoinLoadable
protected final boolean[] getPropertiesToUpdate(int[] dirtyProperties,
boolean hasDirtyCollection)
protected boolean[] getPropertiesToInsert(java.lang.Object[] fields)
public int[] findDirty(java.lang.Object[] currentState,
java.lang.Object[] previousState,
java.lang.Object entity,
SessionImplementor session)
throws HibernateException
findDirty in interface EntityPersistercurrentState - 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(java.lang.Object[] old,
java.lang.Object[] current,
java.lang.Object entity,
SessionImplementor session)
throws HibernateException
findModified in interface EntityPersisterold - 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(java.lang.Object entity,
EntityMode entityMode)
protected EntityTuplizer getTuplizer(SessionImplementor session)
protected EntityTuplizer getTuplizer(EntityMode entityMode)
public SessionFactoryImplementor getFactory()
EntityPersister
getFactory in interface EntityPersisterpublic EntityMetamodel getEntityMetamodel()
EntityPersister
getEntityMetamodel in interface EntityPersisterpublic boolean hasCache()
EntityPersister
hasCache in interface EntityPersisterpublic EntityRegionAccessStrategy getCacheAccessStrategy()
EntityPersister
getCacheAccessStrategy in interface EntityPersisterpublic CacheEntryStructure getCacheEntryStructure()
EntityPersister
getCacheEntryStructure in interface EntityPersisterpublic java.util.Comparator getVersionComparator()
OptimisticCacheSourceOptimisticCacheSource.isVersioned() returns false.
getVersionComparator in interface OptimisticCacheSourcepublic final java.lang.String getEntityName()
ClassMetadata
getEntityName in interface ClassMetadatagetEntityName in interface EntityPersisterpublic EntityType getEntityType()
getEntityType in interface OuterJoinLoadablepublic boolean isPolymorphic()
public boolean isInherited()
ClassMetadata
isInherited in interface ClassMetadataisInherited in interface EntityPersisterpublic boolean hasCascades()
EntityPersister
hasCascades in interface EntityPersisterpublic boolean hasIdentifierProperty()
ClassMetadata
hasIdentifierProperty in interface ClassMetadatahasIdentifierProperty in interface EntityPersisterpublic VersionType getVersionType()
EntityPersisterEntityPersister.isVersioned(), then what is the type of the property
holding the locking value.
getVersionType in interface EntityPersisterpublic int getVersionProperty()
ClassMetadata
getVersionProperty in interface ClassMetadatagetVersionProperty in interface EntityPersisterpublic boolean isVersioned()
OptimisticCacheSourceOptimisticCacheSource.getVersionComparator() to return
null.
isVersioned in interface OptimisticCacheSourceisVersioned in interface ClassMetadataisVersioned in interface EntityPersisterpublic boolean isIdentifierAssignedByInsert()
EntityPersister
isIdentifierAssignedByInsert in interface EntityPersisterpublic boolean hasLazyProperties()
EntityPersister
hasLazyProperties in interface EntityPersister
public void afterReassociate(java.lang.Object entity,
SessionImplementor session)
EntityPersister
afterReassociate in interface EntityPersister
public java.lang.Boolean isTransient(java.lang.Object entity,
SessionImplementor session)
throws HibernateException
EntityPersister
isTransient in interface EntityPersisterHibernateExceptionpublic boolean hasCollections()
EntityPersister
hasCollections in interface EntityPersisterpublic boolean hasMutableProperties()
EntityPersister
hasMutableProperties in interface EntityPersisterpublic boolean isMutable()
ClassMetadata
isMutable in interface ClassMetadataisMutable in interface EntityPersisterpublic boolean isAbstract()
Queryable
isAbstract in interface LoadableisAbstract in interface Queryablepublic boolean hasSubclasses()
ClassMetadata
hasSubclasses in interface ClassMetadatahasSubclasses in interface Loadablepublic boolean hasProxy()
ClassMetadata
hasProxy in interface ClassMetadatahasProxy in interface EntityPersister
public IdentifierGenerator getIdentifierGenerator()
throws HibernateException
EntityPersister
getIdentifierGenerator in interface EntityPersisterHibernateExceptionpublic java.lang.String getRootEntityName()
EntityPersister
getRootEntityName in interface EntityPersisterpublic ClassMetadata getClassMetadata()
EntityPersister
getClassMetadata in interface EntityPersisterpublic java.lang.String getMappedSuperclass()
Queryable
getMappedSuperclass in interface Queryablepublic boolean isExplicitPolymorphism()
Queryable
isExplicitPolymorphism in interface Queryableprotected boolean useDynamicUpdate()
protected boolean useDynamicInsert()
protected boolean hasEmbeddedCompositeIdentifier()
public boolean canExtractIdOutOfEntity()
EntityPersister
canExtractIdOutOfEntity in interface EntityPersisterEntityPersister.hasIdentifierProperty() or
(2) the identifier is an embedded composite identifier; false otherwise.public java.lang.String[] getKeyColumnNames()
Joinable
getKeyColumnNames in interface Joinablepublic java.lang.String getName()
Joinable
getName in interface Joinablepublic boolean isCollection()
Joinable
isCollection in interface Joinablepublic boolean consumesEntityAlias()
Joinable
consumesEntityAlias in interface Joinablepublic boolean consumesCollectionAlias()
Joinable
consumesCollectionAlias in interface Joinable
public Type getPropertyType(java.lang.String propertyName)
throws MappingException
ClassMetadata
getPropertyType in interface ClassMetadatagetPropertyType in interface EntityPersisterpropertyName - The name of the property for which to retrieve
the typpe.
MappingException - Typically indicates an unknown
property name.public Type getType()
PropertyMapping
getType in interface PropertyMappinggetType in interface SQLLoadablepublic boolean isSelectBeforeUpdateRequired()
EntityPersister
isSelectBeforeUpdateRequired in interface EntityPersisterprotected final int optimisticLockMode()
public java.lang.Object createProxy(java.io.Serializable id,
SessionImplementor session)
throws HibernateException
EntityPersister
createProxy in interface EntityPersisterHibernateExceptionpublic java.lang.String toString()
toString in class java.lang.Object
public final java.lang.String selectFragment(Joinable rhs,
java.lang.String rhsAlias,
java.lang.String lhsAlias,
java.lang.String entitySuffix,
java.lang.String collectionSuffix,
boolean includeCollectionColumns)
Joinable
selectFragment in interface Joinablepublic boolean isInstrumented(EntityMode entityMode)
EntityPersister
isInstrumented in interface EntityPersisterpublic boolean hasInsertGeneratedProperties()
EntityPersister
hasInsertGeneratedProperties in interface EntityPersisterpublic boolean hasUpdateGeneratedProperties()
EntityPersister
hasUpdateGeneratedProperties in interface EntityPersisterpublic boolean isVersionPropertyGenerated()
EntityPersister
isVersionPropertyGenerated in interface EntityPersisterpublic boolean isVersionPropertyInsertable()
Queryable
isVersionPropertyInsertable in interface Queryable
public void afterInitialize(java.lang.Object entity,
boolean lazyPropertiesAreUnfetched,
SessionImplementor session)
EntityPersister
afterInitialize in interface EntityPersisterpublic java.lang.String[] getPropertyNames()
ClassMetadata
getPropertyNames in interface ClassMetadatagetPropertyNames in interface EntityPersisterpublic Type[] getPropertyTypes()
ClassMetadata
getPropertyTypes in interface ClassMetadatagetPropertyTypes in interface EntityPersisterpublic boolean[] getPropertyLaziness()
ClassMetadata
getPropertyLaziness in interface ClassMetadatagetPropertyLaziness in interface EntityPersisterpublic boolean[] getPropertyUpdateability()
EntityPersister
getPropertyUpdateability in interface EntityPersisterpublic boolean[] getPropertyCheckability()
EntityPersister
getPropertyCheckability in interface EntityPersisterpublic boolean[] getNonLazyPropertyUpdateability()
public boolean[] getPropertyInsertability()
EntityPersister
getPropertyInsertability in interface EntityPersisterpublic ValueInclusion[] getPropertyInsertGenerationInclusions()
EntityPersister
getPropertyInsertGenerationInclusions in interface EntityPersisterpublic ValueInclusion[] getPropertyUpdateGenerationInclusions()
EntityPersister
getPropertyUpdateGenerationInclusions in interface EntityPersisterpublic boolean[] getPropertyNullability()
ClassMetadata
getPropertyNullability in interface ClassMetadatagetPropertyNullability in interface EntityPersisterpublic boolean[] getPropertyVersionability()
EntityPersister
getPropertyVersionability in interface EntityPersisterpublic CascadeStyle[] getPropertyCascadeStyles()
EntityPersister
getPropertyCascadeStyles in interface EntityPersisterpublic final java.lang.Class getMappedClass(EntityMode entityMode)
ClassMetadata
getMappedClass in interface ClassMetadatagetMappedClass in interface EntityPersisterpublic boolean implementsLifecycle(EntityMode entityMode)
ClassMetadata
implementsLifecycle in interface ClassMetadataimplementsLifecycle in interface EntityPersisterpublic boolean implementsValidatable(EntityMode entityMode)
ClassMetadata
implementsValidatable in interface ClassMetadataimplementsValidatable in interface EntityPersisterpublic java.lang.Class getConcreteProxyClass(EntityMode entityMode)
EntityPersister
getConcreteProxyClass in interface EntityPersister
public void setPropertyValues(java.lang.Object object,
java.lang.Object[] values,
EntityMode entityMode)
throws HibernateException
ClassMetadata
setPropertyValues in interface ClassMetadatasetPropertyValues in interface EntityPersisterHibernateException
public void setPropertyValue(java.lang.Object object,
int i,
java.lang.Object value,
EntityMode entityMode)
throws HibernateException
EntityPersister
setPropertyValue in interface EntityPersisterHibernateException
public java.lang.Object[] getPropertyValues(java.lang.Object object,
EntityMode entityMode)
throws HibernateException
ClassMetadata
getPropertyValues in interface ClassMetadatagetPropertyValues in interface EntityPersisterobject - The entity from which to extract the property values.entityMode - The entity-mode of the given entity
HibernateException
public java.lang.Object getPropertyValue(java.lang.Object object,
int i,
EntityMode entityMode)
throws HibernateException
EntityPersister
getPropertyValue in interface EntityPersisterHibernateException
public java.lang.Object getPropertyValue(java.lang.Object object,
java.lang.String propertyName,
EntityMode entityMode)
throws HibernateException
ClassMetadata
getPropertyValue in interface ClassMetadatagetPropertyValue in interface EntityPersisterHibernateException
public java.io.Serializable getIdentifier(java.lang.Object object,
EntityMode entityMode)
throws HibernateException
ClassMetadata
getIdentifier in interface ClassMetadatagetIdentifier in interface EntityPersisterHibernateException
public void setIdentifier(java.lang.Object object,
java.io.Serializable id,
EntityMode entityMode)
throws HibernateException
ClassMetadata
setIdentifier in interface ClassMetadatasetIdentifier in interface EntityPersisterHibernateException
public java.lang.Object getVersion(java.lang.Object object,
EntityMode entityMode)
throws HibernateException
ClassMetadata
getVersion in interface ClassMetadatagetVersion in interface EntityPersisterHibernateException
public java.lang.Object instantiate(java.io.Serializable id,
EntityMode entityMode)
throws HibernateException
ClassMetadata
instantiate in interface ClassMetadatainstantiate in interface EntityPersisterHibernateException
public boolean isInstance(java.lang.Object object,
EntityMode entityMode)
EntityPersister
isInstance in interface EntityPersister
public boolean hasUninitializedLazyProperties(java.lang.Object object,
EntityMode entityMode)
EntityPersister
hasUninitializedLazyProperties in interface EntityPersister
public void resetIdentifier(java.lang.Object entity,
java.io.Serializable currentId,
java.lang.Object currentVersion,
EntityMode entityMode)
EntityPersister
resetIdentifier in interface EntityPersisterentity - The entity instancecurrentId - The currently assigned identifier value.currentVersion - The currently assigned version value.entityMode - The entity mode represented by the entity instance.
public EntityPersister getSubclassEntityPersister(java.lang.Object instance,
SessionFactoryImplementor factory,
EntityMode entityMode)
EntityPersister
getSubclassEntityPersister in interface EntityPersisterinstance - The entity instancefactory - Reference to the SessionFactoryentityMode - The entity mode represented by the entity instance.
public EntityMode guessEntityMode(java.lang.Object object)
EntityPersister
guessEntityMode in interface EntityPersisterpublic boolean isMultiTable()
Queryable
isMultiTable in interface Queryablepublic java.lang.String getTemporaryIdTableName()
Queryable
getTemporaryIdTableName in interface Queryablepublic java.lang.String getTemporaryIdTableDDL()
Queryable
getTemporaryIdTableDDL in interface Queryableprotected int getPropertySpan()
public java.lang.Object[] getPropertyValuesToInsert(java.lang.Object object,
java.util.Map mergeMap,
SessionImplementor session)
throws HibernateException
ClassMetadata
getPropertyValuesToInsert in interface ClassMetadatagetPropertyValuesToInsert in interface EntityPersisterHibernateException
public void processInsertGeneratedProperties(java.io.Serializable id,
java.lang.Object entity,
java.lang.Object[] state,
SessionImplementor session)
EntityPersisterPersistenceContext.
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 EntityPersisterid - The entity's id value.entity - The entity for which to get the state.session - The session
public void processUpdateGeneratedProperties(java.io.Serializable id,
java.lang.Object entity,
java.lang.Object[] state,
SessionImplementor session)
EntityPersisterPersistenceContext.
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 EntityPersisterid - The entity's id value.entity - The entity for which to get the state.session - The sessionpublic java.lang.String getIdentifierPropertyName()
ClassMetadata
getIdentifierPropertyName in interface ClassMetadatagetIdentifierPropertyName in interface EntityPersisterpublic Type getIdentifierType()
ClassMetadata
getIdentifierType in interface ClassMetadatagetIdentifierType in interface EntityPersisterpublic boolean hasSubselectLoadableCollections()
EntityPersister
hasSubselectLoadableCollections in interface EntityPersisterpublic int[] getNaturalIdentifierProperties()
ClassMetadata
getNaturalIdentifierProperties in interface ClassMetadatagetNaturalIdentifierProperties in interface EntityPersister
public java.lang.Object[] getNaturalIdentifierSnapshot(java.io.Serializable id,
SessionImplementor session)
throws HibernateException
EntityPersister
getNaturalIdentifierSnapshot in interface EntityPersisterid - The identifier of the entity for which to retrieve the naturak-id values.session - The session from which the request originated.
HibernateException
protected java.lang.String concretePropertySelectFragmentSansLeadingComma(java.lang.String alias,
boolean[] include)
public boolean hasNaturalIdentifier()
ClassMetadata
hasNaturalIdentifier in interface ClassMetadatahasNaturalIdentifier in interface EntityPersister
public void setPropertyValue(java.lang.Object object,
java.lang.String propertyName,
java.lang.Object value,
EntityMode entityMode)
throws HibernateException
ClassMetadata
setPropertyValue in interface ClassMetadataHibernateException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||