|
SRJRCFrames v0.1.296 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.schwarzrot.data.access.support.AbstractDbUtils
de.schwarzrot.data.access.support.MyUtils
public final class MyUtils
mysql-variant of utility-class to handle physical dependencies to database, like quoting, schema support, ...
| Field Summary |
|---|
| Fields inherited from class de.schwarzrot.data.access.support.AbstractDbUtils |
|---|
skipList |
| Fields inherited from interface de.schwarzrot.data.access.support.DbUtil |
|---|
EMPTY_STRING, ONE_SPACE, PK_NAME |
| Constructor Summary | |
|---|---|
MyUtils()
|
|
| Method Summary | |
|---|---|
String |
genAccessRightsFor(TableDefinition ti,
String defaultUser)
generates a SQL-string to grant access rights to tables |
protected String |
genAutoIncrement(ColumnDefinition cd)
|
String |
genDBAccess(DatabaseModel dbInfo,
String user)
generates a SQL-string to grant access rights to the entire database |
protected String |
genPrimary(TableDefinition ti)
|
String |
genUserCreation(String user,
String password,
String host)
generates a SQL statement to create a user/role/principal. |
protected String |
getDBCharset()
|
String |
getFieldSeparator()
returns the separator used in field lists |
protected String |
getIndexName(IndexDefinition ii)
|
String |
getMapped(String dbObjName)
returns the quoted name of database identifiers (table, column, etc), cause we always want do handle case sensitive identifiers |
String |
getSchemaSeparator()
returns the schema separator for the actual storage. |
protected String |
getTableAttributes(TableDefinition td)
|
String |
getTableNameFor(EntityDescriptor ed)
returns the tablename for given entity |
String |
getTableNameFor(TableDefinition ti)
returns the tablename of given table model information |
String |
getTerminator()
returns the terminator of SQL statements |
protected String |
getUsernameFor(String user,
String host)
|
boolean |
isExistsSupported()
signals whether current database supports exists on drop tables |
boolean |
needDropIndexAfterDropTable()
signals whether an index must be dropped separately after removal of a table |
boolean |
needExternalSequenceForSerial()
signals whether the database needs an external sequence to support autoincrement columns |
boolean |
needSequenceResetAfterTruncate()
signals whether the database needs to set a new value to the sequence on removing all records of a table |
String |
quoteAndCutValue(Object value,
int size)
some databases pad strings to an unsupported size, so this call ensures, that the quoted string does not exceed the defined column size. |
boolean |
supportsGeneratedKeyQuery()
signals whether the JDBC implementation supports the call for generated (autoincrement) keys. |
protected boolean |
supportsNativeSchemata()
|
| Methods inherited from class de.schwarzrot.data.access.support.AbstractDbUtils |
|---|
columnDefinitions, createColumnDef, dumpRS, genAccessRightsForPK, genColumnCreation, genColumnModification, genCondition, genCondition, genCondition, genDBCreation, genIndexCreation, genIndexRemoval, genInsert, genInsertIdQuery, genOrder, genOrder, genRemove, genSchemaAccess, genSchemaCreation, genSequenceReset, genTableCreation, genTableMetaAccess, genTablePKCreation, genTablePKMod, genTableRemoval, genTableRemoval, genTruncate, genUpdate, genUpdate, genUserCreation, getLogger, getMapped, getTypeFor, getTypeFrom, indexDefinitions, needsUpdate, needsUpdate, schemaDefinitions, tableDefinitions, xpandInsert |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MyUtils()
| Method Detail |
|---|
public String genAccessRightsFor(TableDefinition ti,
String defaultUser)
DbUtil
ti - - table model informationdefaultUser - - the user that gets the rights granted
public String genDBAccess(DatabaseModel dbInfo,
String user)
DbUtil
dbInfo - - database model informationuser - - the user that gets the rights granted
public String genUserCreation(String user,
String password,
String host)
DbUtil
user - - name of the userpassword - - password for that userhost - - name of the host
public String getFieldSeparator()
DbUtil
public String getMapped(String dbObjName)
DbUtil
dbObjName - - the identifier to quote
public String getSchemaSeparator()
DbUtil
public String getTableNameFor(EntityDescriptor ed)
DbUtil
ed - - descriptor of an entity
public String getTableNameFor(TableDefinition ti)
DbUtil
ti - - table model information
public String getTerminator()
DbUtil
public final boolean isExistsSupported()
AbstractDbUtils
isExistsSupported in class AbstractDbUtilspublic final boolean needDropIndexAfterDropTable()
DbUtil
public final boolean needExternalSequenceForSerial()
DbUtil
public final boolean needSequenceResetAfterTruncate()
DbUtil
public String quoteAndCutValue(Object value,
int size)
DbUtil
value - - the value to storesize - - declared field size
public boolean supportsGeneratedKeyQuery()
DbUtil
protected String genAutoIncrement(ColumnDefinition cd)
genAutoIncrement in class AbstractDbUtilsprotected String genPrimary(TableDefinition ti)
genPrimary in class AbstractDbUtilsprotected String getDBCharset()
getDBCharset in class AbstractDbUtilsprotected String getIndexName(IndexDefinition ii)
getIndexName in class AbstractDbUtilsprotected String getTableAttributes(TableDefinition td)
getTableAttributes in class AbstractDbUtils
protected String getUsernameFor(String user,
String host)
getUsernameFor in class AbstractDbUtilsprotected final boolean supportsNativeSchemata()
supportsNativeSchemata in class AbstractDbUtils
|
SRJRCFrames v0.1.296 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||