|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EntityConnection
Defines the database methods the database layer offers.
Method Summary | |
---|---|
void |
beginTransaction()
Begins a transaction on this connection |
void |
commitTransaction()
Performs a commit and ends the current transaction |
void |
delete(EntityCriteria criteria)
Deletes the entities specified by the given criteria Performs a commit unless a transaction is open. |
void |
delete(List<Entity.Key> entityKeys)
Deletes the entities according to the given primary keys. |
void |
disconnect()
Disconnects this connection |
List<?> |
executeFunction(String functionID,
Object... arguments)
Executes the function with the given id |
void |
executeProcedure(String procedureID,
Object... arguments)
Executes the procedure with the given id |
ReportResult |
fillReport(ReportWrapper reportWrapper)
Takes a ReportWrapper object using a JDBC datasource and returns an initialized ReportResult object |
PoolableConnection |
getPoolableConnection()
|
User |
getUser()
|
List<Entity.Key> |
insert(List<Entity> entities)
Inserts the given entities, returning a list containing the primary keys of the inserted entities in the same order as they were received. |
boolean |
isConnected()
|
boolean |
isTransactionOpen()
|
boolean |
isValid()
|
byte[] |
readBlob(Entity.Key primaryKey,
String blobPropertyID)
Reads the blob specified by the property identified by propertyID from the given entity |
void |
rollbackTransaction()
Performs a rollback and ends the current transaction |
List<Entity> |
selectAll(String entityID)
Selects all the entities of the given type |
Map<String,Collection<Entity>> |
selectDependentEntities(Collection<Entity> entities)
Returns the entities that depend on the given entities via foreign keys, mapped to corresponding entityIDs |
List<Entity> |
selectMany(EntitySelectCriteria criteria)
Selects entities according to the specified criteria |
List<Entity> |
selectMany(List<Entity.Key> keys)
Returns entities according to keys |
List<Entity> |
selectMany(String entityID,
String propertyID,
Object... values)
Selects entities according to one property ( propertyID ), using values as a condition |
List<Object> |
selectPropertyValues(String entityID,
String propertyID,
boolean order)
Selects distinct non-null values of the given property of the given entity |
int |
selectRowCount(EntityCriteria criteria)
Selects the number of rows returned according to the given criteria |
Entity |
selectSingle(Entity.Key key)
Selects a single entity by key |
Entity |
selectSingle(EntitySelectCriteria criteria)
Selects a single entity according to the specified criteria, throws a DatabaseException if the criteria results in more than one entity |
Entity |
selectSingle(String entityID,
String propertyID,
Object value)
Selects a single entity |
List<Entity> |
update(List<Entity> entities)
Updates the given entities according to their properties. |
void |
writeBlob(Entity.Key primaryKey,
String blobPropertyID,
String dataDescription,
byte[] blobData)
Writes blobData in the blob field specified by the property identified by propertyID
for the given entity |
Method Detail |
---|
User getUser()
boolean isConnected()
void disconnect()
boolean isValid()
boolean isTransactionOpen()
void beginTransaction()
IllegalStateException
- if a transaction is already openvoid rollbackTransaction()
IllegalStateException
- in case a transaction is not openvoid commitTransaction()
IllegalStateException
- in case a transaction is not openList<?> executeFunction(String functionID, Object... arguments) throws DatabaseException
functionID
- the function IDarguments
- the arguments, if any
DatabaseException
- in case anyhing goes wrong during the executionvoid executeProcedure(String procedureID, Object... arguments) throws DatabaseException
procedureID
- the procedure IDarguments
- the arguments, if any
DatabaseException
- in case anyhing goes wrong during the executionList<Entity.Key> insert(List<Entity> entities) throws DatabaseException
entities
- the entities to insert
DatabaseException
- in case of a db exceptionList<Entity> update(List<Entity> entities) throws DatabaseException
entities
- the entities to update
DatabaseException
- in case of a db exception
RecordModifiedException
- in case an entity has been modified by another uservoid delete(List<Entity.Key> entityKeys) throws DatabaseException
entityKeys
- the primary keys of the entities to delete
DatabaseException
- in case of a db exceptionvoid delete(EntityCriteria criteria) throws DatabaseException
criteria
- the criteria specifying the entities to delete
DatabaseException
- in case of a db exceptionList<Object> selectPropertyValues(String entityID, String propertyID, boolean order) throws DatabaseException
entityID
- the class of the EntitypropertyID
- the ID of the propertyorder
- if true then the result is ordered
DatabaseException
- in case of a db exceptionEntity selectSingle(String entityID, String propertyID, Object value) throws DatabaseException
entityID
- the Class of the entity to selectpropertyID
- the ID of the property to use as a conditionvalue
- the value to use in the condition
entityID
, having the
value of propertyID
as value
RecordNotFoundException
- in case the entity was not found
DatabaseException
- in case of a db exceptionEntity selectSingle(Entity.Key key) throws DatabaseException
key
- the key of the entity to select
entityID
, having the key key
RecordNotFoundException
- in case the entity was not found
DatabaseException
- in case of a db exceptionEntity selectSingle(EntitySelectCriteria criteria) throws DatabaseException
criteria
- the criteria specifying the entity to select
RecordNotFoundException
- in case the entity was not found
DatabaseException
- if an exception occursList<Entity> selectMany(List<Entity.Key> keys) throws DatabaseException
keys
keys
- the keys used in the condition
keys
DatabaseException
- in case of a db exceptionList<Entity> selectMany(EntitySelectCriteria criteria) throws DatabaseException
criteria
- the criteria specifying which entities to select
DatabaseException
- in case of a db exceptionList<Entity> selectMany(String entityID, String propertyID, Object... values) throws DatabaseException
propertyID
), using values
as a condition
entityID
- the Class of the entities to selectpropertyID
- the ID of the condition propertyvalues
- the property values to use as condition
entityID
according to propertyID
and values
DatabaseException
- in case of a db exceptionList<Entity> selectAll(String entityID) throws DatabaseException
entityID
- the Class of the entities to select
DatabaseException
- in case of a db exceptionMap<String,Collection<Entity>> selectDependentEntities(Collection<Entity> entities) throws DatabaseException
entities
- the entities for which to retrieve dependencies
entities
DatabaseException
- in case of a db exceptionint selectRowCount(EntityCriteria criteria) throws DatabaseException
criteria
- the search criteria
DatabaseException
- in case of a db exceptionReportResult fillReport(ReportWrapper reportWrapper) throws DatabaseException, ReportException
reportWrapper
- the wrapper containing the report to fill
ReportException
- in case of a report exception
DatabaseException
- in case of a db exceptionReportWrapper.fillReport(java.sql.Connection)
void writeBlob(Entity.Key primaryKey, String blobPropertyID, String dataDescription, byte[] blobData) throws DatabaseException
blobData
in the blob field specified by the property identified by propertyID
for the given entity
primaryKey
- the primary key of the entity for which to write the blob fieldblobPropertyID
- the ID of the blob propertydataDescription
- the value to insert into the blob description columnblobData
- the blob data
DatabaseException
- in case of a db exceptionbyte[] readBlob(Entity.Key primaryKey, String blobPropertyID) throws DatabaseException
propertyID
from the given entity
primaryKey
- the primary key of the entityblobPropertyID
- the ID of the blob property
DatabaseException
- in case of a db exceptionPoolableConnection getPoolableConnection()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |