Package org.ehrbase.dao.access.jooq
Class SystemAccess
java.lang.Object
org.ehrbase.dao.access.support.DataAccess
org.ehrbase.dao.access.jooq.SystemAccess
- All Implemented Interfaces:
I_DomainAccess,I_SimpleCRUD,I_SystemAccess
Created by Christian Chevalley on 4/20/2015.
-
Field Summary
Fields inherited from interface org.ehrbase.dao.access.interfaces.I_DomainAccess
DBCP2_POOL, KEY_AUTO_RECONNECT, KEY_CONNECTION_MODE, KEY_DATABASE, KEY_DIALECT, KEY_HOST, KEY_INITIAL_CONNECTIONS, KEY_INTROSPECT_CACHE, KEY_KNOWLEDGE, KEY_LOG_ABANDONNED, KEY_LOGIN, KEY_MAX_ACTIVE, KEY_MAX_CONNECTION, KEY_MAX_IDLE, KEY_PASSWORD, KEY_PORT, KEY_REMOVE_ABANDONNED, KEY_REMOVE_ABANDONNED_TIMEOUT, KEY_SCHEMA, KEY_SET_MAX_PREPARED_STATEMENTS, KEY_SET_POOL_PREPARED_STATEMENTS, KEY_TEST_ON_BORROW, KEY_URL, KEY_WAIT_MS, PG_POOL -
Constructor Summary
ConstructorsConstructorDescriptionSystemAccess(I_DomainAccess domainAccess) SystemAccess(I_DomainAccess domainAccess, String description, String settings) -
Method Summary
Modifier and TypeMethodDescriptioncommit()storeComposition a new entry in the DB, using a default transaction time
only implemented with "root" tables: ehr, contribution and composition!storeComposition a new entry in the DBstatic UUIDcreateOrRetrieveInstanceId(I_DomainAccess domainAccess, String description, String settings) Try to retrieve system with given input.static UUIDcreateOrRetrieveLocalSystem(I_DomainAccess domainAccess) Helper to retrieve or storeComposition a local host identifier
the local settings is a combination of MAC address and hostname:
for example: 44-87-FC-A9-B4-B2|TEST-PC
if the system is not yet in the DB it is created, it is retrieved otherwisedelete()delete the Versioned Object associated with the instance implementing this Data Access Interface.getId()static I_SystemAccessretrieveInstance(I_DomainAccess domainAccess, UUID id) retrieve a system entry by its Idstatic UUIDretrieveInstanceId(I_DomainAccess domainAccess, String settings) retrieve the Id of a system by name (or settings)update()Deprecated.Deprecated.updateComposition the current entry
depending on the implementation, records are updated only if one or more field(s) have been changedupdateComposition the current entry even if the record is not modified
intended to be used with temporal tables to ensure that a set of interdependent tables are updated in sync.Methods inherited from class org.ehrbase.dao.access.support.DataAccess
getConnection, getContext, getDialect, getIntrospectService, getKnowledgeManager, getServerConfig, releaseConnection
-
Constructor Details
-
SystemAccess
-
SystemAccess
-
-
Method Details
-
createOrRetrieveLocalSystem
Description copied from interface:I_SystemAccessHelper to retrieve or storeComposition a local host identifier
the local settings is a combination of MAC address and hostname:
for example: 44-87-FC-A9-B4-B2|TEST-PC
if the system is not yet in the DB it is created, it is retrieved otherwise- Returns:
- UUID of local system from DB
-
createOrRetrieveInstanceId
public static UUID createOrRetrieveInstanceId(I_DomainAccess domainAccess, String description, String settings) Description copied from interface:I_SystemAccessTry to retrieve system with given input. If not available create instance.- Parameters:
domainAccess- Data Access Objectdescription- Optional description, can be NULL to use defaultsettings- a string describing the system (arbitrary convention)- Returns:
- UUID of system entry
-
retrieveInstanceId
Description copied from interface:I_SystemAccessretrieve the Id of a system by name (or settings)- Parameters:
domainAccess- SQL accesssettings- a string describing the system (arbitrary convention)- Returns:
- UUID or null if not found
- Throws:
IllegalArgumentException- if couldn't retrieve instance with given settings
-
commit
Description copied from interface:I_SimpleCRUDstoreComposition a new entry in the DB- Specified by:
commitin interfaceI_SimpleCRUD- Returns:
- the UUID of the newly created record
-
commit
Description copied from interface:I_SimpleCRUDstoreComposition a new entry in the DB, using a default transaction time
only implemented with "root" tables: ehr, contribution and composition!- Specified by:
commitin interfaceI_SimpleCRUD- Returns:
- the UUID of the newly created record
-
update
Description copied from interface:I_SimpleCRUDupdateComposition the current entry
depending on the implementation, records are updated only if one or more field(s) have been changed- Specified by:
updatein interfaceI_SimpleCRUD- Returns:
-
update
Description copied from interface:I_SimpleCRUDupdateComposition the current entry even if the record is not modified
intended to be used with temporal tables to ensure that a set of interdependent tables are updated in sync. This approach is used to simplify versions retrieval.- Specified by:
updatein interfaceI_SimpleCRUD- Returns:
-
update
Deprecated.Description copied from interface:I_SimpleCRUDupdateComposition the current entry using time now as the system transaction time
only implemented at root level object (contribution, composition, ehr). depending on the implementation, records are updated only if one or more field(s) have been changed- Specified by:
updatein interfaceI_SimpleCRUD- Returns:
- Throws:
InternalServerException- because inherited interface function isn't implemented in this class
-
update
Deprecated.Description copied from interface:I_SimpleCRUDupdateComposition the current entry using time now as the system transaction time
only implemented at root level object (contribution, composition, ehr). depending on the implementation, records are updated only if one or more field(s) have been changed- Specified by:
updatein interfaceI_SimpleCRUD- Returns:
- Throws:
InternalServerException- because inherited interface function isn't implemented in this class
-
delete
Description copied from interface:I_SimpleCRUDdelete the Versioned Object associated with the instance implementing this Data Access Interface. Relies on ON DELETE CASCADE- Specified by:
deletein interfaceI_SimpleCRUD- Returns:
-
retrieveInstance
Description copied from interface:I_SystemAccessretrieve a system entry by its Id- Parameters:
domainAccess- SQL accessid- UUID- Returns:
- UUID
-
getId
- Specified by:
getIdin interfaceI_SystemAccess
-
getSettings
- Specified by:
getSettingsin interfaceI_SystemAccess
-
getDescription
- Specified by:
getDescriptionin interfaceI_SystemAccess
-
getDataAccess
- Specified by:
getDataAccessin interfaceI_DomainAccess
-