本文整理汇总了Java中org.easyrec.model.core.AssociatedItemVO类的典型用法代码示例。如果您正苦于以下问题:Java AssociatedItemVO类的具体用法?Java AssociatedItemVO怎么用?Java AssociatedItemVO使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AssociatedItemVO类属于org.easyrec.model.core包,在下文中一共展示了AssociatedItemVO类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convertAssociatedItems
import org.easyrec.model.core.AssociatedItemVO; //导入依赖的package包/类
private List<RecommendedItemVO<Integer, Integer>> convertAssociatedItems(
List<AssociatedItemVO<Integer, Integer>> associatedItems,
ItemVO<Integer, Integer> currentItem) {
List<RecommendedItemVO<Integer, Integer>> recommendedItems = new ArrayList<RecommendedItemVO<Integer, Integer>>();
for (AssociatedItemVO<Integer, Integer> currentAssociatedItem : associatedItems) {
StringBuilder explanation = new StringBuilder(EXPLANATION_RELATED_1);
explanation.append(currentItem.getItem());
explanation.append(EXPLANATION_RELATED_2);
explanation.append(currentAssociatedItem.getAssocType());
explanation.append("'");
recommendedItems.add(new RecommendedItemVO<Integer, Integer>(currentAssociatedItem.getItem(),
currentAssociatedItem.getAssocValue(), currentAssociatedItem.getItemAssocId(),
explanation.toString()));
}
return recommendedItems;
}
示例2: getItemsFromCluster
import org.easyrec.model.core.AssociatedItemVO; //导入依赖的package包/类
@ShortCacheable
public List<AssociatedItemVO<Integer, Integer>> getItemsFromCluster(Integer tenantId,
ClusterVO cluster,
Integer numberOfResults,
Integer itemType) {
IAConstraintVO<Integer, Integer> constraint =
new IAConstraintVO<Integer, Integer>(numberOfResults, null, null, null, tenantId, true, false);
return itemAssocService.getItemsFrom(itemType,
assocTypeDAO.getIdOfType(tenantId, ClusterService.ASSOCTYPE_BELONGSTO), cluster.getItem(), constraint);
}
示例3: getAlsoActedItems
import org.easyrec.model.core.AssociatedItemVO; //导入依赖的package包/类
@Override
public RecommendationVO<Integer, Integer> getAlsoActedItems(Integer tenantId,
Integer userId,
String sessionId,
Integer assocTypeId,
ItemVO<Integer, Integer> item,
Integer filteredActionTypeId,
Integer requestedItemTypeId) {
List<AssociatedItemVO<Integer, Integer>> associatedItems = itemAssocService
.getItemsTo(item, assocTypeId, requestedItemTypeId,
new IAConstraintVO<Integer, Integer>(maximumNumberOfRelatedItemsPerItem, null, null,
null, tenantId, true, false));
List<RecommendedItemVO<Integer, Integer>> recommendedItems = convertAssociatedItems(associatedItems,
item);
// filter duplicates and history
if (filterResults) {
recommendedItems = doFiltering(tenantId, userId, sessionId, filteredActionTypeId, requestedItemTypeId,
recommendedItems, DEFAULT_USE_AVERAGE_PREDICTION_VALUES_FOR_DUPLICATES);
}
RecommendationVO<Integer, Integer> recommendation = new RecommendationVO<Integer, Integer>(
tenantId, userId, item.getItem(), item.getType(), assocTypeId, null,
RECOMMENDATION_STRATEGY_ITEMS_ALSO_ACTED_ON, EXPLANATION_ITEMS_ALSO_ACTED_ON, recommendedItems);
// HINT: implement an aspect (instead of directly using this) (Mantis Issue: #650)
if (recommendationHistoryService != null) recommendationHistoryService.insertRecommendation(recommendation);
return recommendation;
}
示例4: getItemsFrom
import org.easyrec.model.core.AssociatedItemVO; //导入依赖的package包/类
@Override
public List<AssociatedItemVO<Integer, Integer>> getItemsFrom(Integer itemFromTypeId,
Integer assocTypeId,
ItemVO<Integer, Integer> itemTo,
IAConstraintVO<Integer, Integer> constraints) {
return itemAssocDAO.getItemsFrom(itemFromTypeId, assocTypeId, itemTo, constraints);
}
示例5: getItemsFromCluster
import org.easyrec.model.core.AssociatedItemVO; //导入依赖的package包/类
@ShortCacheable
public List<AssociatedItemVO<Integer, Integer>> getItemsFromCluster(Integer tenantId,
ClusterVO cluster,
Integer numberOfResults,
Integer itemType) {
IAConstraintVO<Integer, Integer> constraint = new IAConstraintVO<Integer, Integer>(
numberOfResults, null, null, null, tenantId, true, false, ItemAssocDAO.DEFAULT_CHANGE_DATE_COLUMN_NAME);
return itemAssocService.getItemsFrom(itemType,
assocTypeDAO.getIdOfType(tenantId, ClusterService.ASSOCTYPE_BELONGSTO), cluster.getItem(), constraint);
}
示例6: getAllItems
import org.easyrec.model.core.AssociatedItemVO; //导入依赖的package包/类
@ShortCacheable
private List<AssociatedItemVO<Integer, Integer>> getAllItems(Integer tenantId, ClusterVO cluster,
Integer numberOfResults,
Integer itemType) {
IAConstraintVO<Integer, Integer> constraint = new IAConstraintVO<Integer, Integer>(
numberOfResults, null, null, null, tenantId, true, null);
//TODO: modify SQL statement: SELECT RANDOM .... LIMIT 100;
return itemAssocService.getItemsFrom(itemType,
assocTypeDAO.getIdOfType(tenantId, ClusterService.ASSOCTYPE_BELONGSTO), cluster.getItem(), constraint);
}
示例7: getItemsFrom
import org.easyrec.model.core.AssociatedItemVO; //导入依赖的package包/类
@Override
public List<AssociatedItemVO<Integer, String>> getItemsFrom(String itemFromType, String assocType,
ItemVO<Integer, String> itemTo,
IAConstraintVO<Integer, String> constraints) {
Integer tenantId = constraints.getTenant();
if (tenantId == null) {
throw new IllegalArgumentException("tenant not specified, can not retrieve type mapping without tenant");
}
return typeMappingService.convertListOfAssociatedItemVOs(tenantId, itemAssocDAO
.getItemsFrom(typeMappingService.getIdOfItemType(tenantId, itemFromType),
typeMappingService.getIdOfAssocType(tenantId, assocType),
typeMappingService.convertTypedItemVO(tenantId, itemTo),
typeMappingService.convertTypedIAConstraintVO(tenantId, constraints)));
}
示例8: getItemsTo
import org.easyrec.model.core.AssociatedItemVO; //导入依赖的package包/类
@Override
public List<AssociatedItemVO<Integer, String>> getItemsTo(
ItemVO<Integer, String> itemFrom, String assocType, String itemToType,
IAConstraintVO<Integer, String> constraints) {
Integer tenantId = constraints.getTenant();
if (tenantId == null) {
throw new IllegalArgumentException("tenant not specified, can not retrieve type mapping without tenant");
}
return typeMappingService.convertListOfAssociatedItemVOs(tenantId, itemAssocDAO
.getItemsTo(typeMappingService.convertTypedItemVO(tenantId, itemFrom),
typeMappingService.getIdOfAssocType(tenantId, assocType),
typeMappingService.getIdOfItemType(tenantId, itemToType),
typeMappingService.convertTypedIAConstraintVO(tenantId, constraints)));
}
示例9: mapRow
import org.easyrec.model.core.AssociatedItemVO; //导入依赖的package包/类
public AssociatedItemVO<Integer, Integer> mapRow(ResultSet rs, int rowNum)
throws SQLException {
AssociatedItemVO<Integer, Integer> associatedItem = new AssociatedItemVO<Integer, Integer>(
new ItemVO<Integer, Integer>(DaoUtils.getInteger(rs, DEFAULT_TENANT_COLUMN_NAME),
DaoUtils.getInteger(rs, DEFAULT_ITEM_FROM_COLUMN_NAME),
DaoUtils.getInteger(rs, DEFAULT_ITEM_FROM_TYPE_COLUMN_NAME)),
DaoUtils.getDouble(rs, DEFAULT_ASSOC_VALUE_COLUMN_NAME),
DaoUtils.getLong(rs, DEFAULT_ID_COLUMN_NAME),
DaoUtils.getInteger(rs, DEFAULT_ASSOC_TYPE_COLUMN_NAME));
return associatedItem;
}
示例10: testGetItemsFrom
import org.easyrec.model.core.AssociatedItemVO; //导入依赖的package包/类
@Test
public void testGetItemsFrom() {
List<AssociatedItemVO<Integer, Integer>> associatedItems = itemAssocDAO
.getItemsFrom(1, 1, new ItemVO<Integer, Integer>(1, 2, 1),
new IAConstraintVO<Integer, Integer>(500));
assertTrue(associatedItems != null);
assertEquals(1, associatedItems.size());
// HINT: hardcoded check if list equals expected list (Mantis Issue: #721)
}
示例11: testGetItemsFromEmptyDB
import org.easyrec.model.core.AssociatedItemVO; //导入依赖的package包/类
@Test
public void testGetItemsFromEmptyDB() {
Unitils.getInstance().getModulesRepository().getModuleOfType(DatabaseModule.class).cleanSchemas();
List<AssociatedItemVO<Integer, Integer>> associatedItems = itemAssocDAO
.getItemsFrom(1, 1, new ItemVO<Integer, Integer>(1, 1, 1),
new IAConstraintVO<Integer, Integer>(500));
assertTrue(associatedItems.isEmpty());
assertEquals(0, associatedItems.size());
}
示例12: testGetItemsTo
import org.easyrec.model.core.AssociatedItemVO; //导入依赖的package包/类
@Test
public void testGetItemsTo() {
List<AssociatedItemVO<Integer, Integer>> associatedItems = itemAssocDAO
.getItemsTo(new ItemVO<Integer, Integer>(1, 1, 1), 1, 1,
new IAConstraintVO<Integer, Integer>(500));
assertTrue(associatedItems != null);
assertEquals(5, associatedItems.size());
// HINT: hardcoded check if list equals expected list (Mantis Issue: #721)
}
示例13: testGetItemsToEmptyDB
import org.easyrec.model.core.AssociatedItemVO; //导入依赖的package包/类
@Test
public void testGetItemsToEmptyDB() {
Unitils.getInstance().getModulesRepository().getModuleOfType(DatabaseModule.class).cleanSchemas();
List<AssociatedItemVO<Integer, Integer>> associatedItems = itemAssocDAO
.getItemsTo(new ItemVO<Integer, Integer>(1, 1, 1), 1, 1,
new IAConstraintVO<Integer, Integer>(500));
assertTrue(associatedItems.isEmpty());
assertEquals(0, associatedItems.size());
}
示例14: mapRow
import org.easyrec.model.core.AssociatedItemVO; //导入依赖的package包/类
public AssociatedItemVO<Integer, Integer> mapRow(ResultSet rs, int rowNum)
throws SQLException {
AssociatedItemVO<Integer, Integer> associatedItem = new AssociatedItemVO<Integer, Integer>(
new ItemVO<Integer, Integer>(DaoUtils.getInteger(rs, DEFAULT_TENANT_COLUMN_NAME),
DaoUtils.getInteger(rs, DEFAULT_ITEM_FROM_COLUMN_NAME),
DaoUtils.getInteger(rs, DEFAULT_ITEM_FROM_TYPE_COLUMN_NAME)),
DaoUtils.getDouble(rs, DEFAULT_ASSOC_VALUE_COLUMN_NAME),
DaoUtils.getInteger(rs, DEFAULT_ID_COLUMN_NAME),
DaoUtils.getInteger(rs, DEFAULT_ASSOC_TYPE_COLUMN_NAME));
return associatedItem;
}