本文整理汇总了Java中org.easyrec.model.core.TenantVO.getId方法的典型用法代码示例。如果您正苦于以下问题:Java TenantVO.getId方法的具体用法?Java TenantVO.getId怎么用?Java TenantVO.getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.easyrec.model.core.TenantVO
的用法示例。
在下文中一共展示了TenantVO.getId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setTenantActive
import org.easyrec.model.core.TenantVO; //导入方法依赖的package包/类
public int setTenantActive(TenantVO tenant, boolean active) {
if (logger.isDebugEnabled()) {
logger.debug("setting tenant '" + tenant.getStringId() + "' to " + active);
}
StringBuilder query = new StringBuilder("UPDATE ");
query.append(DEFAULT_TABLE_NAME);
query.append(" SET ");
query.append(DEFAULT_ACTIVE_COLUMN_NAME).append("=?");
query.append(" WHERE ");
query.append(DEFAULT_ID_COLUMN_NAME).append("=?");
Object[] args = {active, tenant.getId()};
int[] argTypes = {Types.BOOLEAN, Types.INTEGER};
PreparedStatementCreatorFactory factory = new PreparedStatementCreatorFactory(query.toString(), argTypes);
return getJdbcTemplate().update(factory.newPreparedStatementCreator(args));
}
示例2: 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));
}
示例3: 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();
}