net.anotheria.db.service
Class GenericPersistenceService

java.lang.Object
  extended by net.anotheria.db.service.BasePersistenceServiceJDBCImpl
      extended by net.anotheria.db.service.GenericPersistenceService

public abstract class GenericPersistenceService
extends BasePersistenceServiceJDBCImpl

Generic persistence service with additional functional.

Author:
Alexandr Bolbat

Field Summary
static String DMD_F_TABLE_NAME
          Database meta data field name for table name field in result set from getTables(...) method.
 
Fields inherited from class net.anotheria.db.service.BasePersistenceServiceJDBCImpl
log
 
Constructor Summary
GenericPersistenceService()
          Default constructor.
GenericPersistenceService(String configFile)
          Public constructor.
 
Method Summary
protected abstract  List<String> getDDL()
          Get DDL queries for creating persistence structure.
protected  long getNextId()
          Reserve and get next id.
protected abstract  String getPKFieldName()
          Get persistence service primary key field name.
protected abstract  String getTableName()
          Get persistence service table name.
protected  void initialize()
          Initialize generic persistence service functional.
protected  void initializeId()
          Initialize id.
 
Methods inherited from class net.anotheria.db.service.BasePersistenceServiceJDBCImpl
close, close, close, getConnection, init, release, release, release
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DMD_F_TABLE_NAME

public static final String DMD_F_TABLE_NAME
Database meta data field name for table name field in result set from getTables(...) method.

See Also:
Constant Field Values
Constructor Detail

GenericPersistenceService

public GenericPersistenceService()
Default constructor.


GenericPersistenceService

public GenericPersistenceService(String configFile)
Public constructor.

Parameters:
configFile - - JDBC configuration file name
Method Detail

initialize

protected void initialize()
Initialize generic persistence service functional.


getDDL

protected abstract List<String> getDDL()
Get DDL queries for creating persistence structure.

Returns:
List of String

initializeId

protected void initializeId()
Initialize id.


getTableName

protected abstract String getTableName()
Get persistence service table name. If method return null DDL will be not executed.

Returns:
String

getPKFieldName

protected abstract String getPKFieldName()
Get persistence service primary key field name. If method return null id will be initialized with 0 value.

Returns:
String

getNextId

protected long getNextId()
Reserve and get next id.

Returns:
Long next id


Copyright © 2010-2013 anotheria.net. All Rights Reserved.