當前位置: 首頁>>代碼示例>>Java>>正文


Java TenantVO.getRatingRangeMax方法代碼示例

本文整理匯總了Java中org.easyrec.model.core.TenantVO.getRatingRangeMax方法的典型用法代碼示例。如果您正苦於以下問題:Java TenantVO.getRatingRangeMax方法的具體用法?Java TenantVO.getRatingRangeMax怎麽用?Java TenantVO.getRatingRangeMax使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.easyrec.model.core.TenantVO的用法示例。


在下文中一共展示了TenantVO.getRatingRangeMax方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: performForTenant

import org.easyrec.model.core.TenantVO; //導入方法依賴的package包/類
private void performForTenant(final TenantVO tenant) {
    if (tenant == null) throw new IllegalArgumentException("tenant is null");

    final Integer tenantId = tenant.getId();
    final Integer actionTypeId = typeMappingService.getIdOfActionType(tenantId, settings.getActionType());
    final Integer itemTypeId = typeMappingService.getIdOfItemType(tenantId, settings.getItemType());
    final Integer sourceTypeId = typeMappingService.getIdOfSourceType(tenantId, settings.getSourceType());
    final Integer minRatingValue = tenant.getRatingRangeMin();
    final Integer maxRatingValue = tenant.getRatingRangeMax();
    final Date changeDate = new Date();

    final List<User> users = userDao.getUsersForTenant(tenantId);
    final Map<Integer, Double> averageRatings = getAverageUserRatingMap(tenantId, itemTypeId);

    logger.info("Starting weight calculation.");
    Date start = new Date();

    // calculateWeights(tenantId, actionTypeId, itemTypeId, users, averageRatings);

    Date end = new Date();
    double time = (end.getTime() - start.getTime()) / 1000L;
    logger.info(String.format("Calculating weights for %s took %.2f seconds", tenant.getStringId(), time));

    logger.info("Starting predictions.");
    start = new Date();

    predict(tenantId, actionTypeId, itemTypeId, sourceTypeId, changeDate, users, averageRatings, minRatingValue,
            maxRatingValue);

    end = new Date();
    time = (end.getTime() - start.getTime()) / 1000L;
    logger.info(String.format("Calculating USER-ITEM predictions for %s took %.2f seconds", tenant.getStringId(),
            time));
}
 
開發者ID:major2015,項目名稱:easyrec_major,代碼行數:35,代碼來源:PearsonServiceImpl.java

示例2: insertTenant

import org.easyrec.model.core.TenantVO; //導入方法依賴的package包/類
public int insertTenant(TenantVO tenant) {

        if (logger.isDebugEnabled()) {
            logger.debug("inserting tenant '" + tenant.getStringId() + "'");
        }


        StringBuilder query = new StringBuilder("INSERT INTO ");
        query.append(DEFAULT_TABLE_NAME);
        query.append(" SET ");
        query.append(DEFAULT_ID_COLUMN_NAME);
        query.append(" =?, ");
        query.append(DEFAULT_STRING_ID_COLUMN_NAME);
        query.append(" =?, ");
        query.append(DEFAULT_DESCRIPTION_COLUMN_NAME);
        query.append(" =?, ");
        query.append(DEFAULT_RATING_RANGE_MIN_COLUMN_NAME);
        query.append(" =?, ");
        query.append(DEFAULT_RATING_RANGE_MAX_COLUMN_NAME);
        query.append(" =?, ");
        query.append(DEFAULT_RATING_RANGE_NEUTRAL_COLUMN_NAME);
        query.append(" =?");

        tenant.setId(getNewTenantId());

        Object[] args = {tenant.getId(), tenant.getStringId(), tenant.getDescription(), tenant.getRatingRangeMin(),
                tenant.getRatingRangeMax(), tenant.getRatingRangeNeutral()};
        int[] argTypes = {Types.INTEGER, Types.VARCHAR, Types.VARCHAR, Types.INTEGER, Types.INTEGER, Types.DOUBLE};

        PreparedStatementCreatorFactory factory = new PreparedStatementCreatorFactory(query.toString(), argTypes);

        getJdbcTemplate().update(factory.newPreparedStatementCreator(args));

        return tenant.getId();
    }
 
開發者ID:major2015,項目名稱:easyrec_major,代碼行數:36,代碼來源:AbstractBaseTenantDAOMysqlImpl.java


注:本文中的org.easyrec.model.core.TenantVO.getRatingRangeMax方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。