## org.apache.mahout.cf.taste.impl.model.jdbc
Class AbstractBooleanPrefJDBCDataModel

    java.lang.Object
      org.apache.mahout.cf.taste.impl.common.jdbc.AbstractJDBCComponent
          org.apache.mahout.cf.taste.impl.model.jdbc.AbstractJDBCDataModel
              org.apache.mahout.cf.taste.impl.model.jdbc.AbstractBooleanPrefJDBCDataModel

All Implemented Interfaces:
  Serializable, Refreshable, DataModel, JDBCDataModel

Direct Known Subclasses:
  MySQLBooleanPrefJDBCDataModel, SQL92BooleanPrefJDBCDataModel

    public abstract class AbstractBooleanPrefJDBCDataModel

extends AbstractJDBCDataModel

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

`protected`

`AbstractBooleanPrefJDBCDataModel(DataSource dataSource, String preferenceTable, String userIDColumn, String itemIDColumn, String preferenceColumn, String getPreferenceSQL, String getPreferenceTimeSQL, String getUserSQL, String getAllUsersSQL, String getNumItemsSQL, String getNumUsersSQL, String setPreferenceSQL, String removePreferenceSQL, String getUsersSQL, String getItemsSQL, String getPrefsForItemSQL, String getNumPreferenceForItemSQL, String getNumPreferenceForItemsSQL, String getMaxPreferenceSQL, String getMinPreferenceSQL)`

Method Summary
`protected Preference` `buildPreference(ResultSet rs)`
`float` `getMaxPreference()`
`float` `getMinPreference()`
`boolean` `hasPreferenceValues()`
`void` `setPreference(long userID, long itemID, float value)`

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, getFetchSize, lookupDataSource`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### AbstractBooleanPrefJDBCDataModel

    protected AbstractBooleanPrefJDBCDataModel(DataSource dataSource,
                                               String preferenceTable,
                                               String userIDColumn,
                                               String itemIDColumn,
                                               String preferenceColumn,
                                               String getPreferenceSQL,
                                               String getPreferenceTimeSQL,
                                               String getUserSQL,
                                               String getAllUsersSQL,
                                               String getNumItemsSQL,
                                               String getNumUsersSQL,
                                               String setPreferenceSQL,
                                               String removePreferenceSQL,
                                               String getUsersSQL,
                                               String getItemsSQL,
                                               String getPrefsForItemSQL,
                                               String getNumPreferenceForItemSQL,
                                               String getNumPreferenceForItemsSQL,
                                               String getMaxPreferenceSQL,
                                               String getMinPreferenceSQL)

Method Detail

### buildPreference

    protected Preference buildPreference(ResultSet rs)
                                  throws SQLException

  Overrides:
    `buildPreference` in class `AbstractJDBCDataModel`
  Throws:
    `SQLException`

### setPreference

    public void setPreference(long userID,
                              long itemID,
                              float value)
                       throws TasteException

  Specified by:
    `setPreference` in interface `DataModel`
  Overrides:
    `setPreference` in class `AbstractJDBCDataModel`
  Throws:
    `TasteException`

### hasPreferenceValues

    public boolean hasPreferenceValues()

  Specified by:
    `hasPreferenceValues` in interface `DataModel`
  Overrides:
    `hasPreferenceValues` in class `AbstractJDBCDataModel`

### getMaxPreference

    public float getMaxPreference()

  Specified by:
    `getMaxPreference` in interface `DataModel`
  Overrides:
    `getMaxPreference` in class `AbstractJDBCDataModel`

### getMinPreference

    public float getMinPreference()

  Specified by:
    `getMinPreference` in interface `DataModel`
  Overrides:
    `getMinPreference` in class `AbstractJDBCDataModel`

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