org.apache.mahout.cf.taste.impl.model
Class MySQLJDBCIDMigrator
java.lang.Object
org.apache.mahout.cf.taste.impl.model.AbstractIDMigrator
org.apache.mahout.cf.taste.impl.model.AbstractJDBCIDMigrator
org.apache.mahout.cf.taste.impl.model.MySQLJDBCIDMigrator
- All Implemented Interfaces:
- IDMigrator
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,
string_id VARCHAR(255) NOT NULL,
PRIMARY KEY (long_id)
)
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)
Constructor Summary |
MySQLJDBCIDMigrator(javax.sql.DataSource dataSource)
|
MySQLJDBCIDMigrator(javax.sql.DataSource dataSource,
java.lang.String mappingTable,
java.lang.String longIDColumn,
java.lang.String stringIDColumn)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MySQLJDBCIDMigrator
public MySQLJDBCIDMigrator(javax.sql.DataSource dataSource)
MySQLJDBCIDMigrator
public MySQLJDBCIDMigrator(javax.sql.DataSource dataSource,
java.lang.String mappingTable,
java.lang.String longIDColumn,
java.lang.String stringIDColumn)
Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.