Klasse DataWriter

java.lang.Object
ch.nolix.system.nodemiddata.datawriter.DataWriter
Alle implementierten Schnittstellen:
Closeable, CloseStateRequestable, GroupCloseable, ChangeRequestable, IChangeSaver, IResettableChangeSaver, Resettable, IDataWriter, AutoCloseable

public final class DataWriter extends Object implements IDataWriter
Autor:
Silvan Wyss
  • Felddetails

    • INITIAL_ENTITY_SAVE_STAMP

      public static final int INITIAL_ENTITY_SAVE_STAMP
      Siehe auch:
  • Methodendetails

    • forNodeDatabaseAndDatabaseView

      public static DataWriter forNodeDatabaseAndDatabaseView(IMutableNode<?> nodeDatabase, DatabaseViewDto databaseView)
    • clearMultiReference

      public void clearMultiReference(String tableName, String entityId, String multiReferenceColumnName)
      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 -
    • clearMultiValue

      public void clearMultiValue(String tableName, String entityId, String multiValueColumnName)
      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 -
      multiValueColumnName -
    • deleteEntity

      public void deleteEntity(String tableName, EntityDeletionDto entity)
      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 void deleteMultiBackReferenceEntry(MultiBackReferenceEntryDeletionDto multiBackReferenceEntry)
      Deletes the given multiBackReferenceEntry from the database.
      Angegeben von:
      deleteMultiBackReferenceEntry in Schnittstelle IDataWriter
      Parameter:
      multiBackReferenceEntry -
    • deleteMultiReferenceEntry

      public void deleteMultiReferenceEntry(MultiReferenceEntryDeletionDto multiReferenceEntry)
      Deletes the given multiReferenceEntry from the database.
      Angegeben von:
      deleteMultiReferenceEntry in Schnittstelle IDataWriter
      Parameter:
      multiReferenceEntry -
    • deleteMultiValueEntry

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

      public void expectSchemaTimestamp(ITime schemaTimestamp)
      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 void expectTableContainsEntity(String tableName, String entityId)
      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 -
    • getSaveCount

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

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

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

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

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

      public void insertMultiValueEntry(MultiValueEntryDto multiValueEntry)
      Inserts the given multiValueEntry into the database.
      Angegeben von:
      insertMultiValueEntry in Schnittstelle IDataWriter
      Parameter:
      multiValueEntry -
    • getStoredCloseController

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

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

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

      public void saveChanges()
      Saves the changes of the current IChangeSaver.
      Angegeben von:
      saveChanges in Schnittstelle IChangeSaver
    • updateEntity

      public void updateEntity(String tableName, EntityUpdateDto entityUpdate)
      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 -