public abstract class ExternalRecordEntityAdapter extends RecordEntityAdapter
ExternalRecordEntity
based adapters.Constructor and Description |
---|
ExternalRecordEntityAdapter(java.lang.Object entity,
ExternalValue externalValue,
RecordType type,
ModelInstance modelInstance,
ModelProvider modelProvider)
Creates new instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addToNonSharedAssociationCache(RecordProperty property,
java.lang.Object runtimeValue)
Adds value to internal values association cache.
|
protected boolean |
canRemoveThisFromReverseAssociation(RecordHolder removed,
RecordAssociation reverseAssociation)
Returns true if this entity/holder can be removed from reverse association.
|
protected boolean |
canSetProperty(java.lang.String name)
Returns true if a property can be updated.
|
void |
cleanAndRenewVersion() |
protected abstract void |
clearEntity()
Clears reference to the entity.
|
protected abstract java.lang.Object |
convertToRuntime(RecordProperty property,
java.lang.Object rawValue)
Converts raw value to runtime value.
|
protected java.lang.String |
createEntityIdentificationString(java.lang.Object entity)
Creates entity identification string.
|
protected java.lang.Object |
createEntityJavaIdentification()
Creates java identification object.
|
void |
fireNewEntityChange()
Fire change for created entity.
|
protected void |
firePropertyChange(java.lang.String name,
java.lang.Object value)
Fire property change event.
|
protected java.lang.Long |
getAuditRevisionId()
Returns audit revision id
|
java.lang.Object |
getEntity()
Returns the adapted entity.
|
java.lang.String |
getEntityIdentificationString()
Returns the unique string for this record (primary key and if needed version)
private String entityIdentificationString;
|
protected java.lang.Object |
getEntityInternal()
Returns entity.
|
java.lang.Object |
getEntityNotNull()
This method should be called instead of
getEntity() when entity
is expected to be not null. |
ExternalRecordType |
getExternalRecordType()
Returns external record type.
|
ExternalValue |
getExternalValue()
finds an existing external value for entity hold by this adapter.
|
protected java.lang.reflect.Field |
getField(java.lang.Class<?> cls,
java.lang.String name)
returns field from class or super-classes.
|
protected abstract java.lang.Object |
getFromEntity(java.lang.Object entity,
RecordProperty property) |
protected java.lang.Object |
getFromEntity(RecordProperty property)
Returns value of property from entity.
|
ExternalRecordHolder |
getHolder()
Returns holder for the underlying entity.
|
java.lang.Object |
getJavaIdentification()
Returns the unique object for this record (primary key).
|
protected ModelInstance |
getModelInstance()
Returns model instance.
|
protected ModelProvider |
getModelProvider()
Returns model provider
|
java.lang.Object |
getProperty(RecordProperty property)
Returns value of the property.
|
protected java.lang.Object |
getPropertyInternal(RecordProperty property)
Gets property internal.
|
protected abstract java.lang.Object |
getRawFromEntity(java.lang.Object entity,
RecordProperty property)
Returns unmodified value from entity.
|
protected java.lang.Object |
getRawFromEntity(RecordProperty property) |
RecordType |
getType()
Returns record type.
|
java.lang.Long |
getVersion()
Returns string representation of the entity version, used for multi-transactional optimistic locking.
|
protected void |
initEntityIdentificationString() |
protected boolean |
isExternalValueCreated()
Returns true if external value is created.
|
protected abstract boolean |
isInitialized(java.lang.Object object) |
boolean |
needsToBeReloaded()
Returns true if entity needs to be reloaded from database.
|
protected void |
postSetAssociation(RecordAssociation assoc,
java.lang.Object value)
Executes after association is set.
|
protected abstract void |
refresh() |
protected abstract void |
reloadIfNeeded()
Reloads entity.
|
protected abstract void |
removeEntity(java.lang.Object entity)
Removes entity.
|
protected abstract void |
removeFromAllAssociations(java.util.Set<ExternalRecordAssociation> ignoreAssociations)
Removes this entity from all association.
|
void |
removeThis()
Removes the adapted entity.
|
protected void |
setEntityInternal(java.lang.Object entity)
Sets entity.
|
protected void |
setPropertyInternal(RecordProperty property,
java.lang.Object value,
boolean ignoreCompositions)
Sets property.
|
void |
updateVersion()
Updates version string.
|
getConverter, getEvaluationConverter, getHolderFactory, getHolderInternal, getJavaObject, remove, removeAddedFromOldParents, removeNullObjects, setAssociation, setField, setHolderInternal, setProperty, setThisSideOfAssociation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isUpdateNecessary
public ExternalRecordEntityAdapter(java.lang.Object entity, ExternalValue externalValue, RecordType type, ModelInstance modelInstance, ModelProvider modelProvider)
entity
- externalValue
- type
- modelInstance
- modelProvider
- protected ModelInstance getModelInstance()
RecordEntityAdapter
getModelInstance
in class RecordEntityAdapter
protected ModelProvider getModelProvider()
RecordEntityAdapter
getModelProvider
in class RecordEntityAdapter
public RecordType getType()
RecordEntityAdapter
getType
in class RecordEntityAdapter
protected void initEntityIdentificationString()
protected java.lang.Object getEntityInternal()
protected void setEntityInternal(java.lang.Object entity)
entity
- public boolean needsToBeReloaded()
public java.lang.Object getEntity()
public java.lang.Object getEntityNotNull()
getEntity()
when entity
is expected to be not null.protected abstract void reloadIfNeeded()
public ExternalRecordType getExternalRecordType()
protected boolean isExternalValueCreated()
public ExternalRecordHolder getHolder()
getHolder
in class RecordEntityAdapter
public ExternalValue getExternalValue()
protected java.lang.Long getAuditRevisionId()
public java.lang.String getEntityIdentificationString()
protected java.lang.String createEntityIdentificationString(java.lang.Object entity)
entity
- public java.lang.Object getJavaIdentification()
protected java.lang.Object createEntityJavaIdentification()
public void updateVersion()
public java.lang.Long getVersion()
public java.lang.Object getProperty(RecordProperty property)
getProperty
in class RecordEntityAdapter
property
- protected java.lang.Object getPropertyInternal(RecordProperty property)
property
- protected void setPropertyInternal(RecordProperty property, java.lang.Object value, boolean ignoreCompositions)
RecordEntityAdapter
setPropertyInternal
in class RecordEntityAdapter
protected abstract java.lang.Object getRawFromEntity(java.lang.Object entity, RecordProperty property)
entity
- property
- protected java.lang.Object getRawFromEntity(RecordProperty property)
protected abstract java.lang.Object getFromEntity(java.lang.Object entity, RecordProperty property)
protected java.lang.Object getFromEntity(RecordProperty property)
property
- protected abstract java.lang.Object convertToRuntime(RecordProperty property, java.lang.Object rawValue)
property
- rawValue
- protected void addToNonSharedAssociationCache(RecordProperty property, java.lang.Object runtimeValue)
property
- runtimeValue
- protected boolean canSetProperty(java.lang.String name)
RecordEntityAdapter
canSetProperty
in class RecordEntityAdapter
protected void firePropertyChange(java.lang.String name, java.lang.Object value)
RecordEntityAdapter
firePropertyChange
in class RecordEntityAdapter
public void fireNewEntityChange()
protected boolean canRemoveThisFromReverseAssociation(RecordHolder removed, RecordAssociation reverseAssociation)
RecordEntityAdapter
canRemoveThisFromReverseAssociation
in class RecordEntityAdapter
protected void postSetAssociation(RecordAssociation assoc, java.lang.Object value)
RecordEntityAdapter
postSetAssociation
in class RecordEntityAdapter
public void removeThis()
removeThis
in class RecordEntityAdapter
protected abstract boolean isInitialized(java.lang.Object object)
protected abstract void removeFromAllAssociations(java.util.Set<ExternalRecordAssociation> ignoreAssociations)
ignoreAssociations
- protected abstract void removeEntity(java.lang.Object entity)
entity
- protected abstract void clearEntity()
protected java.lang.reflect.Field getField(java.lang.Class<?> cls, java.lang.String name) throws java.lang.SecurityException, java.lang.NoSuchFieldException
cls
- name
- java.lang.SecurityException
java.lang.NoSuchFieldException
protected abstract void refresh()
public void cleanAndRenewVersion()
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.