Package com.heliorm.sql.mysql
Class MySqlDriver
- java.lang.Object
-
- com.heliorm.sql.SqlDriver
-
- com.heliorm.sql.mysql.MySqlDriver
-
- All Implemented Interfaces:
OrmTransactionDriver,OrmDriver
public final class MySqlDriver extends SqlDriver
- Author:
- gideon
-
-
Constructor Summary
Constructors Constructor Description MySqlDriver(Supplier<Connection> connectionSupplier, PojoOperations pops)MySqlDriver(Supplier<Connection> connectionSupplier, PojoOperations pops, Map<Database,Database> aliases)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringfieldName(Table table, Field field)protected StringfullFieldName(Table table, Field field)protected StringfullTableName(Table table)protected ObjectgetKeyValueFromResultSet(ResultSet rs, Field field)Retrieve the returned key value from a result set (used for updating auto-increment keys).protected TableGeneratorgetTableGenerator()protected booleansupportsUnionAll()protected StringvirtualFieldName(String name)protected StringvirtualValue(String name)-
Methods inherited from class com.heliorm.sql.SqlDriver
create, databaseName, delete, openTransaction, setCreateTables, setEnum, setRollbackOnUncommittedClose, setUseUnionAll, stream, tableName, update
-
-
-
-
Constructor Detail
-
MySqlDriver
public MySqlDriver(Supplier<Connection> connectionSupplier, PojoOperations pops)
-
MySqlDriver
public MySqlDriver(Supplier<Connection> connectionSupplier, PojoOperations pops, Map<Database,Database> aliases)
-
-
Method Detail
-
fullTableName
protected String fullTableName(Table table) throws OrmException
- Specified by:
fullTableNamein classSqlDriver- Throws:
OrmException
-
fullFieldName
protected String fullFieldName(Table table, Field field) throws OrmException
- Specified by:
fullFieldNamein classSqlDriver- Throws:
OrmException
-
fieldName
protected String fieldName(Table table, Field field) throws OrmException
- Specified by:
fieldNamein classSqlDriver- Throws:
OrmException
-
virtualFieldName
protected String virtualFieldName(String name)
- Specified by:
virtualFieldNamein classSqlDriver
-
virtualValue
protected String virtualValue(String name)
- Specified by:
virtualValuein classSqlDriver
-
getTableGenerator
protected TableGenerator getTableGenerator() throws OrmException
- Specified by:
getTableGeneratorin classSqlDriver- Throws:
OrmException
-
getKeyValueFromResultSet
protected Object getKeyValueFromResultSet(ResultSet rs, Field field) throws OrmException
Retrieve the returned key value from a result set (used for updating auto-increment keys).- Specified by:
getKeyValueFromResultSetin classSqlDriver- Parameters:
rs- The result setfield- The field for which we're reading data- Returns:
- The data
- Throws:
OrmException- Thrown if we cannot work out how to extract the data.
-
supportsUnionAll
protected boolean supportsUnionAll()
- Specified by:
supportsUnionAllin classSqlDriver
-
-