public final class MySQLJDBCIDMigrator extends AbstractJDBCIDMigrator
An implementation for MySQL. The following statement would create a table suitable for use with this class:
CREATE TABLE taste_id_migration ( long_id BIGINT NOT NULL PRIMARY KEY, string_id VARCHAR(255) NOT NULL UNIQUE )
Separately, note that in a MySQL database, the following function calls will convert a string value into a
numeric value in the same way that the standard implementations in this package do. This may be useful in
writing SQL statements for use with
AbstractJDBCDataModel
subclasses which convert string
column values to appropriate numeric values -- though this should be viewed as a temporary arrangement
since it will impact performance:
cast(conv(substring(md5([column name]), 1, 16),16,10) as signed)
DEFAULT_LONG_ID_COLUMN, DEFAULT_MAPPING_TABLE, DEFAULT_STRING_ID_COLUMN
Constructor and Description |
---|
MySQLJDBCIDMigrator(DataSource dataSource) |
MySQLJDBCIDMigrator(DataSource dataSource,
String mappingTable,
String longIDColumn,
String stringIDColumn) |
initialize, storeMapping, toStringID
hash, refresh, toLongID
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
toLongID
refresh
public MySQLJDBCIDMigrator(DataSource dataSource)
public MySQLJDBCIDMigrator(DataSource dataSource, String mappingTable, String longIDColumn, String stringIDColumn)
Copyright © 2008–2017 The Apache Software Foundation. All rights reserved.