Klasse DataWriter
java.lang.Object
ch.nolix.system.sqlmiddata.datawriter.DataWriter
- Alle implementierten Schnittstellen:
Closeable,CloseStateRequestable,GroupCloseable,ChangeRequestable,IChangeSaver,IResettableChangeSaver,Resettable,IDataWriter,AutoCloseable
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidclearMultiReference(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.voidclearMultiValue(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.voiddeleteEntity(String tableName, EntityDeletionDto entity) Deletes the given entity from the database.voiddeleteMultiBackReferenceEntry(MultiBackReferenceEntryDeletionDto multiBackReferenceEntry) Deletes the given multiBackReferenceEntry from the database.voiddeleteMultiReferenceEntry(MultiReferenceEntryDeletionDto multiReferenceEntry) Deletes the given multiReferenceEntry from the database.voiddeleteMultiValueEntry(MultiValueEntryDto multiValueEntry) Deletes the given multiValueEntry from the database.voidexpectSchemaTimestamp(ITime schemaTimestamp) Will cause an error by saving if the database does not have the given schemaTimestamp.voidexpectTableContainsEntity(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.static DataWriterforDatabaseNameAndDatabaseViewAndSqlConnection(String databaseName, DatabaseViewDto databaseView, ISqlConnection sqlConnection) intbooleanvoidinsertEntity(String tableName, EntityCreationDto newEntity) Inserts the given entity into the table with the given tableName on the database.voidinsertMultiBackReferenceEntry(MultiBackReferenceEntryDto multiBackReferenceEntry) Inserts the given multiBackReferenceEntry into the database.voidinsertMultiReferenceEntry(MultiReferenceEntryDto multiReferenceEntry) Inserts the given multiReferenceEntry into the database.voidinsertMultiValueEntry(MultiValueEntryDto multiValueEntry) Inserts the given multiValueEntry into the database.voidLets the currentGroupCloseablenote a close.voidreset()Resets the currentResettable.voidSaves the changes of the currentIChangeSaver.voidupdateEntity(String tableName, EntityUpdateDto entityUpdate) Updates the entity, that belongs to the table with the given tableName, in the database according to the given entityUpdate.Von Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitVon Schnittstelle geerbte Methoden ch.nolix.coreapi.resourcecontrol.savecontrol.ChangeRequestable
isChangeFreeVon Schnittstelle geerbte Methoden ch.nolix.coreapi.resourcecontrol.closecontroller.CloseStateRequestable
isOpenVon Schnittstelle geerbte Methoden ch.nolix.coreapi.resourcecontrol.closecontroller.GroupCloseable
close, createCloseDependencyTo, isClosed
-
Methodendetails
-
forDatabaseNameAndDatabaseViewAndSqlConnection
public static DataWriter forDatabaseNameAndDatabaseViewAndSqlConnection(String databaseName, DatabaseViewDto databaseView, ISqlConnection sqlConnection) -
clearMultiReference
Beschreibung aus Schnittstelle kopiert:IDataWriterDeletes 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:
clearMultiReferencein SchnittstelleIDataWriter- Parameter:
tableName-entityId-multiReferenceColumnName-
-
clearMultiValue
Beschreibung aus Schnittstelle kopiert:IDataWriterDeletes 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:
clearMultiValuein SchnittstelleIDataWriter- Parameter:
tableName-entityId-multiValueColumnName-
-
deleteEntity
Beschreibung aus Schnittstelle kopiert:IDataWriterDeletes 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:
deleteEntityin SchnittstelleIDataWriter- Parameter:
tableName-entity-
-
deleteMultiBackReferenceEntry
public void deleteMultiBackReferenceEntry(MultiBackReferenceEntryDeletionDto multiBackReferenceEntry) Beschreibung aus Schnittstelle kopiert:IDataWriterDeletes the given multiBackReferenceEntry from the database.- Angegeben von:
deleteMultiBackReferenceEntryin SchnittstelleIDataWriter- Parameter:
multiBackReferenceEntry-
-
deleteMultiReferenceEntry
Beschreibung aus Schnittstelle kopiert:IDataWriterDeletes the given multiReferenceEntry from the database.- Angegeben von:
deleteMultiReferenceEntryin SchnittstelleIDataWriter- Parameter:
multiReferenceEntry-
-
deleteMultiValueEntry
Beschreibung aus Schnittstelle kopiert:IDataWriterDeletes the given multiValueEntry from the database.- Angegeben von:
deleteMultiValueEntryin SchnittstelleIDataWriter- Parameter:
multiValueEntry-
-
expectSchemaTimestamp
Beschreibung aus Schnittstelle kopiert:IDataWriterWill 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:
expectSchemaTimestampin SchnittstelleIDataWriter- Parameter:
schemaTimestamp-
-
expectTableContainsEntity
Beschreibung aus Schnittstelle kopiert:IDataWriterWill 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:
expectTableContainsEntityin SchnittstelleIDataWriter- Parameter:
tableName-entityId-
-
getStoredCloseController
- Angegeben von:
getStoredCloseControllerin SchnittstelleGroupCloseable- Gibt zurück:
- the
ICloseControllerof the currentGroupCloseable.
-
getSaveCount
public int getSaveCount()- Angegeben von:
getSaveCountin SchnittstelleIResettableChangeSaver
-
hasChanges
public boolean hasChanges()- Angegeben von:
hasChangesin SchnittstelleChangeRequestable- Gibt zurück:
- true if the current
ChangeRequestablehas uncomitted changes.
-
insertEntity
Beschreibung aus Schnittstelle kopiert:IDataWriterInserts the given entity into the table with the given tableName on the database.- Angegeben von:
insertEntityin SchnittstelleIDataWriter- Parameter:
tableName-newEntity-
-
insertMultiBackReferenceEntry
Beschreibung aus Schnittstelle kopiert:IDataWriterInserts the given multiBackReferenceEntry into the database.- Angegeben von:
insertMultiBackReferenceEntryin SchnittstelleIDataWriter- Parameter:
multiBackReferenceEntry-
-
insertMultiReferenceEntry
Beschreibung aus Schnittstelle kopiert:IDataWriterInserts the given multiReferenceEntry into the database.- Angegeben von:
insertMultiReferenceEntryin SchnittstelleIDataWriter- Parameter:
multiReferenceEntry-
-
insertMultiValueEntry
Beschreibung aus Schnittstelle kopiert:IDataWriterInserts the given multiValueEntry into the database.- Angegeben von:
insertMultiValueEntryin SchnittstelleIDataWriter- Parameter:
multiValueEntry-
-
noteClose
public void noteClose()Beschreibung aus Schnittstelle kopiert:GroupCloseableLets the currentGroupCloseablenote a close.- Angegeben von:
noteClosein SchnittstelleGroupCloseable
-
reset
public void reset()Beschreibung aus Schnittstelle kopiert:ResettableResets the currentResettable.- Angegeben von:
resetin SchnittstelleResettable
-
saveChanges
public void saveChanges()Beschreibung aus Schnittstelle kopiert:IChangeSaverSaves the changes of the currentIChangeSaver.- Angegeben von:
saveChangesin SchnittstelleIChangeSaver
-
updateEntity
Beschreibung aus Schnittstelle kopiert:IDataWriterUpdates the entity, that belongs to the table with the given tableName, in the database according to the given entityUpdate.- Angegeben von:
updateEntityin SchnittstelleIDataWriter- Parameter:
tableName-entityUpdate-
-