com.avaje.ebean.bean
Interface EntityBean

All Superinterfaces:
Serializable

public interface EntityBean
extends Serializable

Bean that is aware of EntityBeanIntercept.

This interface and implementation of these methods is added to Entity Beans via instrumentation. These methods have a funny _ebean_ prefix to avoid any clash with normal methods these beans would have. These methods are not for general application consumption.


Method Summary
 Object _ebean_createCopy()
          Create a copy of this entity bean.
 Object _ebean_getField(int fieldIndex, Object entityBean)
          Return the value of a field from an entity bean of this type.
 Object _ebean_getFieldIntercept(int fieldIndex, Object entityBean)
          Return the field value with interception.
 String[] _ebean_getFieldNames()
          Return the fields in their index order.
 EntityBeanIntercept _ebean_getIntercept()
          Return the intercept for this object.
 String _ebean_getMarker()
          Return the enhancement marker value.
 EntityBeanIntercept _ebean_intercept()
          Similar to _ebean_getIntercept() except it checks to see if the intercept field is null and will create it if required.
 boolean _ebean_isEmbeddedNewOrDirty()
          Return true if any embedded beans are new or dirty.
 Object _ebean_newInstance()
          Create and return a new entity bean instance.
 void _ebean_setEmbeddedLoaded()
          Generated method that sets the loaded state on all the embedded beans on this entity bean by using EntityBeanIntercept.setEmbeddedLoaded(Object o);
 void _ebean_setField(int fieldIndex, Object entityBean, Object value)
          Set the value of a field of an entity bean of this type.
 void _ebean_setFieldIntercept(int fieldIndex, Object entityBean, Object value)
          Set the field value with interception.
 void addPropertyChangeListener(PropertyChangeListener listener)
          Add a PropertyChangeListener to this bean.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Remove a PropertyChangeListener from this bean.
 

Method Detail

_ebean_getMarker

String _ebean_getMarker()
Return the enhancement marker value.

This is the class name of the enhanced class and used to check that all entity classes are enhanced (specifically not just a super class).


_ebean_newInstance

Object _ebean_newInstance()
Create and return a new entity bean instance.


addPropertyChangeListener

void addPropertyChangeListener(PropertyChangeListener listener)
Add a PropertyChangeListener to this bean.


removePropertyChangeListener

void removePropertyChangeListener(PropertyChangeListener listener)
Remove a PropertyChangeListener from this bean.


_ebean_setEmbeddedLoaded

void _ebean_setEmbeddedLoaded()
Generated method that sets the loaded state on all the embedded beans on this entity bean by using EntityBeanIntercept.setEmbeddedLoaded(Object o);


_ebean_isEmbeddedNewOrDirty

boolean _ebean_isEmbeddedNewOrDirty()
Return true if any embedded beans are new or dirty.


_ebean_getIntercept

EntityBeanIntercept _ebean_getIntercept()
Return the intercept for this object.


_ebean_intercept

EntityBeanIntercept _ebean_intercept()
Similar to _ebean_getIntercept() except it checks to see if the intercept field is null and will create it if required.

This is really only required when transientInternalFields=true as an enhancement option. In this case the intercept field is transient and will be null after a bean has been deserialised.

This transientInternalFields=true option was to support some serialization frameworks that can't take into account our ebean fields.


_ebean_createCopy

Object _ebean_createCopy()
Create a copy of this entity bean.

This occurs when a bean is changed. The copy represents the bean as it was initially (oldValues) before any changes where made. This is used for optimistic concurrency control.


_ebean_getFieldNames

String[] _ebean_getFieldNames()
Return the fields in their index order.


_ebean_setField

void _ebean_setField(int fieldIndex,
                     Object entityBean,
                     Object value)
Set the value of a field of an entity bean of this type.

Note that using this method bypasses any interception that otherwise occurs on entity beans. That means lazy loading and oldValues creation.

Parameters:
fieldIndex - the index of the field
entityBean - the entityBean of this type to modify
value - the value to set

_ebean_setFieldIntercept

void _ebean_setFieldIntercept(int fieldIndex,
                              Object entityBean,
                              Object value)
Set the field value with interception.


_ebean_getField

Object _ebean_getField(int fieldIndex,
                       Object entityBean)
Return the value of a field from an entity bean of this type.

Note that using this method bypasses any interception that otherwise occurs on entity beans. That means lazy loading.

Parameters:
fieldIndex - the index of the field
entityBean - the entityBean to get the value from

_ebean_getFieldIntercept

Object _ebean_getFieldIntercept(int fieldIndex,
                                Object entityBean)
Return the field value with interception.



Copyright © 2010. All Rights Reserved.