|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface PersistenceContext.NaturalIdHelper
Provides centralized access to natural-id-related functionality.
Field Summary | |
---|---|
static Serializable |
INVALID_NATURAL_ID_REFERENCE
|
Method Summary | |
---|---|
void |
cacheNaturalIdCrossReferenceFromLoad(EntityPersister persister,
Serializable id,
Object[] naturalIdValues)
Performs processing related to creating natural-id cross-reference entries on load. |
void |
cleanupFromSynchronizations()
The clean up process of handleSynchronization(org.hibernate.persister.entity.EntityPersister, java.io.Serializable, java.lang.Object) . |
Object[] |
extractNaturalIdValues(Object[] state,
EntityPersister persister)
Given an array of "full entity state", extract the portions that represent the natural id |
Object[] |
extractNaturalIdValues(Object entity,
EntityPersister persister)
Given an entity instance, extract the values that represent the natural id |
Object[] |
findCachedNaturalId(EntityPersister persister,
Serializable pk)
Given a persister and primary key, find the corresponding cross-referenced natural id values. |
Serializable |
findCachedNaturalIdResolution(EntityPersister persister,
Object[] naturalIdValues)
Given a persister and natural-id values, find the corresponding cross-referenced primary key. |
Collection<Serializable> |
getCachedPkResolutions(EntityPersister persister)
Find all the locally cached primary key cross-reference entries for the given persister. |
void |
handleSynchronization(EntityPersister persister,
Serializable pk,
Object entity)
Part of the "load synchronization process". |
void |
manageLocalNaturalIdCrossReference(EntityPersister persister,
Serializable id,
Object[] state,
Object[] previousState,
CachedNaturalIdValueSource source)
Creates necessary local cross-reference entries. |
void |
manageSharedNaturalIdCrossReference(EntityPersister persister,
Serializable id,
Object[] state,
Object[] previousState,
CachedNaturalIdValueSource source)
Creates necessary shared (second level cache) cross-reference entries. |
Object[] |
removeLocalNaturalIdCrossReference(EntityPersister persister,
Serializable id,
Object[] state)
Cleans up local cross-reference entries. |
void |
removeSharedNaturalIdCrossReference(EntityPersister persister,
Serializable id,
Object[] naturalIdValues)
Cleans up local cross-reference entries. |
Field Detail |
---|
static final Serializable INVALID_NATURAL_ID_REFERENCE
Method Detail |
---|
Object[] extractNaturalIdValues(Object[] state, EntityPersister persister)
state
- The attribute state arraypersister
- The persister representing the entity type.
Object[] extractNaturalIdValues(Object entity, EntityPersister persister)
entity
- The entity instancepersister
- The persister representing the entity type.
void cacheNaturalIdCrossReferenceFromLoad(EntityPersister persister, Serializable id, Object[] naturalIdValues)
persister
- The persister representing the entity type.id
- The primary key valuenaturalIdValues
- The natural id valuesvoid manageLocalNaturalIdCrossReference(EntityPersister persister, Serializable id, Object[] state, Object[] previousState, CachedNaturalIdValueSource source)
persister
- The persister representing the entity type.id
- The primary key valuestate
- Generally the "full entity state array", though could also be the natural id values arraypreviousState
- Generally the "full entity state array", though could also be the natural id values array.
Specifically represents the previous values on update, and so is only used with CachedNaturalIdValueSource.UPDATE
source
- Enumeration representing how these values are coming into cache.Object[] removeLocalNaturalIdCrossReference(EntityPersister persister, Serializable id, Object[] state)
persister
- The persister representing the entity type.id
- The primary key valuestate
- Generally the "full entity state array", though could also be the natural id values array
void manageSharedNaturalIdCrossReference(EntityPersister persister, Serializable id, Object[] state, Object[] previousState, CachedNaturalIdValueSource source)
persister
- The persister representing the entity type.id
- The primary key valuestate
- Generally the "full entity state array", though could also be the natural id values arraypreviousState
- Generally the "full entity state array", though could also be the natural id values array.
Specifically represents the previous values on update, and so is only used with CachedNaturalIdValueSource.UPDATE
source
- Enumeration representing how these values are coming into cache.void removeSharedNaturalIdCrossReference(EntityPersister persister, Serializable id, Object[] naturalIdValues)
persister
- The persister representing the entity type.id
- The primary key valuenaturalIdValues
- The natural id values arrayObject[] findCachedNaturalId(EntityPersister persister, Serializable pk)
persister
- The persister representing the entity type.pk
- The primary key value
null
Serializable findCachedNaturalIdResolution(EntityPersister persister, Object[] naturalIdValues)
INVALID_NATURAL_ID_REFERENCE
if the given natural ids are known to
be invalid.
persister
- The persister representing the entity type.naturalIdValues
- The natural id value(s)
INVALID_NATURAL_ID_REFERENCE
,
or null
.Collection<Serializable> getCachedPkResolutions(EntityPersister persister)
persister
- The persister representing the entity type.
void handleSynchronization(EntityPersister persister, Serializable pk, Object entity)
cleanupFromSynchronizations()
is
the inverse process called after flush to clean up those entries.
persister
- The persister representing the entity type.pk
- The primary keyentity
- The entity instancecleanupFromSynchronizations()
void cleanupFromSynchronizations()
handleSynchronization(org.hibernate.persister.entity.EntityPersister, java.io.Serializable, java.lang.Object)
. Responsible for cleaning up the tracking
of old values as no longer valid.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |