@ProviderType public interface BaseModel<T> extends ClassedModel, Cloneable, Comparable<T>, Serializable
BaseModelImpl
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates a shallow clone of this model instance.
|
ExpandoBridge |
getExpandoBridge()
Returns the expando bridge for this model instance.
|
Map<String,Object> |
getModelAttributes() |
Serializable |
getPrimaryKeyObj()
Returns the primary key of this model instance.
|
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 |
setModelAttributes(Map<String,Object> attributes) |
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 . |
T |
toUnescapedModel() |
String |
toXmlString()
Returns the XML representation of this model instance.
|
getModelClass, getModelClassName
compareTo
Object clone()
ExpandoBridge getExpandoBridge()
getExpandoBridge
in interface ClassedModel
Serializable getPrimaryKeyObj()
getPrimaryKeyObj
in interface ClassedModel
boolean isCachedModel()
true
if this model instance was retrieved from the
entity cache.true
if this model instance was retrieved from the
entity cache; false
otherwisesetCachedModel(boolean)
boolean isEntityCacheEnabled()
true
if this model's entity cache is enabled.true
if this model's entity cache is enabled;
false
otherwiseboolean isEscapedModel()
true
if this model instance is escaped.true
if this model instance is escaped;
false
otherwiseboolean isFinderCacheEnabled()
true
if this model's finder cache is enabled.true
if this model's finder cache is enabled;
false
otherwiseboolean isNew()
true
if this model instance does not yet exist in
the database.true
if this model instance does not yet exist in
the database; false
otherwisevoid resetOriginalValues()
void setCachedModel(boolean cachedModel)
cachedModel
- whether this model instance was retrieved from the
entity cacheEntityCache
void setExpandoBridgeAttributes(BaseModel<?> baseModel)
void setExpandoBridgeAttributes(ExpandoBridge expandoBridge)
void setExpandoBridgeAttributes(ServiceContext serviceContext)
serviceContext
- the service context to be appliedServiceContext.getExpandoBridgeAttributes()
void setNew(boolean n)
n
- whether this model instance does not yet exist in the databasevoid setPrimaryKeyObj(Serializable primaryKeyObj)
setPrimaryKeyObj
in interface ClassedModel
primaryKeyObj
- the primary key of this model instanceCacheModel<T> toCacheModel()
T toEscapedModel()
AutoEscapeBeanHandler
.AutoEscapeBeanHandler
T toUnescapedModel()
String toXmlString()