Package com.helger.dao
Interface IDAO
- All Superinterfaces:
IAutoSaveAware
- All Known Implementing Classes:
AbstractDAO,AbstractMapBasedWALDAO,AbstractSimpleDAO,AbstractWALDAO
Base DAO interface. DAO = Data Access Object. A DAO implementation usually
has 3 basic operations:
- Initialization - when no file exists and an initial setup can be performed.
- Reading - read existing data from a file
- Write - write modified data to a file
- Author:
- Philip Helger
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionintintintbooleandefault booleandefault voidreload()The method that is invoke if a DAO is reloaded.voidThis method is called to persist the content in disk in case there are pending changes.Methods inherited from interface com.helger.dao.IAutoSaveAware
beginWithoutAutoSave, endWithoutAutoSave, isAutoSaveEnabled, performWithoutAutoSave, performWithoutAutoSave, performWithoutAutoSaveThrowing, performWithoutAutoSaveThrowing
-
Method Details
-
hasPendingChanges
boolean hasPendingChanges()- Returns:
trueif there are pending changes,falseif the content is unchanged.
-
writeToFileOnPendingChanges
void writeToFileOnPendingChanges()This method is called to persist the content in disk in case there are pending changes. If no pending changes are present, nothing happens. In case the implementation is thread-safe, this method must be thread-safe! -
getInitCount
- Returns:
- The number of times this DAO was initialized. Always ≥ 0. Usually this field is not persistent and only is valid until the application ends.
-
getLastInitDateTime
- Returns:
- The last time this DAO was initialized (without error). May be
nullif it wasn't read before. Usually this field is not persistent and only is valid until the application ends.
-
getReadCount
- Returns:
- The number of times this DAO was initialized. Always ≥ 0. Usually this field is not persistent and only is valid until the application ends.
-
getLastReadDateTime
- Returns:
- The last time this DAO was read (without error). May be
nullif it wasn't read before. Usually this field is not persistent and only is valid until the application ends.
-
getWriteCount
- Returns:
- The number of times this DAO was initialized. Always ≥ 0. Usually this field is not persistent and only is valid until the application ends.
-
getLastWriteDateTime
- Returns:
- The last time this DAO was written (without error). May be
nullif it wasn't written before. Usually this field is not persistent and only is valid until the application ends.
-
isReloadable
default boolean isReloadable()- Returns:
trueif this DAO support re-loading,falseotherwise.- See Also:
-
reload
The method that is invoke if a DAO is reloaded. This method is only triggered if this DAO indicates that it is reloadable viaisReloadable().- Throws:
DAOException- In case reloading fails
-