Class DatabaseStorageService
- java.lang.Object
-
- com.eduix.genexp.storage.AbstractStorageService
-
- com.eduix.genexp.storage.database.DatabaseStorageService
-
- All Implemented Interfaces:
StorageService
public class DatabaseStorageService extends AbstractStorageService
-
-
Field Summary
Fields Modifier and Type Field Description private DataSourcedataSourceprivate static StringDELETE_ELEMENT_ORGANISATIONprivate static StringINSERT_ELEMENT_ORGANISATIONprivate static org.slf4j.Loggerlogprivate org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplatenamedParameterJdbcTemplate-
Fields inherited from class com.eduix.genexp.storage.AbstractStorageService
name
-
-
Constructor Summary
Constructors Constructor Description DatabaseStorageService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean_exists(Map<String,Object> params)booleanexists(String id, String type)<T> Tget(String id, String type, Class<T> clazz)Get one element from storage.<T> StorageSearchResult<T>search(StorageQuery query, Class<T> clazz)Query study elements from the storagevoidsetDataSource(DataSource dataSource)voidstore(StorageContext storageContext)Stores a study element.private voidstoreElementOrganisations(String id, String type, Set<String> organisationCodes)-
Methods inherited from class com.eduix.genexp.storage.AbstractStorageService
getName, isApplicable
-
-
-
-
Field Detail
-
log
private static final org.slf4j.Logger log
-
dataSource
private DataSource dataSource
-
namedParameterJdbcTemplate
private org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate namedParameterJdbcTemplate
-
INSERT_ELEMENT_ORGANISATION
private static final String INSERT_ELEMENT_ORGANISATION
- See Also:
- Constant Field Values
-
DELETE_ELEMENT_ORGANISATION
private static final String DELETE_ELEMENT_ORGANISATION
- See Also:
- Constant Field Values
-
-
Method Detail
-
store
@Transactional public void store(StorageContext storageContext)
Description copied from interface:StorageServiceStores a study element.- Parameters:
storageContext- a contect including the study element
-
storeElementOrganisations
private void storeElementOrganisations(String id, String type, Set<String> organisationCodes)
-
exists
public boolean exists(String id, String type)
- Parameters:
id- study element idtype- study element type- Returns:
- true, if the study element defined by type and id exists in the storage
-
get
public <T> T get(String id, String type, Class<T> clazz)
Description copied from interface:StorageServiceGet one element from storage.- Type Parameters:
T- study element or null- Parameters:
id- study element idtype- study element type- Returns:
-
search
public <T> StorageSearchResult<T> search(StorageQuery query, Class<T> clazz)
Description copied from interface:StorageServiceQuery study elements from the storage- Type Parameters:
T- the type used for representing the study elements- Parameters:
query- the query objectclazz- the class used for representing study elements- Returns:
- the result of the query in a result object
-
setDataSource
public void setDataSource(DataSource dataSource)
-
-