| Constructor and Description |
|---|
DefaultBeanState(EntityBean entityBean) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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.
|
public DefaultBeanState(EntityBean entityBean)
public boolean isReference()
BeanStateIf so the this bean only holds the Id property and will invoke lazy loading if any other property is get or set.
isReference in interface BeanStatepublic boolean isNew()
BeanStatepublic boolean isNewOrDirty()
BeanStateisNewOrDirty in interface BeanStatepublic boolean isDirty()
BeanStatepublic Set<String> getLoadedProps()
BeanStateAccessing another property will cause lazy loading to occur.
getLoadedProps in interface BeanStatepublic Set<String> getChangedProps()
BeanStategetChangedProps in interface BeanStatepublic boolean isReadOnly()
BeanStateIf a setter is called on a readOnly bean it will throw an exception.
isReadOnly in interface BeanStatepublic void setReadOnly(boolean readOnly)
BeanStatesetReadOnly in interface BeanStatepublic void addPropertyChangeListener(PropertyChangeListener listener)
BeanStateaddPropertyChangeListener in interface BeanStatepublic void removePropertyChangeListener(PropertyChangeListener listener)
BeanStateremovePropertyChangeListener in interface BeanStatepublic void setLoaded(Set<String> loadedProperties)
BeanStateEbeanServer.createEntityBean(Class), then populate its properties
and then call this method specifying which properties where loaded or null
for a fully loaded entity bean.public void setReference()
BeanState
You can create a new EntityBean (
EbeanServer.createEntityBean(Class), set its Id property and then
call this setReference() method.
setReference in interface BeanStateCopyright © 2014. All Rights Reserved.