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
IOException
protected abstract Class<? extends TopiaEntity> getContractClass(Class<? extends TopiaEntity> entityClass) throws TopiaException
TopiaException
public void init(TopiaContext ctxt, boolean doCreate, boolean doUpdate) throws TopiaException
TopiaException
public void createSequences(TopiaContext ctxt) throws TopiaException
TopiaException
public void updateSequences(TopiaContext ctxt) throws TopiaException
TopiaException
public boolean existSequence(String sequenceKey, TopiaContext ctxt) throws TopiaException
TopiaException
public void createSequence(String sequenceKey, TopiaContext ctxt) throws TopiaException
TopiaException
public void updateSequence(String sequenceKey, TopiaContext ctxt) throws TopiaException
TopiaException
public BigInteger getCurrentValueFromSequence(String sequenceKey, TopiaContext ctxt) throws TopiaException
TopiaException
public BigInteger getNextValueFromSequence(String sequenceKey, TopiaContext ctxt) throws TopiaException
TopiaException
public boolean existSequence(Class<? extends TopiaEntity> entityClass, String propertyName, TopiaContext ctxt) throws TopiaException
TopiaException
public void createSequence(Class<? extends TopiaEntity> entityClass, String propertyName, TopiaContext ctxt) throws TopiaException
TopiaException
public void updateSequence(Class<? extends TopiaEntity> entityClass, String propertyName, TopiaContext ctxt) throws TopiaException
TopiaException
public BigInteger getCurrentValueFromSequence(Class<? extends TopiaEntity> entityClass, String propertyName, TopiaContext ctxt) throws TopiaException
TopiaException
public BigInteger getNextValueFromSequence(Class<? extends TopiaEntity> entityClass, String propertyName, TopiaContext ctxt) throws TopiaException
TopiaException
public boolean existSequence(String sequenceKey, TopiaContext ctxt, boolean check) throws TopiaException
TopiaException
public void createSequence(String sequenceKey, TopiaContext ctxt, boolean check) throws TopiaException
TopiaException
public void updateSequence(String sequenceKey, TopiaContext ctxt, boolean check) throws TopiaException
TopiaException
public BigInteger getCurrentValueFromSequence(String sequenceKey, TopiaContext ctxt, boolean check) throws TopiaException
TopiaException
public BigInteger getNextValueFromSequence(String sequenceKey, TopiaContext ctxt, boolean check) throws TopiaException
TopiaException
protected 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
TopiaException
protected String getSequenceSQL(String pattern, String sequenceKey) throws TopiaException
TopiaException
protected BigInteger getBigInteger(TopiaContext ctxt, String sql, BigInteger defaultSize) throws TopiaException
TopiaException
protected void doSQLWork(TopiaContext ctxt, String sql) throws TopiaException
TopiaException
protected 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
IOException
protected void finalize() throws Throwable
public void close()
Copyright © 2004–2022 Code Lutin. All rights reserved.