com.caucho.amber.entity
Interface Entity

All Superinterfaces:
MappedSuperclass

public interface Entity
extends MappedSuperclass

An entity instance


Method Summary
 void __caucho_afterCommit()
          After a commit.
 void __caucho_afterRollback()
          After a rollback.
 void __caucho_cascadePostPersist(AmberConnection aConn)
          Post-cascades the persist operation to child entities.
 void __caucho_cascadePostRemove(AmberConnection aConn)
          Post-cascades the remove operation to child entities.
 void __caucho_cascadePrePersist(AmberConnection aConn)
          Pre-cascades the persist operation to child entities.
 void __caucho_cascadePreRemove(AmberConnection aConn)
          Pre-cascades the remove operation to child entities.
 boolean __caucho_create(AmberConnection aConn, EntityType entityType)
          Creates the entity in the database, making it persistent-new.
 void __caucho_delete()
          Deletes the entity from the database.
 void __caucho_detach()
          Detatch the entity
 void __caucho_expire()
          Expires data
 boolean __caucho_flush()
          Flushes changes to the backing store.
 Entity __caucho_getCacheEntity()
          Gets the corresponding cache entity referenced by __caucho_item.
 EntityItem __caucho_getCacheItem()
          Gets the __caucho_item.
 AmberConnection __caucho_getConnection()
          Returns the connection.
 EntityState __caucho_getEntityState()
          Get the entity state.
 EntityType __caucho_getEntityType()
          Get the entity type.
 java.lang.Object __caucho_getPrimaryKey()
          Get the primary key.
 Entity __caucho_home_find(AmberConnection aConn, AmberEntityHome home, java.lang.Object key)
          Returns a new entity.
 EntityItem __caucho_home_find(AmberConnection aConn, AmberEntityHome home, java.sql.ResultSet rs, int index)
          Loads the entity from the database.
 Entity __caucho_home_new(AmberEntityHome home, java.lang.Object key, AmberConnection aConn, EntityItem cacheItem)
          Returns a new entity.
 void __caucho_invalidate_foreign(java.lang.String table, java.lang.Object key)
          Called when a foreign object is created/deleted.
 boolean __caucho_isDirty()
          Returns true if the entity is dirty.
 boolean __caucho_isLoaded()
          Returns true if the item is loaded
 boolean __caucho_lazy_create(AmberConnection aConn, EntityType entityType)
          Changes the entity state to P_PERSISTING, but does not flush to database.
 java.lang.Object __caucho_load_key(AmberConnection aConn, java.sql.ResultSet rs, int index)
          Loads the entity key.
 void __caucho_load_native(java.sql.ResultSet rs, java.lang.String[] columnNames)
          Loads the entity from a native query
 int __caucho_load(AmberConnection aConn, java.sql.ResultSet rs, int index)
          Loads the entity from the database and returns the number of columns consumed from the result set.
 void __caucho_makePersistent(AmberConnection aConn, EntityItem item)
          Makes the entity persistent.
 boolean __caucho_makePersistent(AmberConnection aConn, EntityType entityType)
          Makes the entity persistent.
 boolean __caucho_match(java.lang.Class cl, java.lang.Object key)
          Returns true if the entity matches.
 void __caucho_mergeFrom(AmberConnection aConn, Entity targetEntity)
          Merges this entity state into an existing entity.
 void __caucho_retrieve_eager(AmberConnection aConn)
          Retrieves data from the data store, including the eager loads.
 void __caucho_retrieve_self(AmberConnection aConn)
          Retrieves data from the data store, only loading own fields.
 void __caucho_setCacheItem(EntityItem item)
          Sets the __caucho_item.
 void __caucho_setConnection(AmberConnection aConn)
          Sets the connection.
 void __caucho_setEntityState(EntityState state)
          Sets the entity state.
 void __caucho_setKey(java.sql.PreparedStatement pstmt, int index)
          Loads the entity from the database.
 void __caucho_setPrimaryKey(java.lang.Object key)
          Set the primary key.
 

Method Detail

__caucho_makePersistent

boolean __caucho_makePersistent(AmberConnection aConn,
                                EntityType entityType)
                                throws java.sql.SQLException
Makes the entity persistent.

Throws:
java.sql.SQLException

__caucho_makePersistent

void __caucho_makePersistent(AmberConnection aConn,
                             EntityItem item)
                             throws java.sql.SQLException
Makes the entity persistent.

Throws:
java.sql.SQLException

__caucho_cascadePrePersist

void __caucho_cascadePrePersist(AmberConnection aConn)
                                throws java.sql.SQLException
Pre-cascades the persist operation to child entities.

Throws:
java.sql.SQLException

__caucho_cascadePreRemove

void __caucho_cascadePreRemove(AmberConnection aConn)
                               throws java.sql.SQLException
Pre-cascades the remove operation to child entities.

Throws:
java.sql.SQLException

__caucho_cascadePostPersist

void __caucho_cascadePostPersist(AmberConnection aConn)
                                 throws java.sql.SQLException
Post-cascades the persist operation to child entities.

Throws:
java.sql.SQLException

__caucho_cascadePostRemove

void __caucho_cascadePostRemove(AmberConnection aConn)
                                throws java.sql.SQLException
Post-cascades the remove operation to child entities.

Throws:
java.sql.SQLException

__caucho_detach

void __caucho_detach()
Detatch the entity


__caucho_create

boolean __caucho_create(AmberConnection aConn,
                        EntityType entityType)
                        throws java.sql.SQLException
Creates the entity in the database, making it persistent-new.

Throws:
java.sql.SQLException

__caucho_lazy_create

boolean __caucho_lazy_create(AmberConnection aConn,
                             EntityType entityType)
                             throws java.sql.SQLException
Changes the entity state to P_PERSISTING, but does not flush to database.

Throws:
java.sql.SQLException

__caucho_setCacheItem

void __caucho_setCacheItem(EntityItem item)
Sets the __caucho_item.


__caucho_setPrimaryKey

void __caucho_setPrimaryKey(java.lang.Object key)
Set the primary key.


__caucho_getPrimaryKey

java.lang.Object __caucho_getPrimaryKey()
Get the primary key.


__caucho_getCacheEntity

Entity __caucho_getCacheEntity()
Gets the corresponding cache entity referenced by __caucho_item.


__caucho_getCacheItem

EntityItem __caucho_getCacheItem()
Gets the __caucho_item.


__caucho_getEntityType

EntityType __caucho_getEntityType()
Get the entity type.


__caucho_getEntityState

EntityState __caucho_getEntityState()
Get the entity state.


__caucho_setEntityState

void __caucho_setEntityState(EntityState state)
Sets the entity state.


__caucho_setConnection

void __caucho_setConnection(AmberConnection aConn)
Sets the connection.


__caucho_getConnection

AmberConnection __caucho_getConnection()
Returns the connection.


__caucho_isLoaded

boolean __caucho_isLoaded()
Returns true if the item is loaded


__caucho_isDirty

boolean __caucho_isDirty()
Returns true if the entity is dirty.


__caucho_match

boolean __caucho_match(java.lang.Class cl,
                       java.lang.Object key)
Returns true if the entity matches.


__caucho_home_find

EntityItem __caucho_home_find(AmberConnection aConn,
                              AmberEntityHome home,
                              java.sql.ResultSet rs,
                              int index)
                              throws java.sql.SQLException
Loads the entity from the database.

Throws:
java.sql.SQLException

__caucho_home_find

Entity __caucho_home_find(AmberConnection aConn,
                          AmberEntityHome home,
                          java.lang.Object key)
Returns a new entity. In the case of inheritance, needs to query the database.


__caucho_home_new

Entity __caucho_home_new(AmberEntityHome home,
                         java.lang.Object key,
                         AmberConnection aConn,
                         EntityItem cacheItem)
Returns a new entity.


__caucho_mergeFrom

void __caucho_mergeFrom(AmberConnection aConn,
                        Entity targetEntity)
Merges this entity state into an existing entity.


__caucho_retrieve_eager

void __caucho_retrieve_eager(AmberConnection aConn)
Retrieves data from the data store, including the eager loads.


__caucho_retrieve_self

void __caucho_retrieve_self(AmberConnection aConn)
Retrieves data from the data store, only loading own fields.


__caucho_load

int __caucho_load(AmberConnection aConn,
                  java.sql.ResultSet rs,
                  int index)
                  throws java.sql.SQLException
Loads the entity from the database and returns the number of columns consumed from the result set.

Throws:
java.sql.SQLException

__caucho_load_key

java.lang.Object __caucho_load_key(AmberConnection aConn,
                                   java.sql.ResultSet rs,
                                   int index)
                                   throws java.sql.SQLException
Loads the entity key.

Throws:
java.sql.SQLException

__caucho_setKey

void __caucho_setKey(java.sql.PreparedStatement pstmt,
                     int index)
                     throws java.sql.SQLException
Loads the entity from the database.

Throws:
java.sql.SQLException

__caucho_load_native

void __caucho_load_native(java.sql.ResultSet rs,
                          java.lang.String[] columnNames)
                          throws java.sql.SQLException
Loads the entity from a native query

Throws:
java.sql.SQLException

__caucho_expire

void __caucho_expire()
Expires data


__caucho_delete

void __caucho_delete()
Deletes the entity from the database.


__caucho_invalidate_foreign

void __caucho_invalidate_foreign(java.lang.String table,
                                 java.lang.Object key)
Called when a foreign object is created/deleted.


__caucho_flush

boolean __caucho_flush()
                       throws java.sql.SQLException
Flushes changes to the backing store.

Throws:
java.sql.SQLException

__caucho_afterCommit

void __caucho_afterCommit()
After a commit.


__caucho_afterRollback

void __caucho_afterRollback()
After a rollback.