public interface RemoteEntityConnection
extends java.rmi.Remote
Modifier and Type | Method and Description |
---|---|
void |
beginTransaction()
Begins a transaction on this connection
|
void |
commitTransaction()
Performs a commit and ends the current transaction
|
void |
delete(EntityCondition condition)
Deletes the entities specified by the given condition
Performs a commit unless a transaction is open.
|
void |
delete(java.util.List<Entity.Key> entityKeys)
Deletes the entities according to the given primary keys.
|
void |
disconnect()
Disconnects this connection
|
java.util.List |
executeFunction(java.lang.String functionId,
java.lang.Object... arguments)
Executes the function with the given id
|
void |
executeProcedure(java.lang.String procedureId,
java.lang.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
|
Domain |
getDomain() |
User |
getUser() |
java.util.List<Entity.Key> |
insert(java.util.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() |
byte[] |
readBlob(Entity.Key primaryKey,
java.lang.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
|
java.util.Map<java.lang.String,java.util.Collection<Entity>> |
selectDependencies(java.util.Collection<Entity> entities)
Returns the entities that depend on the given entities via foreign keys, mapped to corresponding entityIds
|
java.util.List<Entity> |
selectMany(EntitySelectCondition condition)
Selects entities according to the specified condition
|
java.util.List<Entity> |
selectMany(java.util.List<Entity.Key> keys)
Returns entities according to
keys |
java.util.List<Entity> |
selectMany(java.lang.String entityId,
java.lang.String propertyId,
java.lang.Object... values)
Selects entities according to one property (
propertyId ), using values as a condition |
int |
selectRowCount(EntityCondition condition)
Selects the number of rows returned according to the given condition
|
Entity |
selectSingle(Entity.Key key)
Selects a single entity by key
|
Entity |
selectSingle(EntitySelectCondition condition)
Selects a single entity according to the specified condition, throws a DatabaseException
if the condition results in more than one entity
|
Entity |
selectSingle(java.lang.String entityId,
java.lang.String propertyId,
java.lang.Object value)
Selects a single entity
|
java.util.List<java.lang.Object> |
selectValues(java.lang.String propertyId,
EntityCondition condition)
Selects ordered and distinct non-null values of the given property
|
java.util.List<Entity> |
update(java.util.List<Entity> entities)
Updates the given entities according to their properties.
|
void |
writeBlob(Entity.Key primaryKey,
java.lang.String blobPropertyId,
byte[] blobData)
Writes
blobData in the blob field specified by the property identified by propertyId
for the given entity |
Domain getDomain() throws java.rmi.RemoteException
java.rmi.RemoteException
- in case of an exceptionUser getUser() throws java.rmi.RemoteException
java.rmi.RemoteException
- in case of an exceptionboolean isConnected() throws java.rmi.RemoteException
java.rmi.RemoteException
- in case of an exceptionvoid disconnect() throws java.rmi.RemoteException
java.rmi.RemoteException
- in case of an exceptionboolean isTransactionOpen() throws java.rmi.RemoteException
java.rmi.RemoteException
- in case of exceptionvoid beginTransaction() throws java.rmi.RemoteException
java.lang.IllegalStateException
- if a transaction is already openjava.rmi.RemoteException
- in case of a remote exceptionvoid rollbackTransaction() throws java.rmi.RemoteException
java.lang.IllegalStateException
- in case a transaction is not openjava.rmi.RemoteException
- in case of a remote exceptionvoid commitTransaction() throws java.rmi.RemoteException
java.lang.IllegalStateException
- in case a transaction is not openjava.rmi.RemoteException
- in case of a remote exceptionjava.util.List executeFunction(java.lang.String functionId, java.lang.Object... arguments) throws java.rmi.RemoteException, DatabaseException
functionId
- the function IDarguments
- the arguments, if anyDatabaseException
- in case anything goes wrong during the executionjava.rmi.RemoteException
- in case of a remote exceptionvoid executeProcedure(java.lang.String procedureId, java.lang.Object... arguments) throws java.rmi.RemoteException, DatabaseException
procedureId
- the procedure IDarguments
- the arguments, if anyDatabaseException
- in case anything goes wrong during the executionjava.rmi.RemoteException
- in case of a remote exceptionjava.util.List<Entity.Key> insert(java.util.List<Entity> entities) throws java.rmi.RemoteException, DatabaseException
entities
- the entities to insertDatabaseException
- in case of a db exceptionjava.rmi.RemoteException
- in case of a remote exceptionjava.util.List<Entity> update(java.util.List<Entity> entities) throws java.rmi.RemoteException, DatabaseException
entities
- the entities to updateDatabaseException
- in case of a db exceptionRecordModifiedException
- in case an entity has been modified or deleted by another userjava.rmi.RemoteException
- in case of a remote exceptionvoid delete(java.util.List<Entity.Key> entityKeys) throws java.rmi.RemoteException, DatabaseException
entityKeys
- the primary keys of the entities to deleteDatabaseException
- in case of a db exceptionjava.rmi.RemoteException
- in case of a remote exceptionvoid delete(EntityCondition condition) throws java.rmi.RemoteException, DatabaseException
condition
- the condition specifying the entities to deleteDatabaseException
- in case of a db exceptionjava.rmi.RemoteException
- in case of a remote exceptionjava.util.List<java.lang.Object> selectValues(java.lang.String propertyId, EntityCondition condition) throws java.rmi.RemoteException, DatabaseException
propertyId
- the ID of the propertycondition
- the conditionDatabaseException
- in case of a db exceptionjava.lang.IllegalArgumentException
- in case the given property is not a column based propertyjava.lang.UnsupportedOperationException
- in case the entity is based on a select queryjava.rmi.RemoteException
- in case of a remote exceptionEntity selectSingle(java.lang.String entityId, java.lang.String propertyId, java.lang.Object value) throws java.rmi.RemoteException, DatabaseException
entityId
- the entity typepropertyId
- the ID of the property to use as a conditionvalue
- the value to use in the conditionentityId
, having the
value of propertyId
as value
DatabaseException
- in case of a db exceptionRecordNotFoundException
- in case the entity was not foundMultipleRecordsFoundException
- in case multiple entities were foundjava.rmi.RemoteException
- in case of a remote exceptionEntity selectSingle(Entity.Key key) throws java.rmi.RemoteException, DatabaseException
key
- the key of the entity to selectkey
DatabaseException
- in case of a db exceptionRecordNotFoundException
- in case the entity was not foundMultipleRecordsFoundException
- in case multiple entities were foundjava.rmi.RemoteException
- in case of a remote exceptionEntity selectSingle(EntitySelectCondition condition) throws java.rmi.RemoteException, DatabaseException
condition
- the condition specifying the entity to selectDatabaseException
- if an exception occursRecordNotFoundException
- in case the entity was not foundMultipleRecordsFoundException
- in case multiple entities were foundjava.rmi.RemoteException
- in case of a remote exceptionjava.util.List<Entity> selectMany(java.util.List<Entity.Key> keys) throws java.rmi.RemoteException, DatabaseException
keys
keys
- the keys used in the conditionkeys
DatabaseException
- in case of a db exceptionjava.rmi.RemoteException
- in case of a remote exceptionjava.util.List<Entity> selectMany(EntitySelectCondition condition) throws java.rmi.RemoteException, DatabaseException
condition
- the condition specifying which entities to selectDatabaseException
- in case of a db exceptionjava.rmi.RemoteException
- in case of a remote exceptionjava.util.List<Entity> selectMany(java.lang.String entityId, java.lang.String propertyId, java.lang.Object... values) throws java.rmi.RemoteException, DatabaseException
propertyId
), using values
as a conditionentityId
- the entity typepropertyId
- the ID of the condition propertyvalues
- the property values to use as conditionentityId
according to propertyId
and values
DatabaseException
- in case of a db exceptionjava.rmi.RemoteException
- in case of a remote exceptionjava.util.Map<java.lang.String,java.util.Collection<Entity>> selectDependencies(java.util.Collection<Entity> entities) throws java.rmi.RemoteException, DatabaseException
entities
- the entities for which to retrieve dependenciesentities
DatabaseException
- in case of a db exceptionjava.rmi.RemoteException
- in case of a remote exceptionint selectRowCount(EntityCondition condition) throws java.rmi.RemoteException, DatabaseException
condition
- the search conditionDatabaseException
- in case of a db exceptionjava.rmi.RemoteException
- in case of a remote exceptionReportResult fillReport(ReportWrapper reportWrapper) throws java.rmi.RemoteException, DatabaseException, ReportException
reportWrapper
- the wrapper containing the report to fillDatabaseException
- in case of a db exceptionReportException
- in case of a report exceptionjava.rmi.RemoteException
- in case of a remote exceptionReportWrapper.fillReport(java.sql.Connection)
void writeBlob(Entity.Key primaryKey, java.lang.String blobPropertyId, byte[] blobData) throws java.rmi.RemoteException, DatabaseException
blobData
in the blob field specified by the property identified by propertyId
for the given entityprimaryKey
- the primary key of the entity for which to write the blob fieldblobPropertyId
- the ID of the blob propertyblobData
- the blob dataDatabaseException
- in case of a db exceptionjava.rmi.RemoteException
- in case of a remote exceptionbyte[] readBlob(Entity.Key primaryKey, java.lang.String blobPropertyId) throws java.rmi.RemoteException, DatabaseException
propertyId
from the given entityprimaryKey
- the primary key of the entityblobPropertyId
- the ID of the blob propertyDatabaseException
- in case of a db exceptionjava.rmi.RemoteException
- in case of a remote exception