Holger's
Java API

com.antelmann.sql
Class UnionSqlStore<T extends DBEntry>

java.lang.Object
  extended by com.antelmann.db.WrappedDBClassStore<T>
      extended by com.antelmann.sql.WrappedDBClassStoreMapping<T>
          extended by com.antelmann.sql.UnionSqlStore<T>
All Implemented Interfaces:
DBClassStore<T>, ProcessedFilterOption<T>, TransactionRequired, MappingInfo, ProcessorHook<T,DatabaseException>, Wrapped<DBClassStore<T>>

public class UnionSqlStore<T extends DBEntry>
extends WrappedDBClassStoreMapping<T>

implements a read-only store that is based on a union-sql-query derived from the common columns of a number of given stores. All given stores must provide the MappingInfo interface via the database. Furthermore, it must be certain that the IDs are unique across all given stores. The first given store serves as the basis for the mapping info in regards to display values and topics.

Since:
08.11.2011, 18:35:01
Author:
Holger Antelmann

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.antelmann.db.DBClassStore
DBClassStore.DBMethod
 
Field Summary
 
Fields inherited from class com.antelmann.sql.WrappedDBClassStoreMapping
mi
 
Fields inherited from class com.antelmann.db.WrappedDBClassStore
store
 
Constructor Summary
UnionSqlStore(Class<T> type, Collection<Object> topics, DBClassStore<?>... stores)
           
UnionSqlStore(Class<T> type, DBClassStore<?>... stores)
           
 
Method Summary
 
Methods inherited from class com.antelmann.sql.WrappedDBClassStoreMapping
addColumnsForTopic, addTopicMapping, getColumnDisplayMapping, getColumnNames, getColumnsForTopic, getColumnSize, getDisplayColumn, getDisplayNameForColumn, getIDColumn, getMappingForTopic, getSQLTypeforColumn, getSupportedTopicColumns, getTableName, getTableQuery, removeColumnTopics, removeTopicMapping, setColumnsForTopic
 
Methods inherited from class com.antelmann.db.WrappedDBClassStore
add, checkReadAccess, checkWriteAccess, containsID, deleteEntries, 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
 

Constructor Detail

UnionSqlStore

public UnionSqlStore(Class<T> type,
                     DBClassStore<?>... stores)
              throws DatabaseException,
                     IllegalArgumentException
Throws:
DatabaseException
IllegalArgumentException

UnionSqlStore

public UnionSqlStore(Class<T> type,
                     Collection<Object> topics,
                     DBClassStore<?>... stores)
              throws DatabaseException,
                     IllegalArgumentException
Parameters:
type - the DBEntry type of this store; this must be a super class of all given stores
topics - if topics is non-null, it must contain at least some topics that are defined in all given stores, as these are the only columns that will be available in the resulting mapper
stores - a list of existing DBClassStores that are to be merged into this one; the first store is the basis for the MappingInfo of this store and all stores' DBEntry-classes must inherit from the given type
Throws:
DatabaseException
IllegalArgumentException


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads