|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.ejb.plugins.cmp.jdbc.SQLUtil
SQLUtil helps with building sql statements.
Nested Class Summary | |
static class |
SQLUtil.OldColumns
utility class to store the information returned by getOldColumns() |
static class |
SQLUtil.OldIndexes
utility class to store the information returned by getOldColumns() |
Constructor Summary | |
SQLUtil()
|
Method Summary | |
static void |
addToRwords(String word)
|
static StringBuffer |
appendColumnNamesClause(JDBCAbstractEntityBridge entity,
String eagerLoadGroup,
StringBuffer sb)
Returns ', columnName0 [, columnName1 [AND columnName2 [...]]]' |
static StringBuffer |
appendColumnNamesClause(JDBCAbstractEntityBridge entity,
String eagerLoadGroup,
String alias,
StringBuffer sb)
Returns ', columnName0 [, columnName1 [AND columnName2 [...]]]' |
static StringBuffer |
appendColumnNamesClause(JDBCFieldBridge[] fields,
boolean[] mask,
String identifier,
StringBuffer buf)
Returns ', columnName0 [, columnName1 [AND columnName2 [...]]]' |
static StringBuffer |
appendColumnNamesClause(JDBCFieldBridge[] fields,
String identifier,
StringBuffer buf)
Returns ', columnName0 [, columnName1 [AND columnName2 [...]]]' |
static void |
dropTable(DataSource dataSource,
String tableName)
|
static String |
fixConstraintName(String name,
DataSource dataSource)
|
static String |
fixTableName(String tableName,
DataSource dataSource)
|
static StringBuffer |
getColumnNamesClause(JDBCEntityBridge.FieldIterator loadIter,
StringBuffer sb)
Returns columnName0 [, columnName1 [AND columnName2 [...]]] |
static StringBuffer |
getColumnNamesClause(JDBCFieldBridge[] fields,
StringBuffer sb)
Returns columnName0 [, columnName1 [AND columnName2 [...]]] |
static StringBuffer |
getColumnNamesClause(JDBCFieldBridge[] fields,
String identifier,
StringBuffer buf)
Returns columnName0 [, columnName1 [AND columnName2 [...]]] |
static StringBuffer |
getColumnNamesClause(JDBCFieldBridge field,
StringBuffer sb)
Returns columnName0 [, columnName1 [, columnName2 [...]]] |
static StringBuffer |
getColumnNamesClause(JDBCFieldBridge field,
String identifier,
StringBuffer sb)
Returns identifier.columnName0 [, identifier.columnName1 [, identifier.columnName2 [...]]] |
static String |
getCreateTableColumnsClause(JDBCFieldBridge[] fields)
|
static String |
getCreateTableColumnsClause(JDBCType type)
Returns columnName0 sqlType0 [, columnName1 sqlType0 [, columnName2 sqlType0 [...]]] |
static StringBuffer |
getIsNullClause(boolean not,
JDBCFieldBridge[] fields,
String identifier,
StringBuffer buf)
Returns identifier.columnName0 IS [NOT] NULL [AND identifier.columnName1 IS [NOT] NULL [AND identifier.columnName2 IS [NOT] NULL [...]]] |
static StringBuffer |
getIsNullClause(boolean not,
JDBCFieldBridge field,
String identifier,
StringBuffer buf)
Returns identifier.columnName0 IS [NOT] NULL [AND identifier.columnName1 IS [NOT] NULL [AND identifier.columnName2 IS [NOT] NULL [...]]] |
static StringBuffer |
getJoinClause(JDBCAbstractCMRFieldBridge cmrField,
String parentAlias,
String childAlias,
StringBuffer buf)
|
static StringBuffer |
getJoinClause(JDBCFieldBridge[] pkFields,
String parent,
JDBCFieldBridge[] fkFields,
String child,
StringBuffer buf)
|
static SQLUtil.OldColumns |
getOldColumns(String tableName,
DataSource dataSource)
|
static SQLUtil.OldIndexes |
getOldIndexes(String tableName,
DataSource dataSource)
|
static StringBuffer |
getRelationTableJoinClause(JDBCAbstractCMRFieldBridge cmrField,
String parentAlias,
String relationTableAlias,
StringBuffer buf)
|
static String |
getSchema(String tableName)
|
static StringBuffer |
getSelfCompareWhereClause(JDBCFieldBridge[] fields,
String fromIdentifier,
String toIdentifier,
StringBuffer buf)
|
static StringBuffer |
getSelfCompareWhereClause(JDBCFieldBridge fromField,
JDBCFieldBridge toField,
String fromIdentifier,
String toIdentifier,
StringBuffer buf)
|
static StringBuffer |
getSetClause(JDBCEntityBridge.FieldIterator fieldsIter,
StringBuffer buf)
Returns columnName0=? [, columnName1=? [, columnName2=? [...]]] |
static String |
getTableNameWithoutSchema(String tableName)
|
static StringBuffer |
getValuesClause(JDBCFieldBridge[] fields,
StringBuffer buf)
Returns ? [, ? [, ? [...]]] |
static StringBuffer |
getWhereClause(JDBCFieldBridge[] fields,
long mask,
StringBuffer buf)
Returns columnName0=? [AND columnName1=? [AND columnName2=? [...]]] |
static StringBuffer |
getWhereClause(JDBCFieldBridge[] fields,
StringBuffer buf)
Returns columnName0=? [AND columnName1=? [AND columnName2=? [...]]] |
static StringBuffer |
getWhereClause(JDBCFieldBridge[] fields,
String identifier,
StringBuffer buf)
Returns identifier.columnName0=? [AND identifier.columnName1=? [AND identifier.columnName2=? [...]]] |
static StringBuffer |
getWhereClause(JDBCFieldBridge field,
StringBuffer buf)
Returns columnName0=? [AND columnName1=? [AND columnName2=? [...]]] |
static StringBuffer |
getWhereClause(JDBCType type,
String identifier,
StringBuffer buf)
Returns identifier.columnName0=? [AND identifier.columnName1=? [AND identifier.columnName2=? [...]]] |
static boolean |
tableExists(String tableName,
DataSource dataSource)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String EMPTY_STRING
public static final String INSERT_INTO
public static final String VALUES
public static final String SELECT
public static final String DISTINCT
public static final String FROM
public static final String WHERE
public static final String ORDERBY
public static final String DELETE_FROM
public static final String AND
public static final String OR
public static final String NOT
public static final String EXISTS
public static final String COMMA
public static final String LEFT_JOIN
public static final String LEFT_OUTER_JOIN
public static final String ON
public static final String NOT_EQUAL
public static final String CREATE_TABLE
public static final String DROP_TABLE
public static final String CREATE_INDEX
public static final String NULL
public static final String IS
public static final String IN
public static final String EMPTY
public static final String BETWEEN
public static final String LIKE
public static final String MEMBER_OF
public static final String ESCAPE
public static final String CONCAT
public static final String SUBSTRING
public static final String LCASE
public static final String UCASE
public static final String LENGTH
public static final String LOCATE
public static final String ABS
public static final String MOD
public static final String SQRT
public static final String COUNT
public static final String MAX
public static final String MIN
public static final String AVG
public static final String SUM
public static final String ASC
public static final String DESC
public static final String OFFSET
public static final String LIMIT
public static final String UPDATE
public static final String SET
public static final String TYPE
Constructor Detail |
public SQLUtil()
Method Detail |
public static String getTableNameWithoutSchema(String tableName)
public static String getSchema(String tableName)
public static String fixTableName(String tableName, DataSource dataSource) throws org.jboss.deployment.DeploymentException
org.jboss.deployment.DeploymentException
public static void addToRwords(String word)
public static String fixConstraintName(String name, DataSource dataSource) throws org.jboss.deployment.DeploymentException
org.jboss.deployment.DeploymentException
public static String getCreateTableColumnsClause(JDBCFieldBridge[] fields)
public static String getCreateTableColumnsClause(JDBCType type)
public static StringBuffer getColumnNamesClause(JDBCFieldBridge[] fields, StringBuffer sb)
public static StringBuffer getColumnNamesClause(JDBCFieldBridge[] fields, String identifier, StringBuffer buf)
public static StringBuffer getColumnNamesClause(JDBCEntityBridge.FieldIterator loadIter, StringBuffer sb)
public static StringBuffer getColumnNamesClause(JDBCFieldBridge field, StringBuffer sb)
public static StringBuffer getColumnNamesClause(JDBCFieldBridge field, String identifier, StringBuffer sb)
public static StringBuffer appendColumnNamesClause(JDBCAbstractEntityBridge entity, String eagerLoadGroup, StringBuffer sb)
public static StringBuffer appendColumnNamesClause(JDBCAbstractEntityBridge entity, String eagerLoadGroup, String alias, StringBuffer sb)
public static StringBuffer appendColumnNamesClause(JDBCFieldBridge[] fields, boolean[] mask, String identifier, StringBuffer buf)
public static StringBuffer appendColumnNamesClause(JDBCFieldBridge[] fields, String identifier, StringBuffer buf)
public static StringBuffer getSetClause(JDBCEntityBridge.FieldIterator fieldsIter, StringBuffer buf)
public static StringBuffer getValuesClause(JDBCFieldBridge[] fields, StringBuffer buf)
public static StringBuffer getWhereClause(JDBCFieldBridge[] fields, StringBuffer buf)
public static StringBuffer getWhereClause(JDBCFieldBridge[] fields, String identifier, StringBuffer buf)
public static StringBuffer getWhereClause(JDBCFieldBridge[] fields, long mask, StringBuffer buf)
public static StringBuffer getWhereClause(JDBCFieldBridge field, StringBuffer buf)
public static StringBuffer getWhereClause(JDBCType type, String identifier, StringBuffer buf)
public static StringBuffer getIsNullClause(boolean not, JDBCFieldBridge[] fields, String identifier, StringBuffer buf)
public static StringBuffer getIsNullClause(boolean not, JDBCFieldBridge field, String identifier, StringBuffer buf)
public static StringBuffer getJoinClause(JDBCAbstractCMRFieldBridge cmrField, String parentAlias, String childAlias, StringBuffer buf)
public static StringBuffer getRelationTableJoinClause(JDBCAbstractCMRFieldBridge cmrField, String parentAlias, String relationTableAlias, StringBuffer buf)
public static StringBuffer getJoinClause(JDBCFieldBridge[] pkFields, String parent, JDBCFieldBridge[] fkFields, String child, StringBuffer buf)
public static StringBuffer getSelfCompareWhereClause(JDBCFieldBridge[] fields, String fromIdentifier, String toIdentifier, StringBuffer buf)
public static StringBuffer getSelfCompareWhereClause(JDBCFieldBridge fromField, JDBCFieldBridge toField, String fromIdentifier, String toIdentifier, StringBuffer buf)
public static boolean tableExists(String tableName, DataSource dataSource) throws org.jboss.deployment.DeploymentException
org.jboss.deployment.DeploymentException
public static SQLUtil.OldColumns getOldColumns(String tableName, DataSource dataSource) throws org.jboss.deployment.DeploymentException
org.jboss.deployment.DeploymentException
public static SQLUtil.OldIndexes getOldIndexes(String tableName, DataSource dataSource) throws org.jboss.deployment.DeploymentException
org.jboss.deployment.DeploymentException
public static void dropTable(DataSource dataSource, String tableName) throws org.jboss.deployment.DeploymentException
org.jboss.deployment.DeploymentException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |