public abstract class BaseModelWrapper<T extends BaseModel<T>> extends java.lang.Object implements BaseModel<T>, ModelWrapper<T>
Constructor and Description |
---|
BaseModelWrapper(T model) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Creates a shallow clone of this model instance.
|
int |
compareTo(T o) |
boolean |
equals(java.lang.Object object) |
ExpandoBridge |
getExpandoBridge()
Returns the expando bridge for this model instance.
|
java.lang.Class<?> |
getModelClass() |
java.lang.String |
getModelClassName() |
java.io.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(java.io.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 . |
java.lang.String |
toString() |
T |
toUnescapedModel() |
java.lang.String |
toXmlString()
Returns the XML representation of this model instance.
|
protected abstract T |
wrap(T model) |
finalize, getClass, notify, notifyAll, wait, wait, wait
getAttributeGetterFunctions, getAttributeSetterBiConsumers, getModelAttributes, setModelAttributes
public BaseModelWrapper(T model)
public java.lang.Object clone()
BaseModel
public int compareTo(T o)
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public ExpandoBridge getExpandoBridge()
BaseModel
getExpandoBridge
in interface BaseModel<T extends BaseModel<T>>
getExpandoBridge
in interface ClassedModel
public java.lang.Class<?> getModelClass()
getModelClass
in interface ClassedModel
public java.lang.String getModelClassName()
getModelClassName
in interface ClassedModel
public java.io.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 java.lang.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(java.io.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 java.lang.String toString()
toString
in class java.lang.Object
public T toUnescapedModel()
toUnescapedModel
in interface BaseModel<T extends BaseModel<T>>
public java.lang.String toXmlString()
BaseModel
toXmlString
in interface BaseModel<T extends BaseModel<T>>