Class RecordToDBMapping
java.lang.Object
org.gcube.accounting.utility.postgresql.RecordToDBMapping
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Map<String,RecordToDBFields> protected final Map<String,RecordToDBConnection> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRecordToDB(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?, ?>> clz, org.gcube.documentstore.persistence.PersistenceBackendConfiguration configuration) voidCreates what is missing of the schema in every database the records are written to: one, unless the configuration gives a record type a database of its own.getRecordDBInfo(Class<? extends org.gcube.documentstore.records.Record> clz) static RecordToDBFieldsgetRecordToDBFields(Class<? extends org.gcube.documentstore.records.Record> clz) static StringgetRecordTypeByClass(Class<? extends org.gcube.documentstore.records.Record> clz)
-
Field Details
-
classToRecordToDBMapper
-
recordToDBInfo
-
-
Constructor Details
-
RecordToDBMapping
public RecordToDBMapping()
-
-
Method Details
-
getRecordTypeByClass
-
addRecordToDB
public void addRecordToDB(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?, ?>> clz, org.gcube.documentstore.persistence.PersistenceBackendConfiguration configuration) throws Exception- Throws:
Exception
-
getRecordToDBFields
public static RecordToDBFields getRecordToDBFields(Class<? extends org.gcube.documentstore.records.Record> clz) throws Exception - Throws:
Exception
-
createSchema
Creates what is missing of the schema in every database the records are written to: one, unless the configuration gives a record type a database of its own.- Throws:
Exception- if a database cannot be reached or refuses the schema
-
getRecordDBInfo
public RecordToDBConnection getRecordDBInfo(Class<? extends org.gcube.documentstore.records.Record> clz) throws Exception - Throws:
Exception
-