Class DataReader
java.lang.Object
ch.nolix.system.nodemiddata.datareader.DataReader
- All Implemented Interfaces:
IDatabaseNameHolder, Closeable, CloseStateRequestable, GroupCloseable, IDataReader, AutoCloseable
- Author:
- Silvan Wyss
-
Method Summary
Modifier and TypeMethodDescriptionstatic DataReaderforNodeDatabaseAndDatabaseView(IMutableNode<?> nodeDatabase, DatabaseViewDto databaseView) intgetEntityCount(String tableName) loadEntities(String tableName) loadEntity(String tableName, String entityId) loadMultiBackReferenceBackReferencedEntityIds(String tableName, String entityId, String multiBackReferenceColumnName) loadMultiBackReferenceEntries(TableIdentification table, String entityId, ColumnIdentification multiBackReferenceColumn) loadMultiReferenceEntries(String tableName, String entityId, String multiReferenceColumnName) loadMultiValueValues(String tableName, String entityId, String multiValueColumnName) voidLets the currentGroupCloseablenote a close.booleantableContainsEntity(String tableName, String entityId) booleantableContainsEntityWithValueAtColumn(String tableName, String columnName, String value) booleantableContainsEntityWithValueAtColumnIgnoringEntities(String tableName, String columnName, String value, IContainer<String> entitiesToIgnoreIds) Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CloseStateRequestable
isOpenMethods inherited from interface GroupCloseable
close, createCloseDependencyTo, isClosedMethods inherited from interface IDatabaseNameHolder
getDatabaseNameInQuotes
-
Method Details
-
forNodeDatabaseAndDatabaseView
public static DataReader forNodeDatabaseAndDatabaseView(IMutableNode<?> nodeDatabase, DatabaseViewDto databaseView) -
getDatabaseName
- Specified by:
getDatabaseNamein interfaceIDatabaseNameHolder- Returns:
- the database name of the current
IDatabaseNameHolder.
-
getEntityCount
- Specified by:
getEntityCountin interfaceIDataReader- Parameters:
tableName-- Returns:
- the number of the entities of the table with the given tableName from the database.
-
getSchemaTimestamp
- Specified by:
getSchemaTimestampin interfaceIDataReader- Returns:
- the schema timestamp from the database.
-
getStoredCloseController
- Specified by:
getStoredCloseControllerin interfaceGroupCloseable- Returns:
- the
ICloseControllerof the currentGroupCloseable.
-
loadMultiBackReferenceBackReferencedEntityIds
public IContainer<String> loadMultiBackReferenceBackReferencedEntityIds(String tableName, String entityId, String multiBackReferenceColumnName) - Specified by:
loadMultiBackReferenceBackReferencedEntityIdsin interfaceIDataReader- Parameters:
tableName-entityId-multiBackReferenceColumnName-- Returns:
- the entity ids of the multi back reference, that is in the multi back reference column with the given multiBackReferenceColumnName and belongs to the entity, that has the given entityId and is in the table with the given tableName, from the database.
-
loadMultiBackReferenceEntries
public IContainer<MultiBackReferenceEntryDto> loadMultiBackReferenceEntries(TableIdentification table, String entityId, ColumnIdentification multiBackReferenceColumn) - Specified by:
loadMultiBackReferenceEntriesin interfaceIDataReader- Parameters:
table-entityId-multiBackReferenceColumn-- Returns:
- the multi back reference entries of the multi back reference that is in the given table and in the entity with the given entityId and in the given multiBackReferenceColumn.
-
loadMultiReferenceEntries
public IContainer<MultiReferenceEntryDto> loadMultiReferenceEntries(String tableName, String entityId, String multiReferenceColumnName) - Specified by:
loadMultiReferenceEntriesin interfaceIDataReader- Parameters:
tableName-entityId-multiReferenceColumnName-- Returns:
- the multi reference entries of the the multi reference field, that is in the multi reference column with the given multiReferenceColumnName and belongs to the entity, that has the given entityId and is in the table with the given tableName, from the database.
-
loadMultiValueValues
public IContainer<Object> loadMultiValueValues(String tableName, String entityId, String multiValueColumnName) - Specified by:
loadMultiValueValuesin interfaceIDataReader- Parameters:
tableName-entityId-multiValueColumnName-- Returns:
- the values of the multi value, that is in the multi value column with the given multiValueColumnName and belongs to the entity, that has the given entityId and is in the table with the given tableName, from the database.
-
loadEntities
- Specified by:
loadEntitiesin interfaceIDataReader- Parameters:
tableName-- Returns:
- the entities, that are in the table with the given tableName, from the database.
-
loadEntity
- Specified by:
loadEntityin interfaceIDataReader- Parameters:
tableName-entityId-- Returns:
- the entity, that is in the table with the given tableName and has the given entityId, from the database.
-
noteClose
public void noteClose()Lets the currentGroupCloseablenote a close.- Specified by:
noteClosein interfaceGroupCloseable
-
tableContainsEntityWithValueAtColumn
public boolean tableContainsEntityWithValueAtColumn(String tableName, String columnName, String value) - Specified by:
tableContainsEntityWithValueAtColumnin interfaceIDataReader- Parameters:
tableName-columnName-value-- Returns:
- true if the table with the given tableName contains in the column with the given columnName the given value on the database, false otherwise.
-
tableContainsEntityWithValueAtColumnIgnoringEntities
public boolean tableContainsEntityWithValueAtColumnIgnoringEntities(String tableName, String columnName, String value, IContainer<String> entitiesToIgnoreIds) - Specified by:
tableContainsEntityWithValueAtColumnIgnoringEntitiesin interfaceIDataReader- Parameters:
tableName-columnName-value-entitiesToIgnoreIds-- Returns:
- true if the table with the given tableName contains in the column with the given columnName the given value ignoring the entities with the given entitiesToIgnoreIds on the database, false otherwise.
-
tableContainsEntity
- Specified by:
tableContainsEntityin interfaceIDataReader- Parameters:
tableName-entityId-- Returns:
- true if the table with the given tableName contains an entity with the given entityId on the database, false otherwise.
-