Klasse AbstractDataAdapter

java.lang.Object
ch.nolix.system.middata.adapter.AbstractDataAdapter
Alle implementierten Schnittstellen:
IDatabaseNameHolder, Closeable, CloseStateRequestable, GroupCloseable, ChangeRequestable, IChangeSaver, IResettableChangeSaver, Resettable, IDataAdapter, IDataReader, IDataWriter, AutoCloseable
Bekannte direkte Unterklassen:
AbstractDataAdapterAndSchemaReader, AbstractSqlDataAdapter, NodeDataAdapter

public abstract class AbstractDataAdapter extends Object implements IDataAdapter
  • Konstruktordetails

  • Methodendetails

    • createCloseDependencyTo

      public final void createCloseDependencyTo(GroupCloseable element)
      Beschreibung aus Schnittstelle kopiert: GroupCloseable
      Creates a close dependency between the current GroupCloseable and the given element. When a GroupCloseable is closed, all elements, the current GroupCloseable has a close dependency to, will be closed too and vice versa.
      Angegeben von:
      createCloseDependencyTo in Schnittstelle GroupCloseable
      Parameter:
      element -
    • deleteEntity

      public final void deleteEntity(String tableName, EntityDeletionDto entity)
      Beschreibung aus Schnittstelle kopiert: IDataWriter
      Deletes the given entity from the database. Will cause an error by saving if the given entity was deleted or changed on the database in the meanwhile.
      Angegeben von:
      deleteEntity in Schnittstelle IDataWriter
      Parameter:
      tableName -
      entity -
    • deleteMultiBackReferenceEntry

      public final void deleteMultiBackReferenceEntry(MultiBackReferenceEntryDeletionDto multiBackReferenceEntry)
      Beschreibung aus Schnittstelle kopiert: IDataWriter
      Deletes the given multiBackReferenceEntry from the database.
      Angegeben von:
      deleteMultiBackReferenceEntry in Schnittstelle IDataWriter
      Parameter:
      multiBackReferenceEntry -
    • clearMultiReference

      public final void clearMultiReference(String tableName, String entityId, String multiReferenceColumnName)
      Beschreibung aus Schnittstelle kopiert: IDataWriter
      Deletes the references of the multi reference, that is in the multi reference column with the given multiReferenceColumnName and belongs to the entity, that has the given entityId and belongs to the table with the given tableName, from the database.
      Angegeben von:
      clearMultiReference in Schnittstelle IDataWriter
      Parameter:
      tableName -
      entityId -
      multiReferenceColumnName -
    • deleteMultiReferenceEntry

      public final void deleteMultiReferenceEntry(MultiReferenceEntryDeletionDto multiReferenceEntry)
      Beschreibung aus Schnittstelle kopiert: IDataWriter
      Deletes the given multiReferenceEntry from the database.
      Angegeben von:
      deleteMultiReferenceEntry in Schnittstelle IDataWriter
      Parameter:
      multiReferenceEntry -
    • clearMultiValue

      public final void clearMultiValue(String tableName, String entityId, String multiFieldColumn)
      Beschreibung aus Schnittstelle kopiert: IDataWriter
      Deletes 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 belongs to the table with the given tableName, from the database.
      Angegeben von:
      clearMultiValue in Schnittstelle IDataWriter
      Parameter:
      tableName -
      entityId -
      multiFieldColumn -
    • deleteMultiValueEntry

      public final void deleteMultiValueEntry(MultiValueEntryDto multiValueEntry)
      Beschreibung aus Schnittstelle kopiert: IDataWriter
      Deletes the given multiValueEntry from the database.
      Angegeben von:
      deleteMultiValueEntry in Schnittstelle IDataWriter
      Parameter:
      multiValueEntry -
    • expectSchemaTimestamp

      public final void expectSchemaTimestamp(ITime schemaTimestamp)
      Beschreibung aus Schnittstelle kopiert: IDataWriter
      Will cause an error by saving if the database does not have the given schemaTimestamp. This method can be used to prevent from saving changes when the schemaTimestamp was changed in the meanwhile
      Angegeben von:
      expectSchemaTimestamp in Schnittstelle IDataWriter
      Parameter:
      schemaTimestamp -
    • expectTableContainsEntity

      public final void expectTableContainsEntity(String tableName, String entityId)
      Beschreibung aus Schnittstelle kopiert: IDataWriter
      Will cause an error by saving if on the database the table with the given tableName does not contain an entity with the given entityId. This method can be used to prevent from referencing an entity that was deleted in the meanwhile.
      Angegeben von:
      expectTableContainsEntity in Schnittstelle IDataWriter
      Parameter:
      tableName -
      entityId -
    • getDatabaseName

      public final String getDatabaseName()
      Angegeben von:
      getDatabaseName in Schnittstelle IDatabaseNameHolder
      Gibt zurück:
      the database name of the current IDatabaseNameHolder.
    • getSaveCount

      public final int getSaveCount()
      Angegeben von:
      getSaveCount in Schnittstelle IResettableChangeSaver
    • getSchemaTimestamp

      public final ITime getSchemaTimestamp()
      Angegeben von:
      getSchemaTimestamp in Schnittstelle IDataReader
      Gibt zurück:
      the schema timestamp from the database.
    • getStoredCloseController

      public final ICloseController getStoredCloseController()
      Angegeben von:
      getStoredCloseController in Schnittstelle GroupCloseable
      Gibt zurück:
      the ICloseController of the current GroupCloseable.
    • hasChanges

      public final boolean hasChanges()
      Angegeben von:
      hasChanges in Schnittstelle ChangeRequestable
      Gibt zurück:
      true if the current ChangeRequestable has uncomitted changes.
    • insertMultiBackReferenceEntry

      public final void insertMultiBackReferenceEntry(MultiBackReferenceEntryDto multiBackReferenceEntry)
      Beschreibung aus Schnittstelle kopiert: IDataWriter
      Inserts the given multiBackReferenceEntry into the database.
      Angegeben von:
      insertMultiBackReferenceEntry in Schnittstelle IDataWriter
      Parameter:
      multiBackReferenceEntry -
    • insertMultiReferenceEntry

      public void insertMultiReferenceEntry(MultiReferenceEntryDto multiReferenceEntry)
      Beschreibung aus Schnittstelle kopiert: IDataWriter
      Inserts the given multiReferenceEntry into the database.
      Angegeben von:
      insertMultiReferenceEntry in Schnittstelle IDataWriter
      Parameter:
      multiReferenceEntry -
    • insertMultiValueEntry

      public final void insertMultiValueEntry(MultiValueEntryDto multiValueEntry)
      Beschreibung aus Schnittstelle kopiert: IDataWriter
      Inserts the given multiValueEntry into the database.
      Angegeben von:
      insertMultiValueEntry in Schnittstelle IDataWriter
      Parameter:
      multiValueEntry -
    • insertEntity

      public final void insertEntity(String tableName, EntityCreationDto newEntity)
      Beschreibung aus Schnittstelle kopiert: IDataWriter
      Inserts the given entity into the table with the given tableName on the database.
      Angegeben von:
      insertEntity in Schnittstelle IDataWriter
      Parameter:
      tableName -
      newEntity -
    • loadMultiBackReferenceBackReferencedEntityIds

      public final IContainer<String> loadMultiBackReferenceBackReferencedEntityIds(String tableName, String entityId, String multiBackReferenceColumnName)
      Angegeben von:
      loadMultiBackReferenceBackReferencedEntityIds in Schnittstelle IDataReader
      Parameter:
      tableName -
      entityId -
      multiBackReferenceColumnName -
      Gibt zurück:
      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.
    • loadMultiReferenceEntries

      public final IContainer<MultiReferenceEntryDto> loadMultiReferenceEntries(String tableName, String entityId, String multiReferenceColumnName)
      Angegeben von:
      loadMultiReferenceEntries in Schnittstelle IDataReader
      Parameter:
      tableName -
      entityId -
      multiReferenceColumnName -
      Gibt zurück:
      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 final IContainer<Object> loadMultiValueValues(String tableName, String entityId, String multiFieldColumnName)
      Angegeben von:
      loadMultiValueValues in Schnittstelle IDataReader
      Parameter:
      tableName -
      entityId -
      multiFieldColumnName -
      Gibt zurück:
      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 final IContainer<EntityLoadingDto> loadEntities(String tableName)
      Angegeben von:
      loadEntities in Schnittstelle IDataReader
      Parameter:
      tableName -
      Gibt zurück:
      the entities, that are in the table with the given tableName, from the database.
    • loadEntity

      public final EntityLoadingDto loadEntity(String tableName, String id)
      Angegeben von:
      loadEntity in Schnittstelle IDataReader
      Parameter:
      tableName -
      id -
      Gibt zurück:
      the entity, that is in the table with the given tableName and has the given entityId, from the database.
    • noteClose

      public final void noteClose()
      Beschreibung aus Schnittstelle kopiert: GroupCloseable
      Lets the current GroupCloseable note a close.
      Angegeben von:
      noteClose in Schnittstelle GroupCloseable
    • reset

      public final void reset()
      Beschreibung aus Schnittstelle kopiert: Resettable
      Resets the current Resettable.
      Angegeben von:
      reset in Schnittstelle Resettable
    • saveChanges

      public final void saveChanges()
      Beschreibung aus Schnittstelle kopiert: IChangeSaver
      Saves the changes of the current IChangeSaver.
      Angegeben von:
      saveChanges in Schnittstelle IChangeSaver
    • tableContainsEntityWithValueAtColumn

      public final boolean tableContainsEntityWithValueAtColumn(String tableName, String columnName, String value)
      Angegeben von:
      tableContainsEntityWithValueAtColumn in Schnittstelle IDataReader
      Parameter:
      tableName -
      columnName -
      value -
      Gibt zurück:
      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 final boolean tableContainsEntityWithValueAtColumnIgnoringEntities(String tableName, String columnName, String value, IContainer<String> entitiesToIgnoreIds)
      Angegeben von:
      tableContainsEntityWithValueAtColumnIgnoringEntities in Schnittstelle IDataReader
      Parameter:
      tableName -
      columnName -
      value -
      entitiesToIgnoreIds -
      Gibt zurück:
      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 final boolean tableContainsEntity(String tableName, String entityId)
      Angegeben von:
      tableContainsEntity in Schnittstelle IDataReader
      Parameter:
      tableName -
      entityId -
      Gibt zurück:
      true if the table with the given tableName contains an entity with the given entityId on the database, false otherwise.
    • updateEntity

      public final void updateEntity(String tableName, EntityUpdateDto entityUpdate)
      Beschreibung aus Schnittstelle kopiert: IDataWriter
      Updates the entity, that belongs to the table with the given tableName, in the database according to the given entityUpdate.
      Angegeben von:
      updateEntity in Schnittstelle IDataWriter
      Parameter:
      tableName -
      entityUpdate -