public class AmberEntityHome
extends java.lang.Object
implements java.lang.Comparable
Constructor and Description |
---|
AmberEntityHome(AmberPersistenceUnit manager,
EntityType type) |
Modifier and Type | Method and Description |
---|---|
void |
addUpdate(CacheUpdate update)
Adds a cache update.
|
int |
compareTo(java.lang.Object b) |
void |
delete(AmberConnection aConn,
long primaryKey)
Deletes by the primary key.
|
void |
delete(AmberConnection aConn,
java.lang.Object key)
Deletes by the primary key.
|
EntityItem |
findDiscriminatorEntityItem(AmberConnection aConn,
java.lang.Object key,
java.lang.String discriminator)
Loads an entity where the type is determined by a discriminator
|
EntityItem |
findEntityItem(AmberConnection aConn,
java.lang.Object key) |
EntityItem |
findItem(AmberConnection aConn,
java.sql.ResultSet rs,
int index)
Finds by the primary key.
|
long |
getCacheTimeout()
Returns the cache timeout.
|
java.lang.reflect.Method |
getCauchoGetBeanMethod()
Returns the getBean method to instantiate the Amber object.
|
EntityFactory |
getEntityFactory()
Returns the entity factory.
|
EntityType |
getEntityType()
Returns the entity type
|
java.lang.Class |
getInstanceClass()
Returns the instance class.
|
java.lang.Class |
getJavaClass()
Returns the java class.
|
java.lang.Object |
getKeyFromEntity(Entity entity)
Returns the entity from the key.
|
AmberPersistenceUnit |
getManager()
Returns the manager.
|
EntityType |
getRootType()
Returns the entity type
|
void |
init()
Initialize the home.
|
java.lang.Object |
loadFull(AmberConnection aConn,
java.sql.ResultSet rs,
int index)
Finds by the primary key.
|
java.lang.Object |
loadLazy(AmberConnection aConn,
java.sql.ResultSet rs,
int index)
Finds by the primary key.
|
Entity |
makePersistent(Entity entity,
AmberConnection aConn,
boolean isLazy)
Finds by the primary key.
|
Entity |
newDiscriminatorEntity(java.lang.Object key,
java.lang.String discriminator)
Loads an entity where the type is determined by a discriminator
|
Entity |
newEntity(java.lang.Object key)
Instantiates a new entity for this home.
|
void |
save(AmberConnection aConn,
Entity entity)
Saves based on the object.
|
void |
setEntityFactory(EntityFactory factory)
Sets the entity factory.
|
EntityItem |
setEntityItem(java.lang.Object key,
EntityItem item)
Loads an entity based on the primary key.
|
java.lang.Object |
toObjectKey(long key)
Converts a long key to the key.
|
java.lang.String |
toString() |
void |
update(Entity entity)
Update for a modification.
|
public AmberEntityHome(AmberPersistenceUnit manager, EntityType type)
public java.lang.reflect.Method getCauchoGetBeanMethod()
public AmberPersistenceUnit getManager()
public EntityType getEntityType()
public EntityType getRootType()
public java.lang.Class getJavaClass()
public EntityFactory getEntityFactory()
public void setEntityFactory(EntityFactory factory)
public long getCacheTimeout()
public java.lang.Class getInstanceClass()
public void init() throws ConfigException
ConfigException
public java.lang.Object getKeyFromEntity(Entity entity) throws AmberException
AmberException
public java.lang.Object toObjectKey(long key)
public EntityItem findItem(AmberConnection aConn, java.sql.ResultSet rs, int index) throws java.sql.SQLException
java.sql.SQLException
public java.lang.Object loadFull(AmberConnection aConn, java.sql.ResultSet rs, int index) throws java.sql.SQLException
java.sql.SQLException
public java.lang.Object loadLazy(AmberConnection aConn, java.sql.ResultSet rs, int index) throws java.sql.SQLException
java.sql.SQLException
public EntityItem findEntityItem(AmberConnection aConn, java.lang.Object key) throws AmberException
AmberException
public EntityItem setEntityItem(java.lang.Object key, EntityItem item) throws AmberException
key
- the primary keyaConn
- the Amber connection to associate with the loaded itemisLoad
- if true, try to load the beanAmberException
public EntityItem findDiscriminatorEntityItem(AmberConnection aConn, java.lang.Object key, java.lang.String discriminator) throws java.sql.SQLException
aConn
- the connection to associate with the entitykey
- the primary keydiscriminator
- the object's discriminatorjava.sql.SQLException
public Entity newEntity(java.lang.Object key)
public Entity newDiscriminatorEntity(java.lang.Object key, java.lang.String discriminator)
aConn
- the connection to associate with the entitykey
- the primary keydiscriminator
- the object's discriminatorpublic Entity makePersistent(Entity entity, AmberConnection aConn, boolean isLazy) throws java.sql.SQLException
java.sql.SQLException
public void save(AmberConnection aConn, Entity entity) throws java.sql.SQLException
java.sql.SQLException
public void delete(AmberConnection aConn, java.lang.Object key) throws java.sql.SQLException
java.sql.SQLException
public void delete(AmberConnection aConn, long primaryKey) throws java.sql.SQLException
java.sql.SQLException
public void update(Entity entity) throws java.sql.SQLException
java.sql.SQLException
public void addUpdate(CacheUpdate update)
public int compareTo(java.lang.Object b)
compareTo
in interface java.lang.Comparable
public java.lang.String toString()
toString
in class java.lang.Object