当前位置: 首页>>代码示例>>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;未经允许,请勿转载。