Class DataReader

java.lang.Object
ch.nolix.system.nodemiddata.datareader.DataReader
All Implemented Interfaces:
IDatabaseNameHolder, Closeable, CloseStateRequestable, GroupCloseable, IDataReader, AutoCloseable

public final class DataReader extends Object implements IDataReader
Author:
Silvan Wyss
  • Method Details

    • forNodeDatabaseAndDatabaseView

      public static DataReader forNodeDatabaseAndDatabaseView(IMutableNode<?> nodeDatabase, DatabaseViewDto databaseView)
    • getDatabaseName

      public String getDatabaseName()
      Specified by:
      getDatabaseName in interface IDatabaseNameHolder
      Returns:
      the database name of the current IDatabaseNameHolder.
    • getEntityCount

      public int getEntityCount(String tableName)
      Specified by:
      getEntityCount in interface IDataReader
      Parameters:
      tableName -
      Returns:
      the number of the entities of the table with the given tableName from the database.
    • getSchemaTimestamp

      public ITime getSchemaTimestamp()
      Specified by:
      getSchemaTimestamp in interface IDataReader
      Returns:
      the schema timestamp from the database.
    • getStoredCloseController

      public ICloseController getStoredCloseController()
      Specified by:
      getStoredCloseController in interface GroupCloseable
      Returns:
      the ICloseController of the current GroupCloseable.
    • loadMultiBackReferenceBackReferencedEntityIds

      public IContainer<String> loadMultiBackReferenceBackReferencedEntityIds(String tableName, String entityId, String multiBackReferenceColumnName)
      Specified by:
      loadMultiBackReferenceBackReferencedEntityIds in interface IDataReader
      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:
      loadMultiBackReferenceEntries in interface IDataReader
      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:
      loadMultiReferenceEntries in interface IDataReader
      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:
      loadMultiValueValues in interface IDataReader
      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

      public IContainer<EntityLoadingDto> loadEntities(String tableName)
      Specified by:
      loadEntities in interface IDataReader
      Parameters:
      tableName -
      Returns:
      the entities, that are in the table with the given tableName, from the database.
    • loadEntity

      public EntityLoadingDto loadEntity(String tableName, String entityId)
      Specified by:
      loadEntity in interface IDataReader
      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 current GroupCloseable note a close.
      Specified by:
      noteClose in interface GroupCloseable
    • tableContainsEntityWithValueAtColumn

      public boolean tableContainsEntityWithValueAtColumn(String tableName, String columnName, String value)
      Specified by:
      tableContainsEntityWithValueAtColumn in interface IDataReader
      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:
      tableContainsEntityWithValueAtColumnIgnoringEntities in interface IDataReader
      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

      public boolean tableContainsEntity(String tableName, String entityId)
      Specified by:
      tableContainsEntity in interface IDataReader
      Parameters:
      tableName -
      entityId -
      Returns:
      true if the table with the given tableName contains an entity with the given entityId on the database, false otherwise.