|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BeanState
Provides access to the internal state of an entity bean.
Method Summary | |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Add a propertyChangeListener. |
Set<String> |
getChangedProps()
Return the set of changed properties. |
Set<String> |
getLoadedProps()
For partially populated beans returns the properties that are loaded on the bean. |
boolean |
isDirty()
Return true if the bean has been changed but not yet saved. |
boolean |
isNew()
Return true if the bean is new (and not yet saved). |
boolean |
isNewOrDirty()
Return true if the bean is new or dirty (and probably needs to be saved). |
boolean |
isReadOnly()
Return true if the bean is readOnly. |
boolean |
isReference()
Return true if this is a lazy loading reference bean. |
boolean |
isSharedInstance()
Return true if this is a shared instance. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Remove a propertyChangeListener. |
void |
setLoaded(Set<String> loadedProperties)
Advanced - Used to programmatically build a partially or fully loaded entity bean. |
void |
setReadOnly(boolean readOnly)
Set the readOnly status for the bean. |
void |
setReference()
Advanced - Used to programmatically build a reference object. |
Method Detail |
---|
boolean isReference()
If so the this bean only holds the Id property and will invoke lazy loading if any other property is get or set.
boolean isNew()
boolean isNewOrDirty()
boolean isDirty()
Set<String> getLoadedProps()
Accessing another property will cause lazy loading to occur.
Set<String> getChangedProps()
boolean isReadOnly()
If a setter is called on a readOnly bean it will throw an exception.
void setReadOnly(boolean readOnly)
boolean isSharedInstance()
This means the instance is potentially being used by other users/threads concurrently and must always be read only.
Typically this instance has come from the server cache. If a 'readOnly' object is request by a query etc and the cache is used then Ebean can return the shared instance rather than creating and returning a copy.
void addPropertyChangeListener(PropertyChangeListener listener)
void removePropertyChangeListener(PropertyChangeListener listener)
void setReference()
You can create a new EntityBean (
EbeanServer.createEntityBean(Class)
, set its Id property and then
call this setReference() method.
void setLoaded(Set<String> loadedProperties)
EbeanServer.createEntityBean(Class)
, then populate its properties
and then call this method specifying which properties where loaded or
null for a fully loaded entity bean.
loadedProperties
- the properties that where loaded or null for a fully loaded
entity bean.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |