public int removeAllItemAssocsFromSource(Integer sourceTypeId, String sourceInfo) { return itemAssocDAO.removeItemAssocsQBE( new ItemAssocVO<Integer,Integer>(null, null, null, null, null, sourceTypeId, sourceInfo, null, null)); }
public int removeAllItemAssocsFromSource(String sourceType, String sourceInfo) { return typedItemAssocDAO.removeItemAssocsQBE( new ItemAssocVO<Integer, String>(null, null, null, null, null, sourceType, sourceInfo, null, null)); }
public int removeAllItemAssocsFromSource(Integer sourceTypeId) { return itemAssocDAO.removeItemAssocsQBE( new ItemAssocVO<Integer,Integer>(null, null, null, null, null, sourceTypeId, null, null, null)); }
public int removeAllItemAssocsFromTenant(Integer tenantId) { return itemAssocDAO.removeItemAssocsQBE( new ItemAssocVO<Integer,Integer>(null, tenantId, null, null, null, null, null, null, null, null)); }
public int removeAllItemAssocsFromSource(String sourceType) { return typedItemAssocDAO.removeItemAssocsQBE( new ItemAssocVO<Integer, String>(null, null, null, null, null, sourceType, null, null, null)); }
public int removeAllItemAssocsFromTenant(Integer tenantId) { return typedItemAssocDAO.removeItemAssocsQBE( new ItemAssocVO<Integer, String>(null, tenantId, null, null, null, null, null, null, null, null)); }
/** * Removes an ItemAssoc-Entry with the given ID from the DB. * * @param itemAssocId Integer */ public int removeItemAssoc(Integer itemAssocId) { // validate input parameters if (itemAssocId == null) { throw new IllegalArgumentException("missing 'itemAssocId'"); } return typedItemAssocDAO.removeItemAssocsQBE( new ItemAssocVO<Integer, String>(itemAssocId, (Integer) null, null, null, null, null, null, null, null, null)); }
/** * Removes an ItemAssoc-Entry with the given ID from the DB. * * @param itemAssocId Integer */ public int removeItemAssoc(Integer itemAssocId) { // validate input parameters if (itemAssocId == null) { throw new IllegalArgumentException("missing 'itemAssocId'"); } return itemAssocDAO.removeItemAssocsQBE( new ItemAssocVO<Integer,Integer>(itemAssocId, (Integer) null, null, null, null, null, null, null, null, null)); }
.append(String.format("%04f", dsup2)).append(" tsup=").append(tuple.getSupport()).toString(); ItemAssocVO<Integer,Integer> rule = new ItemAssocVO<Integer,Integer>( .append(String.format("%04f", dsup1)).append(" tsup=").append(tuple.getSupport()).toString(); ItemAssocVO<Integer,Integer> rule = new ItemAssocVO<Integer,Integer>(
final ItemAssocVO<Integer,Integer> itemAssoc1 = new ItemAssocVO<Integer,Integer>( tenantId, item1, assocTypeId, similarityValue, item2, sourceTypeId, getSourceInfo(), viewTypeId, null, changeDate); final ItemAssocVO<Integer,Integer> itemAssoc2 = new ItemAssocVO<Integer,Integer>( tenantId, item2, assocTypeId, similarityValue, item1, sourceTypeId, getSourceInfo(), viewTypeId, null, changeDate);
new ItemAssocVO<Integer,Integer>(config.getTenant(), deviation.getItem1(), config.getAssocType(), deviation.getDeviation(), deviation.getItem2(), config.getSourceType(), config.getNonPersonalizedSourceInfo(),
.append(tuple.getSupport()).toString(); ItemAssocVO<Integer,Integer> rule = new ItemAssocVO<Integer,Integer>( configuration.getTenantId(), tuple.getItem1(), configuration.getAssocType(), assocValue1 .append(tuple.getSupport()).toString(); ItemAssocVO<Integer,Integer> rule = new ItemAssocVO<Integer,Integer>( configuration.getTenantId(), tuple.getItem2(), configuration.getAssocType(), assocValue2
public int removeItemFromCluster(ClusterVO cluster, ItemVO<Integer, Integer> item) throws ClusterException { Preconditions.checkNotNull(cluster); Preconditions.checkNotNull(cluster.getItem()); Preconditions.checkNotNull(cluster.getItem().getTenant()); Preconditions.checkNotNull(cluster.getName()); Preconditions.checkNotNull(item); Preconditions.checkNotNull(item.getItem()); Preconditions.checkNotNull(item.getType()); Preconditions.checkArgument(cluster.getItem().getTenant().equals(item.getTenant()), "cluster's tenantId (%s) must be the same as item's tenant id (%s)", cluster.getItem().getTenant(), item.getTenant()); Integer tenantId = cluster.getItem().getTenant(); Integer assocTypeBelongsTo = assocTypeDAO.getIdOfType(tenantId, ClusterService.ASSOCTYPE_BELONGSTO); ItemAssocVO<Integer,Integer> itemAssoc = new ItemAssocVO<Integer,Integer>(tenantId, item, assocTypeBelongsTo, null, cluster.getItem(), null, null, null, null, null); int rowsModified = itemAssocService.removeItemAssocQBE(itemAssoc); if (rowsModified == 0) throw new ClusterException( "The item was not removed from the cluster, maybe the item was not in the cluster."); return rowsModified; }
public int addItemToCluster(ClusterVO cluster, ItemVO<Integer, Integer> item) throws ClusterException { Preconditions.checkNotNull(cluster); Preconditions.checkNotNull(cluster.getItem()); Preconditions.checkNotNull(cluster.getItem().getTenant()); Preconditions.checkNotNull(cluster.getName()); Preconditions.checkNotNull(item); Preconditions.checkNotNull(item.getItem()); Preconditions.checkNotNull(item.getType()); Preconditions.checkArgument(cluster.getItem().getTenant().equals(item.getTenant()), "cluster's tenantId (%s) must be the same as item's tenant id (%s)", cluster.getItem().getTenant(), item.getTenant()); Integer tenantId = cluster.getItem().getTenant(); Integer assocTypeBelongsTo = assocTypeDAO.getIdOfType(tenantId, ClusterService.ASSOCTYPE_BELONGSTO); Integer sourceTypeManuallyCreated = sourceTypeDAO.getIdOfType(tenantId, SourceTypeDAO.SOURCETYPE_MANUALLY_CREATED); Integer viewTypeAdmin = viewTypeDAO.getIdOfType(tenantId, ViewTypeDAO.VIEWTYPE_ADMIN); ItemAssocVO<Integer,Integer> itemAssoc = new ItemAssocVO<Integer,Integer>(tenantId, item, assocTypeBelongsTo, 1.0, cluster.getItem(), sourceTypeManuallyCreated, null, viewTypeAdmin, true, new Date()); try { return itemAssocService.insertOrUpdateItemAssoc(itemAssoc); } catch (DuplicateKeyException e) { throw new ClusterException( "The item was not added to the cluster because the item already was in the cluster."); } }
iAssoc = new ItemAssocVO<Integer,Integer>(null, null, new ItemVO<Integer, Integer>(null, null, null), null, null, new ItemVO<Integer, Integer>(null, null, null), null, null, null, null);
ItemAssocVO<Integer,Integer> itemAssoc = new ItemAssocVO<Integer,Integer>( config.getTenantId(), item, assocType, Math.random() * 100.0, otherItem, sourceType, "Demo Generator", viewType, null, execution);
@Override public ItemAssocVO<Integer, String> convertItemAssocVO(Integer tenantId, ItemAssocVO<Integer,Integer> itemAssoc) { if (itemAssoc == null) { return null; } return new ItemAssocVO<Integer, String>( itemAssoc.getId(), itemAssoc.getTenant(), convertItemVO(tenantId, itemAssoc.getItemFrom()), assocTypeDAO.getTypeById(tenantId, itemAssoc.getAssocType()), itemAssoc.getAssocValue(), convertItemVO(tenantId, itemAssoc.getItemTo()), sourceTypeDAO.getTypeById(tenantId, itemAssoc.getSourceType()), itemAssoc.getSourceInfo(), viewTypeDAO.getTypeById(tenantId, itemAssoc.getViewType()), itemAssoc.isActive(), itemAssoc.getChangeDate()); }
@Override public ItemAssocVO<Integer,Integer> convertTypedItemAssocVO(Integer tenantId, ItemAssocVO<Integer, String> typedItemAssoc) { if (typedItemAssoc == null) { return null; } return new ItemAssocVO<Integer,Integer>( typedItemAssoc.getId(), typedItemAssoc.getTenant(), convertTypedItemVO(tenantId, typedItemAssoc.getItemFrom()), assocTypeDAO.getIdOfType(tenantId, typedItemAssoc.getAssocType()), typedItemAssoc.getAssocValue(), convertTypedItemVO(tenantId, typedItemAssoc.getItemTo()), sourceTypeDAO.getIdOfType(tenantId, typedItemAssoc.getSourceType()), typedItemAssoc.getSourceInfo(), viewTypeDAO.getIdOfType(tenantId, typedItemAssoc.getViewType()), typedItemAssoc.isActive(), typedItemAssoc.getChangeDate()); }
public ItemAssocVO<Integer,Integer> mapRow(ResultSet rs, int rowNum) throws SQLException { ItemAssocVO<Integer,Integer> itemAssoc = new ItemAssocVO<Integer,Integer>( DaoUtils.getInteger(rs, DEFAULT_ID_COLUMN_NAME), DaoUtils.getInteger(rs, DEFAULT_TENANT_COLUMN_NAME), 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.getInteger(rs, DEFAULT_ASSOC_TYPE_COLUMN_NAME), DaoUtils.getDouble(rs, DEFAULT_ASSOC_VALUE_COLUMN_NAME), new ItemVO<Integer, Integer>(DaoUtils.getInteger(rs, DEFAULT_TENANT_COLUMN_NAME), DaoUtils.getInteger(rs, DEFAULT_ITEM_TO_COLUMN_NAME), DaoUtils.getInteger(rs, DEFAULT_ITEM_TO_TYPE_COLUMN_NAME)), DaoUtils.getInteger(rs, DEFAULT_SOURCE_TYPE_COLUMN_NAME), DaoUtils.getStringIfPresent(rs, DEFAULT_SOURCE_INFO_COLUMN_NAME), DaoUtils.getInteger(rs, DEFAULT_VIEW_TYPE_COLUMN_NAME), DaoUtils.getBoolean(rs, DEFAULT_ACTIVE_COLUMN_NAME), DaoUtils.getDate(rs, DEFAULT_CHANGE_DATE_COLUMN_NAME)); return itemAssoc; } }
public ItemAssocVO<Integer, String> mapRow(ResultSet rs, int rowNum) throws SQLException { Integer tenantId = DaoUtils.getInteger(rs, DEFAULT_TENANT_COLUMN_NAME); if (tenantId == null) { throw new IllegalArgumentException( "tenant not specified, can not retrieve type mapping without tenant"); } return new ItemAssocVO<Integer, String>( DaoUtils.getInteger(rs, DEFAULT_ID_COLUMN_NAME), tenantId, new ItemVO<Integer, String>(DaoUtils.getInteger(rs, DEFAULT_TENANT_COLUMN_NAME), DaoUtils.getInteger(rs, DEFAULT_ITEM_FROM_COLUMN_NAME), typeMappingService .getItemTypeById(tenantId, DaoUtils.getInteger(rs, DEFAULT_ITEM_FROM_TYPE_COLUMN_NAME))), typeMappingService .getAssocTypeById(tenantId, DaoUtils.getInteger(rs, DEFAULT_ASSOC_TYPE_COLUMN_NAME)), DaoUtils.getDouble(rs, DEFAULT_ASSOC_VALUE_COLUMN_NAME), new ItemVO<Integer, String>(DaoUtils.getInteger(rs, DEFAULT_TENANT_COLUMN_NAME), DaoUtils.getInteger(rs, DEFAULT_ITEM_TO_COLUMN_NAME), typeMappingService .getItemTypeById(tenantId, DaoUtils.getInteger(rs, DEFAULT_ITEM_TO_TYPE_COLUMN_NAME))), typeMappingService .getSourceTypeById(tenantId, DaoUtils.getInteger(rs, DEFAULT_SOURCE_TYPE_COLUMN_NAME)), DaoUtils.getStringIfPresent(rs, DEFAULT_SOURCE_INFO_COLUMN_NAME), typeMappingService .getViewTypeById(tenantId, DaoUtils.getInteger(rs, DEFAULT_VIEW_TYPE_COLUMN_NAME)), DaoUtils.getBoolean(rs, DEFAULT_ACTIVE_COLUMN_NAME), DaoUtils.getDate(rs, DEFAULT_CHANGE_DATE_COLUMN_NAME)); } }