Removed static usage
This commit is contained in:
parent
2ffffd1515
commit
bea1660252
|
@ -28,3 +28,4 @@ hs_err_pid*
|
|||
/.project
|
||||
/.settings
|
||||
|
||||
/.DS_Store
|
||||
|
|
|
@ -2,6 +2,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|||
|
||||
# Changelog for Document Store Backend Connector Library for PostgreSQL
|
||||
|
||||
## [v1.0.1-SNAPSHOT]
|
||||
|
||||
- Enhanced accounting-postgresql-utilities range
|
||||
|
||||
|
||||
## [v1.0.0]
|
||||
|
||||
|
|
4
pom.xml
4
pom.xml
|
@ -10,7 +10,7 @@
|
|||
|
||||
<groupId>org.gcube.data.publishing</groupId>
|
||||
<artifactId>document-store-lib-postgresql</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<version>1.0.1-SNAPSHOT</version>
|
||||
<name>Document Store Backend Connector Library for PostgreSQL</name>
|
||||
<description>Document Store Backend Connector Library for PostgreSQL</description>
|
||||
|
||||
|
@ -51,7 +51,7 @@
|
|||
<dependency>
|
||||
<groupId>org.gcube.accounting</groupId>
|
||||
<artifactId>accounting-postgresql-utilities</artifactId>
|
||||
<version>[1.0.0, 2.0.0-SNAPSHOT)</version>
|
||||
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.postgresql/postgresql -->
|
||||
<dependency>
|
||||
|
|
|
@ -24,14 +24,16 @@ public class StatementMap {
|
|||
};
|
||||
|
||||
private PersistenceBackendConfiguration configuration;
|
||||
private RecordToDBMapping recordToDBMapping;
|
||||
|
||||
public StatementMap(PersistenceBackendConfiguration configuration) {
|
||||
this.configuration = configuration;
|
||||
this.recordToDBMapping = new RecordToDBMapping();
|
||||
Map<String, Class<? extends AggregatedRecord<?,?>>> aggregatedRecords = RecordUtility.getAggregatedRecordClassesFound();
|
||||
for(String typeName : aggregatedRecords.keySet()) {
|
||||
try {
|
||||
Class<? extends AggregatedRecord<?,?>> clz = aggregatedRecords.get(typeName);
|
||||
RecordToDBMapping.addRecordToDB(clz, configuration);
|
||||
recordToDBMapping.addRecordToDB(clz, configuration);
|
||||
} catch (Exception e) {
|
||||
new RuntimeException(e);
|
||||
}
|
||||
|
@ -39,10 +41,10 @@ public class StatementMap {
|
|||
}
|
||||
|
||||
protected Connection getConnection(Class<? extends AggregatedRecord<?, ?>> clz) throws Exception {
|
||||
RecordToDBConnection recordDBInfo = RecordToDBMapping.getRecordDBInfo(clz);
|
||||
RecordToDBConnection recordDBInfo = recordToDBMapping.getRecordDBInfo(clz);
|
||||
if(recordDBInfo == null) {
|
||||
RecordToDBMapping.addRecordToDB(clz, configuration);
|
||||
recordDBInfo = RecordToDBMapping.getRecordDBInfo(clz);
|
||||
recordToDBMapping.addRecordToDB(clz, configuration);
|
||||
recordDBInfo = recordToDBMapping.getRecordDBInfo(clz);
|
||||
}
|
||||
return recordDBInfo.getConnection();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue