Holger's Java API

## com.antelmann.sql
Class GenericPropertyEntryStore<T extends PropertyEntry>

    java.lang.Object
      com.antelmann.sql.JDBCRowStore<T>
          com.antelmann.sql.GenericPropertyEntryStore<T>

All Implemented Interfaces:
  DBClassStore<T>, TransactionRequired, MappingInfo, ProcessorHook<T,DatabaseException>

    public class GenericPropertyEntryStore<T extends PropertyEntry>

extends JDBCRowStore<T>

automatically maps a PropertyEntry class to a database, where some default assumptions have to be met. For details on these assumptions, see the GenericPropertyEntryMapper.

Since:
  17. August 2007, 15:06
Author:
  Holger Antelmann
See Also:
  `GenericPropertyEntryMapper`

Nested Class Summary

Nested classes/interfaces inherited from interface com.antelmann.db.DBClassStore
`DBClassStore.DBMethod`

Field Summary

Fields inherited from class com.antelmann.sql.JDBCRowStore
`database, ensureTransactionsOnFetch, helper, mapper`

Constructor Summary
`GenericPropertyEntryStore(Database<Connection> database, GenericPropertyEntryMapper<T> mapper, Class<T> typeClass)`
`GenericPropertyEntryStore(Database<Connection> db, String table, String idColumn, Class<T> type)`
`GenericPropertyEntryStore(Database<Connection> db, String table, String idColumn, Class<T> type, IDFactory idFactory)`
`GenericPropertyEntryStore(Database<Connection> db, String table, String idColumn, PropertyEntryFactory<T> factory, Class<T> type)`
`GenericPropertyEntryStore(Database<Connection> db, String table, String idColumn, String displayColumn, Class<T> type)`
`GenericPropertyEntryStore(Database<Connection> db, String table, String idColumn, String displayColumn, PropertyEntryFactory<T> factory, Class<T> type)`
`GenericPropertyEntryStore(Database<Connection> db, String table, String idColumn, String displayColumn, PropertyEntryFactory<T> factory, Class<T> type, IDFactory idFactory)`
`GenericPropertyEntryStore(DBClassStore<?> refStore, Class<T> type)` takes table, id column, display column names and table query (if applicable) from the given reference store; additionally, new ids are generated through the given store
`GenericPropertyEntryStore(DBClassStore<?> refStore, PropertyEntryFactory<T> factory, Class<T> type, IDFactory idFactory)` takes table, id column, display column names and table query (if applicable) from the given reference store.

Method Summary
`GenericPropertyEntryMapper<T>` `getMapper()`
`void` `setRestrictedMappedColumns(String... columns)`
`void` `setTableQuery(String query)`
`void` `setTableQuery(String query, String newIdColumn)`

Methods inherited from class com.antelmann.sql.JDBCRowStore

`add, checkTransaction, containsID, deleteEntries, deleteEntry, fetch, fetchStubs, generateNewID, getColumnNames, getColumnsForTopic, getColumnSize, getDatabase, getDisplayColumn, getDisplayNameForColumn, getEntry, getEntryClass, getIDColumn, getMappingForTopic, getSQLTypeforColumn, getStub, getTableName, getTableQuery, insert, insertAsNew, isFastDelete, isIgnoreInvalidProperties, remove, setFastDelete, setIgnoreInvalidProperties, size, trimIdString, update`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### GenericPropertyEntryStore

    public GenericPropertyEntryStore(Database<Connection> db,
                                     String table,
                                     String idColumn,
                                     Class<T> type)
                              throws DatabaseException

Throws:
  `DatabaseException`

### GenericPropertyEntryStore

    public GenericPropertyEntryStore(Database<Connection> db,
                                     String table,
                                     String idColumn,
                                     Class<T> type,
                                     IDFactory idFactory)
                              throws DatabaseException

Throws:
  `DatabaseException`

### GenericPropertyEntryStore

    public GenericPropertyEntryStore(Database<Connection> db,
                                     String table,
                                     String idColumn,
                                     String displayColumn,
                                     Class<T> type)
                              throws DatabaseException

Throws:
  `DatabaseException`

### GenericPropertyEntryStore

    public GenericPropertyEntryStore(Database<Connection> db,
                                     String table,
                                     String idColumn,
                                     PropertyEntryFactory<T> factory,
                                     Class<T> type)
                              throws DatabaseException

Throws:
  `DatabaseException`

### GenericPropertyEntryStore

    public GenericPropertyEntryStore(Database<Connection> db,
                                     String table,
                                     String idColumn,
                                     String displayColumn,
                                     PropertyEntryFactory<T> factory,
                                     Class<T> type)
                              throws DatabaseException

Throws:
  `DatabaseException`

### GenericPropertyEntryStore

    public GenericPropertyEntryStore(Database<Connection> db,
                                     String table,
                                     String idColumn,
                                     String displayColumn,
                                     PropertyEntryFactory<T> factory,
                                     Class<T> type,
                                     IDFactory idFactory)
                              throws DatabaseException

Throws:
  `DatabaseException`

### GenericPropertyEntryStore

    public GenericPropertyEntryStore(Database<Connection> database,
                                     GenericPropertyEntryMapper<T> mapper,
                                     Class<T> typeClass)

### GenericPropertyEntryStore

    public GenericPropertyEntryStore(DBClassStore<?> refStore,
                                     Class<T> type)
                              throws DatabaseException

  takes table, id column, display column names and table query (if applicable) from the given reference store; additionally, new ids are generated through the given store

  Throws:
    `DatabaseException`

### GenericPropertyEntryStore

    public GenericPropertyEntryStore(DBClassStore<?> refStore,
                                     PropertyEntryFactory<T> factory,
                                     Class<T> type,
                                     IDFactory idFactory)
                              throws DatabaseException

  takes table, id column, display column names and table query (if applicable) from the given reference store. If you want to 'copy' additional mapping infos from the given store, consider using a `WrappedDBClassStoreMapping`.

  Parameters:
    `refStore` - must provide the `MappingInfo` interface via the associated database, which also must use a `Connection` as a service
  Throws:
    `DatabaseException`
  See Also:
    `WrappedDBClassStoreMapping`, `DefaultMappingInfo`

Method Detail

### getMapper

    public GenericPropertyEntryMapper<T> getMapper()

  Overrides:
    `getMapper` in class `JDBCRowStore<T extends PropertyEntry>`

### setTableQuery

    public void setTableQuery(String query)
                       throws DatabaseException

  Throws:
    `DatabaseException`

### setTableQuery

    public void setTableQuery(String query,
                              String newIdColumn)
                       throws DatabaseException

  Throws:
    `DatabaseException`

### setRestrictedMappedColumns

    public void setRestrictedMappedColumns(String... columns)
                                    throws DatabaseException

  Throws:
    `DatabaseException`

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