org.apache.mahout.cf.taste.impl.model.jdbc
Class MySQLBooleanPrefJDBCDataModel

java.lang.Object
  extended by org.apache.mahout.cf.taste.impl.common.jdbc.AbstractJDBCComponent
      extended by org.apache.mahout.cf.taste.impl.model.jdbc.AbstractJDBCDataModel
          extended by org.apache.mahout.cf.taste.impl.model.jdbc.AbstractBooleanPrefJDBCDataModel
              extended by org.apache.mahout.cf.taste.impl.model.jdbc.MySQLBooleanPrefJDBCDataModel
All Implemented Interfaces:
Serializable, Refreshable, DataModel, JDBCDataModel

public class MySQLBooleanPrefJDBCDataModel
extends AbstractBooleanPrefJDBCDataModel

See also MySQLJDBCDataModel -- same except deals with a table without preference info:

 CREATE TABLE taste_preferences (
   user_id BIGINT NOT NULL,
   item_id BIGINT NOT NULL,
   PRIMARY KEY (user_id, item_id),
   INDEX (user_id),
   INDEX (item_id)
 )
 

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.mahout.cf.taste.impl.model.jdbc.AbstractJDBCDataModel
DEFAULT_ITEM_ID_COLUMN, DEFAULT_PREFERENCE_COLUMN, DEFAULT_PREFERENCE_TABLE, DEFAULT_PREFERENCE_TIME_COLUMN, DEFAULT_USER_ID_COLUMN
 
Fields inherited from class org.apache.mahout.cf.taste.impl.common.jdbc.AbstractJDBCComponent
DEFAULT_DATASOURCE_NAME
 
Constructor Summary
MySQLBooleanPrefJDBCDataModel()
           Creates a MySQLBooleanPrefJDBCDataModel using the default DataSource (named AbstractJDBCComponent.DEFAULT_DATASOURCE_NAME and default table/column names.
MySQLBooleanPrefJDBCDataModel(DataSource dataSource)
           Creates a MySQLBooleanPrefJDBCDataModel using the given DataSource and default table/column names.
MySQLBooleanPrefJDBCDataModel(DataSource dataSource, String preferenceTable, String userIDColumn, String itemIDColumn, String timestampColumn)
           Creates a MySQLBooleanPrefJDBCDataModel using the given DataSource and default table/column names.
MySQLBooleanPrefJDBCDataModel(String dataSourceName)
           Creates a MySQLBooleanPrefJDBCDataModel using the default DataSource found under the given name, and using default table/column names.
 
Method Summary
protected  int getFetchSize()
           
 
Methods inherited from class org.apache.mahout.cf.taste.impl.model.jdbc.AbstractBooleanPrefJDBCDataModel
buildPreference, getMaxPreference, getMinPreference, hasPreferenceValues, setPreference
 
Methods inherited from class org.apache.mahout.cf.taste.impl.model.jdbc.AbstractJDBCDataModel
doGetPreferencesForItem, exportWithIDsOnly, exportWithPrefs, getDataSource, getItemIDColumn, getItemIDs, getItemIDsFromUser, getLongColumn, getNumItems, getNumUsers, getNumUsersWithPreferenceFor, getNumUsersWithPreferenceFor, getPreferenceColumn, getPreferencesForItem, getPreferencesFromUser, getPreferenceTable, getPreferenceTime, getPreferenceValue, getUserIDColumn, getUserIDs, refresh, removePreference, setLongParameter
 
Methods inherited from class org.apache.mahout.cf.taste.impl.common.jdbc.AbstractJDBCComponent
checkNotNullAndLog, checkNotNullAndLog, lookupDataSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MySQLBooleanPrefJDBCDataModel

public MySQLBooleanPrefJDBCDataModel()
                              throws TasteException

Creates a MySQLBooleanPrefJDBCDataModel using the default DataSource (named AbstractJDBCComponent.DEFAULT_DATASOURCE_NAME and default table/column names.

Throws:
TasteException - if DataSource can't be found

MySQLBooleanPrefJDBCDataModel

public MySQLBooleanPrefJDBCDataModel(String dataSourceName)
                              throws TasteException

Creates a MySQLBooleanPrefJDBCDataModel using the default DataSource found under the given name, and using default table/column names.

Parameters:
dataSourceName - name of DataSource to look up
Throws:
TasteException - if DataSource can't be found

MySQLBooleanPrefJDBCDataModel

public MySQLBooleanPrefJDBCDataModel(DataSource dataSource)

Creates a MySQLBooleanPrefJDBCDataModel using the given DataSource and default table/column names.

Parameters:
dataSource - DataSource to use

MySQLBooleanPrefJDBCDataModel

public MySQLBooleanPrefJDBCDataModel(DataSource dataSource,
                                     String preferenceTable,
                                     String userIDColumn,
                                     String itemIDColumn,
                                     String timestampColumn)

Creates a MySQLBooleanPrefJDBCDataModel using the given DataSource and default table/column names.

Parameters:
dataSource - DataSource to use
preferenceTable - name of table containing preference data
userIDColumn - user ID column name
itemIDColumn - item ID column name
timestampColumn - timestamp column name (may be null)
Method Detail

getFetchSize

protected int getFetchSize()
Overrides:
getFetchSize in class AbstractJDBCComponent


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.