public abstract class DBMapping extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static String |
CLASS_PATTERN |
protected static String |
CREATE_SEQUENCE_FORMAT |
protected static String |
CURRENT_VALUE_SEQUENCE_FORMAT |
protected static String |
DBNAME_ATTRIBUTE_PATTERN |
protected static String |
DOT |
protected static org.apache.commons.logging.Log |
log
log
|
protected Map<String,String> |
mappingBeanToDb |
protected static String |
NEXT_VALUE_SEQUENCE_FORMAT |
protected String |
schema |
protected static String |
SCHEMA_FORMAT |
protected static String |
SEQUENCE_ATTRIBUTE_PATTERN |
protected Map<String,Class<? extends TopiaEntity>> |
sequences |
protected static String |
UPDATE_SEQUENCE_FORMAT |
| Constructor and Description |
|---|
DBMapping(String propertyFile,
String path) |
protected static final org.apache.commons.logging.Log log
protected static final String CLASS_PATTERN
protected static final String DBNAME_ATTRIBUTE_PATTERN
protected static final String SEQUENCE_ATTRIBUTE_PATTERN
protected static final String CREATE_SEQUENCE_FORMAT
protected static final String UPDATE_SEQUENCE_FORMAT
protected static final String CURRENT_VALUE_SEQUENCE_FORMAT
protected static final String NEXT_VALUE_SEQUENCE_FORMAT
protected static final String SCHEMA_FORMAT
protected static final String DOT
protected Map<String,Class<? extends TopiaEntity>> sequences
protected String schema
public DBMapping(String propertyFile, String path) throws IOException
IOExceptionprotected abstract Class<? extends TopiaEntity> getContractClass(Class<? extends TopiaEntity> entityClass) throws TopiaException
TopiaExceptionpublic void init(TopiaContext ctxt, boolean doCreate, boolean doUpdate) throws TopiaException
TopiaExceptionpublic void createSequences(TopiaContext ctxt) throws TopiaException
TopiaExceptionpublic void updateSequences(TopiaContext ctxt) throws TopiaException
TopiaExceptionpublic boolean existSequence(String sequenceKey, TopiaContext ctxt) throws TopiaException
TopiaExceptionpublic void createSequence(String sequenceKey, TopiaContext ctxt) throws TopiaException
TopiaExceptionpublic void updateSequence(String sequenceKey, TopiaContext ctxt) throws TopiaException
TopiaExceptionpublic BigInteger getCurrentValueFromSequence(String sequenceKey, TopiaContext ctxt) throws TopiaException
TopiaExceptionpublic BigInteger getNextValueFromSequence(String sequenceKey, TopiaContext ctxt) throws TopiaException
TopiaExceptionpublic boolean existSequence(Class<? extends TopiaEntity> entityClass, String propertyName, TopiaContext ctxt) throws TopiaException
TopiaExceptionpublic void createSequence(Class<? extends TopiaEntity> entityClass, String propertyName, TopiaContext ctxt) throws TopiaException
TopiaExceptionpublic void updateSequence(Class<? extends TopiaEntity> entityClass, String propertyName, TopiaContext ctxt) throws TopiaException
TopiaExceptionpublic BigInteger getCurrentValueFromSequence(Class<? extends TopiaEntity> entityClass, String propertyName, TopiaContext ctxt) throws TopiaException
TopiaExceptionpublic BigInteger getNextValueFromSequence(Class<? extends TopiaEntity> entityClass, String propertyName, TopiaContext ctxt) throws TopiaException
TopiaExceptionpublic boolean existSequence(String sequenceKey, TopiaContext ctxt, boolean check) throws TopiaException
TopiaExceptionpublic void createSequence(String sequenceKey, TopiaContext ctxt, boolean check) throws TopiaException
TopiaExceptionpublic void updateSequence(String sequenceKey, TopiaContext ctxt, boolean check) throws TopiaException
TopiaExceptionpublic BigInteger getCurrentValueFromSequence(String sequenceKey, TopiaContext ctxt, boolean check) throws TopiaException
TopiaExceptionpublic BigInteger getNextValueFromSequence(String sequenceKey, TopiaContext ctxt, boolean check) throws TopiaException
TopiaExceptionprotected String getDBProperty(Class<? extends TopiaEntity> entityClass, String property) throws TopiaException
entityClass - the seek entity classproperty - the name of the property to translateTopiaException - if any db pbprotected String getDBTable(Class<? extends TopiaEntity> entityClass) throws TopiaException
entityClass - the seek entity classTopiaException - if any db pbprotected String getSequenceSQL(String pattern, Class<? extends TopiaEntity> entityClass, String propertyName) throws TopiaException
TopiaExceptionprotected String getSequenceSQL(String pattern, String sequenceKey) throws TopiaException
TopiaExceptionprotected BigInteger getBigInteger(TopiaContext ctxt, String sql, BigInteger defaultSize) throws TopiaException
TopiaExceptionprotected void doSQLWork(TopiaContext ctxt, String sql) throws TopiaException
TopiaExceptionprotected String checkSequence(Class<? extends TopiaEntity> entityClass, String propertyName) throws IllegalArgumentException, TopiaException
protected String checkSequence(String sequenceKey) throws IllegalArgumentException, TopiaException
protected void initMapping(Properties props) throws IOException
IOExceptionprotected void finalize()
throws Throwable
public void close()
Copyright © 2004–2022 Code Lutin. All rights reserved.