public abstract class BaseModelWrapper<T extends BaseModel<T>> extends Object implements BaseModel<T>, ModelWrapper<T>
| Constructor and Description |
|---|
BaseModelWrapper(T model) |
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
Creates a shallow clone of this model instance.
|
int |
compareTo(T o) |
boolean |
equals(Object object) |
ExpandoBridge |
getExpandoBridge()
Returns the expando bridge for this model instance.
|
Class<?> |
getModelClass() |
String |
getModelClassName() |
Serializable |
getPrimaryKeyObj()
Returns the primary key of this model instance.
|
T |
getWrappedModel() |
int |
hashCode() |
boolean |
isCachedModel()
Returns
true if this model instance was retrieved from the
entity cache. |
boolean |
isEntityCacheEnabled()
Returns
true if this model's entity cache is enabled. |
boolean |
isEscapedModel()
Returns
true if this model instance is escaped. |
boolean |
isFinderCacheEnabled()
Returns
true if this model's finder cache is enabled. |
boolean |
isNew()
Returns
true if this model instance does not yet exist in
the database. |
void |
resetOriginalValues()
Reset all original fields to current values.
|
void |
setCachedModel(boolean cachedModel)
Sets whether this model instance was retrieved from the entity cache.
|
void |
setExpandoBridgeAttributes(BaseModel<?> baseModel) |
void |
setExpandoBridgeAttributes(ExpandoBridge expandoBridge) |
void |
setExpandoBridgeAttributes(ServiceContext serviceContext)
Sets the expando bridge attributes for this model instance to the
attributes stored in the service context.
|
void |
setNew(boolean n)
Sets whether this model instance does not yet exist in the database.
|
void |
setPrimaryKeyObj(Serializable primaryKeyObj)
Sets the primary key of this model instance.
|
CacheModel<T> |
toCacheModel()
Returns a cache model object for this entity used by entity cache.
|
T |
toEscapedModel()
Returns a copy of this entity as an escaped model instance by wrapping it
with an
AutoEscapeBeanHandler. |
String |
toString() |
T |
toUnescapedModel() |
String |
toXmlString()
Returns the XML representation of this model instance.
|
protected abstract T |
wrap(T model) |
getModelAttributes, setModelAttributespublic BaseModelWrapper(T model)
public Object clone()
BaseModelpublic int compareTo(T o)
public boolean equals(Object object)
equals in class Objectpublic ExpandoBridge getExpandoBridge()
BaseModelgetExpandoBridge in interface BaseModel<T extends BaseModel<T>>getExpandoBridge in interface ClassedModelpublic Class<?> getModelClass()
getModelClass in interface ClassedModelpublic String getModelClassName()
getModelClassName in interface ClassedModelpublic Serializable getPrimaryKeyObj()
BaseModelgetPrimaryKeyObj in interface BaseModel<T extends BaseModel<T>>getPrimaryKeyObj in interface ClassedModelpublic T getWrappedModel()
getWrappedModel in interface ModelWrapper<T extends BaseModel<T>>public int hashCode()
hashCode in class Objectpublic boolean isCachedModel()
BaseModeltrue if this model instance was retrieved from the
entity cache.isCachedModel in interface BaseModel<T extends BaseModel<T>>true if this model instance was retrieved from the
entity cache; false otherwiseBaseModel.setCachedModel(boolean)public boolean isEntityCacheEnabled()
BaseModeltrue if this model's entity cache is enabled.isEntityCacheEnabled in interface BaseModel<T extends BaseModel<T>>true if this model's entity cache is enabled;
false otherwisepublic boolean isEscapedModel()
BaseModeltrue if this model instance is escaped.isEscapedModel in interface BaseModel<T extends BaseModel<T>>true if this model instance is escaped;
false otherwisepublic boolean isFinderCacheEnabled()
BaseModeltrue if this model's finder cache is enabled.isFinderCacheEnabled in interface BaseModel<T extends BaseModel<T>>true if this model's finder cache is enabled;
false otherwisepublic boolean isNew()
BaseModeltrue if this model instance does not yet exist in
the database.public void resetOriginalValues()
BaseModelresetOriginalValues in interface BaseModel<T extends BaseModel<T>>public void setCachedModel(boolean cachedModel)
BaseModelsetCachedModel in interface BaseModel<T extends BaseModel<T>>cachedModel - whether this model instance was retrieved from the
entity cacheEntityCachepublic void setExpandoBridgeAttributes(BaseModel<?> baseModel)
setExpandoBridgeAttributes in interface BaseModel<T extends BaseModel<T>>public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge)
setExpandoBridgeAttributes in interface BaseModel<T extends BaseModel<T>>public void setExpandoBridgeAttributes(ServiceContext serviceContext)
BaseModelsetExpandoBridgeAttributes in interface BaseModel<T extends BaseModel<T>>serviceContext - the service context to be appliedServiceContext.getExpandoBridgeAttributes()public void setNew(boolean n)
BaseModelpublic void setPrimaryKeyObj(Serializable primaryKeyObj)
BaseModelsetPrimaryKeyObj in interface BaseModel<T extends BaseModel<T>>setPrimaryKeyObj in interface ClassedModelprimaryKeyObj - the primary key of this model instancepublic CacheModel<T> toCacheModel()
BaseModeltoCacheModel in interface BaseModel<T extends BaseModel<T>>public T toEscapedModel()
BaseModelAutoEscapeBeanHandler.toEscapedModel in interface BaseModel<T extends BaseModel<T>>AutoEscapeBeanHandlerpublic String toString()
toString in class Objectpublic T toUnescapedModel()
toUnescapedModel in interface BaseModel<T extends BaseModel<T>>public String toXmlString()
BaseModeltoXmlString in interface BaseModel<T extends BaseModel<T>>