@ThreadSafe public abstract class AbstractDAO extends Object implements IDAO
IDAOIDAO.EMode| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEFAULT_AUTO_SAVE_ENABLED
By default auto-save is enabled
|
protected ReadWriteLock |
m_aRWLock |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractDAO() |
| Modifier and Type | Method and Description |
|---|---|
void |
beginWithoutAutoSave()
Start doing something without auto save.
|
void |
endWithoutAutoSave()
End doing something without auto save.
|
static com.helger.commons.callback.CallbackList<IDAOReadExceptionCallback> |
getExceptionHandlersRead() |
static com.helger.commons.callback.CallbackList<IDAOWriteExceptionCallback> |
getExceptionHandlersWrite() |
boolean |
hasPendingChanges() |
boolean |
internalHasPendingChanges() |
protected boolean |
internalIsAutoSaveEnabled() |
void |
internalSetPendingChanges(boolean bPendingChanges) |
boolean |
isAutoSaveEnabled() |
<RETURNTYPE> |
performWithoutAutoSave(com.helger.commons.callback.INonThrowingCallable<RETURNTYPE> aCallable)
Execute a callback with autosave being disabled.
|
void |
performWithoutAutoSave(com.helger.commons.callback.INonThrowingRunnable aRunnable)
Execute a callback with autosave being disabled.
|
<RETURNTYPE> |
performWithoutAutoSave(com.helger.commons.callback.IThrowingCallable<RETURNTYPE> aCallable)
Execute a callback with autosave being disabled.
|
void |
performWithoutAutoSave(com.helger.commons.callback.IThrowingRunnable aRunnable)
Execute a callback with autosave being disabled.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetInitCount, getLastInitDateTime, getLastReadDateTime, getLastWriteDateTime, getReadCount, getWriteCount, writeToFileOnPendingChangespublic static final boolean DEFAULT_AUTO_SAVE_ENABLED
protected final ReadWriteLock m_aRWLock
@Nonnull @ReturnsMutableObject(reason="design") public static final com.helger.commons.callback.CallbackList<IDAOReadExceptionCallback> getExceptionHandlersRead()
@Nonnull @ReturnsMutableObject(reason="design") public static final com.helger.commons.callback.CallbackList<IDAOWriteExceptionCallback> getExceptionHandlersWrite()
@MustBeLocked(value=READ) protected final boolean internalIsAutoSaveEnabled()
true if auto save is enabled, false
otherwise.public final boolean isAutoSaveEnabled()
isAutoSaveEnabled in interface IAutoSaveAwaretrue if auto save is enabled, false
otherwise.@MustBeLocked(value=WRITE) public final void internalSetPendingChanges(boolean bPendingChanges)
@MustBeLocked(value=READ) public final boolean internalHasPendingChanges()
true if unsaved changes are presentpublic final boolean hasPendingChanges()
hasPendingChanges in interface IChangeabletrue if unsaved changes are presentpublic final void beginWithoutAutoSave()
IAutoSaveAwarebeginWithoutAutoSave in interface IAutoSaveAwarepublic final void endWithoutAutoSave()
IAutoSaveAwareIAutoSaveAware.beginWithoutAutoSave() is always correctly ended with a call to
this method.endWithoutAutoSave in interface IAutoSaveAwarepublic final void performWithoutAutoSave(@Nonnull com.helger.commons.callback.INonThrowingRunnable aRunnable)
performWithoutAutoSave in interface IAutoSaveAwareaRunnable - The callback to be executed@Nullable public final <RETURNTYPE> RETURNTYPE performWithoutAutoSave(@Nonnull com.helger.commons.callback.INonThrowingCallable<RETURNTYPE> aCallable)
performWithoutAutoSave in interface IAutoSaveAwareaCallable - The callback to be executednull.public final void performWithoutAutoSave(@Nonnull com.helger.commons.callback.IThrowingRunnable aRunnable) throws Exception
aRunnable - The callback to be executedException - In case of an error@Nullable public final <RETURNTYPE> RETURNTYPE performWithoutAutoSave(@Nonnull com.helger.commons.callback.IThrowingCallable<RETURNTYPE> aCallable) throws Exception
aCallable - The callback to be executednull.Exception - In case of an errorCopyright © 2014–2015 Philip Helger. All rights reserved.