com.antelmann.sql
Class SQLColumnInfoStore<T extends DBEntry>
java.lang.Object
com.antelmann.db.WrappedDBClassStore<T>
com.antelmann.sql.SQLColumnInfoStore<T>
- All Implemented Interfaces:
- DBClassStore<T>, ProcessedFilterOption<T>, TransactionRequired, SQLColumnInfo, ProcessorHook<T,DatabaseException>, Wrapped<DBClassStore<T>>
public class SQLColumnInfoStore<T extends DBEntry>
- extends WrappedDBClassStore<T>
- implements SQLColumnInfo
an special store providing an implementation for SQLColumnInfo
based on a store that provides MappingInfo
- Since:
- 20.01.2009, 21:22:15
- Author:
- Holger Antelmann
- See Also:
SQLColumnInfo,
MappingInfo,
SQLDatabase.queryStoreForInterface(Class, Class)
|
Method Summary |
boolean |
containsColumnValue(String column,
Object value)
|
int |
countDistinctValues(String column,
Map<String,Object> sqlRestrictions)
|
int |
deleteEntries(Filter<? super T> filter)
deletes all DBEntry objects that match the given filter;
if the filter is null, all resources are deleted. |
Set<?> |
getDistinctValues(String column,
Map<String,Object> sqlRestrictions)
|
Map<?,Integer> |
getDistinctValuesWithCount(Map<String,Object> sqlRestrictions,
String... column)
|
Object |
getFunctionValueForColumn(String column,
SQLFunction func,
Map<String,Object> sqlRestrictions)
|
ObjectRowMapper<T> |
getMapper()
only returns a non-null value if the embedded store is a JDBCRowStore |
int |
getMaxLength(String textColumn,
Map<String,Object> sqlRestrictions)
|
int |
replaceColumnValue(String column,
Object oldValue,
Object newValue,
boolean useQueryIfApplicable)
fires a database update event |
| Methods inherited from class com.antelmann.db.WrappedDBClassStore |
add, checkReadAccess, checkWriteAccess, containsID, deleteEntriesIndividually, deleteEntry, exposesInterfaces, fetch, fetchStubs, generateNewID, getAccessFilter, getAccessStubFilter, getDatabase, getEntry, getEntryClass, getFetchProcessor, getPreStoreHandler, getStoreHandler, getStub, getStubProcessor, insert, insertAsNew, isApplyFilterProcessingRecursively, isDeleteEntriesIndividually, isEnsureTransactionsOnFetch, isProcessBeforeFiltering, queryForInterface, remove, setAccessFilter, setAccessStubFilter, setApplyFilterProcessingRecursively, setDeleteEntriesIndividually, setEnsureTransactionsOnFetch, setExposesInterfaces, setFetchProcessor, setPreStoreHandler, setProcessBeforeFiltering, setProcessBeforeFiltering, setStoreHandler, setStubProcessor, size, unwrap, update, wrapFilterForProcessing |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SQLColumnInfoStore
public SQLColumnInfoStore(DBClassStore<T> store)
getMapper
public ObjectRowMapper<T> getMapper()
- only returns a non-null value if the embedded store is a
JDBCRowStore
containsColumnValue
public boolean containsColumnValue(String column,
Object value)
throws DatabaseException
- Specified by:
containsColumnValue in interface SQLColumnInfo
- Throws:
DatabaseException
countDistinctValues
public int countDistinctValues(String column,
Map<String,Object> sqlRestrictions)
throws DatabaseException
- Specified by:
countDistinctValues in interface SQLColumnInfo
- Throws:
DatabaseException
getDistinctValues
public Set<?> getDistinctValues(String column,
Map<String,Object> sqlRestrictions)
throws DatabaseException
- Specified by:
getDistinctValues in interface SQLColumnInfo
- Throws:
DatabaseException
getDistinctValuesWithCount
public Map<?,Integer> getDistinctValuesWithCount(Map<String,Object> sqlRestrictions,
String... column)
throws DatabaseException
- Specified by:
getDistinctValuesWithCount in interface SQLColumnInfo
- Throws:
DatabaseException
getFunctionValueForColumn
public Object getFunctionValueForColumn(String column,
SQLFunction func,
Map<String,Object> sqlRestrictions)
throws DatabaseException
- Specified by:
getFunctionValueForColumn in interface SQLColumnInfo
- Throws:
DatabaseException
getMaxLength
public int getMaxLength(String textColumn,
Map<String,Object> sqlRestrictions)
throws DatabaseException
- Specified by:
getMaxLength in interface SQLColumnInfo
- Throws:
DatabaseException
replaceColumnValue
public int replaceColumnValue(String column,
Object oldValue,
Object newValue,
boolean useQueryIfApplicable)
throws DatabaseException
- Description copied from interface:
SQLColumnInfo
- fires a database update event
- Specified by:
replaceColumnValue in interface SQLColumnInfo
- Throws:
DatabaseException- See Also:
SQLColumnInfo.UpdateFilter,
DBClassStore.DBMethod.DELETE_MULTIPLE
deleteEntries
public int deleteEntries(Filter<? super T> filter)
throws DatabaseException
- Description copied from interface:
DBClassStore
- deletes all DBEntry objects that match the given filter;
if the filter is null, all resources are deleted.
Calling this method does not necessarily entail that
DBClassStore.deleteEntry(Object)
is called for each entry passing the filter (although stores may choose to do so)!
Consequently, if a store's implementation does not call DBClassStore.deleteEntry(Object)
on each instance, calling this method may result in changes that are hard to monitor
for versioning purposes.
- Specified by:
deleteEntries in interface DBClassStore<T extends DBEntry>- Overrides:
deleteEntries in class WrappedDBClassStore<T extends DBEntry>
- Returns:
- the number of objects that were deleted
- Throws:
DatabaseException- See Also:
WrappedDBClassStore.setProcessBeforeFiltering(boolean)
(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads