|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Persistence
Represents domain objects need to be persisted.
Method Summary | |
---|---|
void |
executeBeforePersistAction()
Interceptor to perform tasks before persisting changes. |
long |
getUidPk()
Gets the unique identifier for this domain object. |
boolean |
isPersistent()
true if the object has previously been persisted. |
void |
setDefaultValues()
Set default values for those fields need default values and it's somehow expensive to create the default values for them, either from memory perspective or cpu perspective. |
void |
setUidPk(long uidPk)
Sets the unique identifier for this domain model object. |
Methods inherited from interface com.elasticpath.domain.EpDomain |
---|
getElasticPath, setElasticPath |
Method Detail |
---|
void executeBeforePersistAction()
long getUidPk()
Notice: not all persistent domain objects has unique identifier. Some value objects don't have unique identifer. They are cascading loaded and updated through their parents.
boolean isPersistent()
true
if the object has previously been persisted.
Notice: not all persistent domain objects has unique identifier. Some value objects don't have unique identifer. They are cascading loaded and updated through their parents. It doesn't make sense to call this method on those value object.
true
if the object has previously been persisted.void setDefaultValues()
Map
. Another good example
of a cpu expensive field will be a field like GUID, current date, etc. We prefer this way rather than using the domain object constructor. It
doesn't make sense to set default values everytime when creating a new domain object, because most of the time the default value you set will
be overwritten by hibernate immediately.
void setUidPk(long uidPk)
uidPk
- the new unique identifier.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |