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) |
getAttributeGetterFunctions, getAttributeSetterBiConsumers, getModelAttributes, setModelAttributes
public BaseModelWrapper(T model)
public Object clone()
BaseModel
public int compareTo(T o)
public boolean equals(Object object)
equals
in class Object
public ExpandoBridge getExpandoBridge()
BaseModel
getExpandoBridge
in interface BaseModel<T extends BaseModel<T>>
getExpandoBridge
in interface ClassedModel
public Class<?> getModelClass()
getModelClass
in interface ClassedModel
public String getModelClassName()
getModelClassName
in interface ClassedModel
public Serializable getPrimaryKeyObj()
BaseModel
getPrimaryKeyObj
in interface BaseModel<T extends BaseModel<T>>
getPrimaryKeyObj
in interface ClassedModel
public T getWrappedModel()
getWrappedModel
in interface ModelWrapper<T extends BaseModel<T>>
public int hashCode()
hashCode
in class Object
public boolean isCachedModel()
BaseModel
true
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()
BaseModel
true
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()
BaseModel
true
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()
BaseModel
true
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()
BaseModel
true
if this model instance does not yet exist in
the database.public void resetOriginalValues()
BaseModel
resetOriginalValues
in interface BaseModel<T extends BaseModel<T>>
public void setCachedModel(boolean cachedModel)
BaseModel
setCachedModel
in interface BaseModel<T extends BaseModel<T>>
cachedModel
- whether this model instance was retrieved from the
entity cacheEntityCache
public 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)
BaseModel
setExpandoBridgeAttributes
in interface BaseModel<T extends BaseModel<T>>
serviceContext
- the service context to be appliedServiceContext.getExpandoBridgeAttributes()
public void setNew(boolean n)
BaseModel
public void setPrimaryKeyObj(Serializable primaryKeyObj)
BaseModel
setPrimaryKeyObj
in interface BaseModel<T extends BaseModel<T>>
setPrimaryKeyObj
in interface ClassedModel
primaryKeyObj
- the primary key of this model instancepublic CacheModel<T> toCacheModel()
BaseModel
toCacheModel
in interface BaseModel<T extends BaseModel<T>>
public T toEscapedModel()
BaseModel
AutoEscapeBeanHandler
.toEscapedModel
in interface BaseModel<T extends BaseModel<T>>
AutoEscapeBeanHandler
public String toString()
toString
in class Object
public T toUnescapedModel()
toUnescapedModel
in interface BaseModel<T extends BaseModel<T>>
public String toXmlString()
BaseModel
toXmlString
in interface BaseModel<T extends BaseModel<T>>