| java.lang.Object hu.netmind.persistence.GenericDatabase hu.netmind.persistence.MysqlDatabaseImpl
MysqlDatabaseImpl | public class MysqlDatabaseImpl extends GenericDatabase (Code) | | MySQL database implementation.
Limitations:
- Date fields are stored only with seconds precision.
- Can not support more than 255 characters of map keys.
- InnoDB support must be compiled into MySQL to support
transactions.
author: Brautigam Robert version: CVS Revision: $Revision$ |
Method Summary | |
protected DatabaseStatistics | createTable(Connection connection, String tableName, Map attributeTypes, List keyAttributeNames) Create table with given name, attribute types, and keys. | protected String | getCreateIndexStatement(String indexName, String tableName, String field, Class fieldClass) Get index creation statement for a given table and field. | protected Object | getJavaValue(Object value, int type, Class javaType) Convert incoming value from database into java format. | protected String | getLimitStatement(String statement, Limits limits, List types) Get the limit component of statement, if it can be expressed in
the current database with simple statement part. | protected String | getSQLTypeName(int sqltype) Get the class for an sql type. | protected Object | getSQLValue(Object value) Convert incoming values into database acceptable format. | protected Expression | transformExpression(Expression expr) Transform 'ilike' to 'like', and 'like' to 'like binary' operators.
Parameters: expr - The expression to possibly transform. |
MysqlDatabaseImpl | public MysqlDatabaseImpl()(Code) | | |
createTable | protected DatabaseStatistics createTable(Connection connection, String tableName, Map attributeTypes, List keyAttributeNames)(Code) | | Create table with given name, attribute types, and keys.
Difference from generic: Mysql does not support 'text' type primary
keys, so avoid in keys.
Parameters: tableName - The table to create. Parameters: attributeTypes - The attribute names together with whichjava class they should hold. |
getCreateIndexStatement | protected String getCreateIndexStatement(String indexName, String tableName, String field, Class fieldClass)(Code) | | Get index creation statement for a given table and field.
The statement to use, or null, of no such index can becreated. |
getJavaValue | protected Object getJavaValue(Object value, int type, Class javaType)(Code) | | Convert incoming value from database into java format.
|
getLimitStatement | protected String getLimitStatement(String statement, Limits limits, List types)(Code) | | Get the limit component of statement, if it can be expressed in
the current database with simple statement part.
Parameters: limits - The limits to apply. |
getSQLTypeName | protected String getSQLTypeName(int sqltype)(Code) | | Get the class for an sql type. Override timestamp to set default.
|
getSQLValue | protected Object getSQLValue(Object value)(Code) | | Convert incoming values into database acceptable format.
|
transformExpression | protected Expression transformExpression(Expression expr)(Code) | | Transform 'ilike' to 'like', and 'like' to 'like binary' operators.
Parameters: expr - The expression to possibly transform. A transformed expression. |
Methods inherited from hu.netmind.persistence.GenericDatabase | protected DatabaseStatistics addColumn(Connection connection, String tableName, String columnName, String columnType)(Code)(Java Doc) protected DatabaseStatistics alterTable(Connection connection, String tableName, List removedAttributes, List addedAttributes, Map attributeTypes, List keyAttributeNames)(Code)(Java Doc) protected DatabaseStatistics createIndexes(Connection connection, String tableName, Map attributeTypes)(Code)(Java Doc) protected DatabaseStatistics createTable(Connection connection, String tableName, Map attributeTypes, List keyAttributeNames)(Code)(Java Doc) protected DatabaseStatistics dropColumn(Connection connection, String tableName, String columnName)(Code)(Java Doc) protected DatabaseStatistics dropTable(Connection connection, String tableName)(Code)(Java Doc) public DatabaseStatistics ensureTable(Connection connection, String tableName, Map attributeTypes, List keyAttributeNames, boolean create)(Code)(Java Doc) protected void executeUpdate(Connection connection, String statement)(Code)(Java Doc) protected String getAddColumnStatement(String tableName, String columnName, String columnType)(Code)(Java Doc) protected Class getAttributeType(String tableName, String attributeName)(Code)(Java Doc) protected Map getAttributes(String tableName)(Code)(Java Doc) protected String getCountStatement(String stmt)(Code)(Java Doc) protected String getCreateIndexName(Connection connection, String tableName, String field)(Code)(Java Doc) protected String getCreateIndexStatement(String indexName, String tableName, String field, Class fieldClass)(Code)(Java Doc) protected String getCreateTableStatement(Connection connection, String tableName)(Code)(Java Doc) protected String getDropColumnStatement(String tableName, String columnName)(Code)(Java Doc) protected String getInsertStatement(String tableName, List attributeNames)(Code)(Java Doc) protected Object getJavaValue(Object value, int type, Class javaType)(Code)(Java Doc) protected String getLimitStatement(String statement, Limits limits, List types)(Code)(Java Doc) protected String getQuerySource(TableTerm term, Set queryColumns, List types)(Code)(Java Doc) protected String getQuerySource(QueryStatement stmt, List types)(Code)(Java Doc) protected String getRemoveStatement(String tableName, List attributeNames)(Code)(Java Doc) protected int getSQLType(Class type)(Code)(Java Doc) protected String getSQLTypeName(int sqltype)(Code)(Java Doc) protected Object getSQLValue(Object value)(Code)(Java Doc) protected String getSaveStatement(String tableName, List keyNames, List attributeNames, Map keys)(Code)(Java Doc) protected int getTableAttributeType(ResultSet rs) throws SQLException(Code)(Java Doc) protected HashMap getTableAttributeTypes(Connection connection, String tableName) throws SQLException(Code)(Java Doc) protected String getTableDeclaration(String tableName, String alias)(Code)(Java Doc) public DatabaseStatistics insert(Connection connection, String tableName, Map attributes)(Code)(Java Doc) protected void prepareResultSet(ResultSet rs, Limits limits) throws SQLException(Code)(Java Doc) protected void prepareStatement(PreparedStatement pstmt, Limits limits) throws SQLException(Code)(Java Doc) public void release(ConnectionSource source)(Code)(Java Doc) public DatabaseStatistics remove(Connection connection, String tableName, Map attributes)(Code)(Java Doc) public DatabaseStatistics save(Connection connection, String tableName, Map keys, Map attributes)(Code)(Java Doc) public DatabaseStatistics search(Connection connection, QueryStatement stmt, Limits limits, SearchResult searchResult)(Code)(Java Doc) protected Expression transformExpression(Expression expr)(Code)(Java Doc)
|
|
|