• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ActionVO类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.easyrec.model.core.ActionVO的典型用法代码示例。如果您正苦于以下问题:Java ActionVO类的具体用法?Java ActionVO怎么用?Java ActionVO使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ActionVO类属于org.easyrec.model.core包,在下文中一共展示了ActionVO类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: insertActions

import org.easyrec.model.core.ActionVO; //导入依赖的package包/类
public int insertActions(List<ActionVO<Integer, Integer>> actions) {
    final int BULK_SIZE = 100;
    final int BULK_COUNT = ((actions.size() + BULK_SIZE) - 1) / BULK_SIZE;

    int result = 0;

    for (int bulk = 0; bulk < BULK_COUNT; bulk++) {
        int fromIdx = bulk * BULK_SIZE;
        int toIdx = (bulk + 1) * BULK_SIZE;
        toIdx = Math.min(toIdx, actions.size());

        List<ActionVO<Integer, Integer>> thisBulk = actions.subList(fromIdx, toIdx);
        result = insertActionsBulk(BULK_SIZE, thisBulk, result);
    }

    return result;
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:18,代码来源:ActionDAOMysqlImpl.java


示例2: mapRow

import org.easyrec.model.core.ActionVO; //导入依赖的package包/类
@Override
public ActionVO<Integer, Integer> mapRow(ResultSet rs, int rowNum)
        throws SQLException {
    ActionVO<Integer, Integer> actionVO =
            new ActionVO<>(
                    DaoUtils.getLong(rs, DEFAULT_ID_COLUMN_NAME),
                    DaoUtils.getInteger(rs, DEFAULT_TENANT_COLUMN_NAME),
                    DaoUtils.getInteger(rs, DEFAULT_USER_COLUMN_NAME),
                    DaoUtils.getStringIfPresent(rs, DEFAULT_SESSION_COLUMN_NAME),
                    DaoUtils.getStringIfPresent(rs, DEFAULT_IP_COLUMN_NAME),
                    new ItemVO<>(DaoUtils.getInteger(rs, DEFAULT_TENANT_COLUMN_NAME),
                            DaoUtils.getInteger(rs, DEFAULT_ITEM_COLUMN_NAME),
                            DaoUtils.getInteger(rs, DEFAULT_ITEM_TYPE_COLUMN_NAME)),
                    DaoUtils.getInteger(rs, DEFAULT_ACTION_TYPE_COLUMN_NAME),
                    DaoUtils.getInteger(rs, DEFAULT_RATING_VALUE_COLUMN_NAME),
                    DaoUtils.getStringIfPresent(rs, DEFAULT_ACTIONINFO_COLUMN_NAME),
                    DaoUtils.getDate(rs, DEFAULT_ACTION_TIME_COLUMN_NAME));
    return actionVO;
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:20,代码来源:AggregatorActionDAOMysqlImpl.java


示例3: mapRow

import org.easyrec.model.core.ActionVO; //导入依赖的package包/类
public ActionVO<Integer, String> mapRow(ResultSet rs, int rowNum)
        throws SQLException {
    Integer tenantId = DaoUtils.getInteger(rs, DEFAULT_TENANT_COLUMN_NAME);

    return new ActionVO<>(
            DaoUtils.getLong(rs, DEFAULT_ID_COLUMN_NAME), tenantId,
            DaoUtils.getInteger(rs, DEFAULT_USER_COLUMN_NAME),
            DaoUtils.getStringIfPresent(rs, DEFAULT_SESSION_COLUMN_NAME),
            DaoUtils.getStringIfPresent(rs, DEFAULT_IP_COLUMN_NAME),
            new ItemVO<>(DaoUtils.getInteger(rs, DEFAULT_TENANT_COLUMN_NAME),
                    DaoUtils.getInteger(rs, DEFAULT_ITEM_COLUMN_NAME), typeMappingService
                    .getItemTypeById(tenantId, DaoUtils.getInteger(rs, DEFAULT_ITEM_TYPE_COLUMN_NAME))),
            typeMappingService
                    .getActionTypeById(tenantId,
                            DaoUtils.getInteger(rs, DEFAULT_ACTION_TYPE_COLUMN_NAME)),
            DaoUtils.getInteger(rs, DEFAULT_RATING_VALUE_COLUMN_NAME),
            DaoUtils.getStringIfPresent(rs, DEFAULT_ACTIONINFO_COLUMN_NAME),
            DaoUtils.getDate(rs, DEFAULT_ACTION_TIME_COLUMN_NAME));
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:20,代码来源:TypedActionDAOMysqlImpl.java


示例4: insertAction

import org.easyrec.model.core.ActionVO; //导入依赖的package包/类
@Override
public int insertAction(ActionVO<Integer, Integer> action, boolean useDateFromVO) {
    if (logger.isTraceEnabled()) {
        logger.trace("inserting action=" + action);
    }

    // validate non-empty fields (NOT NULL)
    validateNonEmptyFields(action, useDateFromVO);

    Object[] args = {action.getTenant(), action.getUser(), action.getSessionId(), action.getIp(),
            ((action.getItem() != null) ? action.getItem().getItem() : null),
            ((action.getItem() != null) ? action.getItem().getType() : null), action.getActionType(),
            action.getRatingValue(), 
            action.getActionInfo(), ((useDateFromVO && action.getActionTime() != null) ? action.getActionTime() :
                                      new Date(System.currentTimeMillis()))};

    KeyHolder keyHolder = new GeneratedKeyHolder();

    int rowsAffected = getJdbcTemplate().update(PS_INSERT_ACTION.newPreparedStatementCreator(args), keyHolder);

    // retrieve auto increment id, and set to VO
    action.setId(keyHolder.getKey().longValue());

    return rowsAffected;
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:26,代码来源:ActionDAOMysqlImpl.java


示例5: validateNonEmptyFields

import org.easyrec.model.core.ActionVO; //导入依赖的package包/类
private void validateNonEmptyFields(ActionVO<Integer, Integer> action,
                                    boolean useDateFromVO) {
    if (action.getTenant() == null) {
        throw new IllegalArgumentException(
                "missing constraints, unique key (tenantId, itemTypeId, actionTypeId, actionTime) must be set, missing 'tenantId'");
    }
    if (action.getItem() == null) {
        throw new IllegalArgumentException(
                "missing constraints, unique key (tenantId, itemTypeId, actionTypeId, actionTime) must be set, missing 'item'");
    }
    if (action.getItem().getType() == null) {
        throw new IllegalArgumentException(
                "missing constraints, unique key (tenantId, itemTypeId, actionTypeId, actionTime) must be set, missing 'itemTypeId'");
    }
    if (action.getActionType() == null) {
        throw new IllegalArgumentException(
                "missing constraints, unique key (tenantId, itemTypeId, actionTypeId, actionTime) must be set, missing 'actionTypeId'");
    }
    // in case of automatically generated 'actionTime' on database level leave out check for null
    if (useDateFromVO && action.getActionTime() == null) {
        throw new IllegalArgumentException(
                "missing constraints, unique key (tenantId, itemTypeId, actionTypeId, actionTime) must be set, missing 'actionTime'");
    }
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:25,代码来源:ActionDAOMysqlImpl.java


示例6: mapRow

import org.easyrec.model.core.ActionVO; //导入依赖的package包/类
public ActionVO<Integer, Integer> mapRow(ResultSet rs, int rowNum)
        throws SQLException {
    ActionVO<Integer, Integer> actionVO =
            new ActionVO<>(
                    DaoUtils.getLong(rs, DEFAULT_ID_COLUMN_NAME),
                    DaoUtils.getInteger(rs, DEFAULT_TENANT_COLUMN_NAME),
                    DaoUtils.getInteger(rs, DEFAULT_USER_COLUMN_NAME),
                    DaoUtils.getStringIfPresent(rs, DEFAULT_SESSION_COLUMN_NAME),
                    DaoUtils.getStringIfPresent(rs, DEFAULT_IP_COLUMN_NAME),
                    new ItemVO<>(DaoUtils.getInteger(rs, DEFAULT_TENANT_COLUMN_NAME),
                            DaoUtils.getInteger(rs, DEFAULT_ITEM_COLUMN_NAME),
                            DaoUtils.getInteger(rs, DEFAULT_ITEM_TYPE_COLUMN_NAME)),
                    DaoUtils.getInteger(rs, DEFAULT_ACTION_TYPE_COLUMN_NAME),
                    DaoUtils.getInteger(rs, DEFAULT_RATING_VALUE_COLUMN_NAME),
                    DaoUtils.getStringIfPresent(rs, DEFAULT_ACTIONINFO_COLUMN_NAME),
                    DaoUtils.getDate(rs, DEFAULT_ACTION_TIME_COLUMN_NAME));
    return actionVO;
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:19,代码来源:ActionDAOMysqlImpl.java


示例7: testInsertAction

import org.easyrec.model.core.ActionVO; //导入依赖的package包/类
@Test
@DataSet(DATA_FILENAME_ONE_LESS)
@ExpectedDataSet(DATA_FILENAME_NO_ACTIONTIME)
public void testInsertAction() {
    ActionVO<Integer, Integer> action = null;
    try {
        action = new ActionVO<>(2, 2, "abc5", "127.0.0.1",
                new ItemVO<>(2, 1, 1), 1, null, null);
    } catch (Exception e) {
        fail("caught exception: " + e);
    }
    assertTrue(action.getId() == null);
    actionDAO.insertAction(action, false);

    assertThat(action.getId(), is(not(1l)));
    assertThat(action.getId(), is(not(2l)));
    assertThat(action.getId(), is(not(3l)));
    assertThat(action.getId(), is(not(4l)));
    assertThat(action.getId(), is(not(5l)));
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:21,代码来源:ActionDAOTest.java


示例8: testGetActionIteratorConstraintsBoth

import org.easyrec.model.core.ActionVO; //导入依赖的package包/类
@Test
public void testGetActionIteratorConstraintsBoth() {
    Iterator<ActionVO<Integer, Integer>> actions = null;
    try {
        actions = actionDAO.getActionIterator(5000,
                new TimeConstraintVO(new Date(new GregorianCalendar(2007, 3, 15, 12, 12).getTimeInMillis()),
                        new Date(new GregorianCalendar(2007, 3, 15, 12, 15).getTimeInMillis())));
    } catch (Exception e) {
        fail("caught exception: " + e);
    }
    assertTrue(actions != null);
    List<ActionVO<Integer, Integer>> actionsList = iteratorToList(actions);
    assertEquals(4, actionsList.size());

    // HINT: hardcoded check if list equals expected list (Mantis Issue: #721)
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:17,代码来源:ActionDAOTest.java


示例9: mapRow

import org.easyrec.model.core.ActionVO; //导入依赖的package包/类
public ActionVO<Integer, String> mapRow(ResultSet rs, int rowNum)
        throws SQLException {
    Integer tenantId = DaoUtils.getInteger(rs, DEFAULT_TENANT_COLUMN_NAME);

    return new ActionVO<Integer, String>(
            DaoUtils.getInteger(rs, DEFAULT_ID_COLUMN_NAME), tenantId,
            DaoUtils.getInteger(rs, DEFAULT_USER_COLUMN_NAME),
            DaoUtils.getStringIfPresent(rs, DEFAULT_SESSION_COLUMN_NAME),
            DaoUtils.getStringIfPresent(rs, DEFAULT_IP_COLUMN_NAME),
            new ItemVO<Integer, String>(DaoUtils.getInteger(rs, DEFAULT_TENANT_COLUMN_NAME),
                    DaoUtils.getInteger(rs, DEFAULT_ITEM_COLUMN_NAME), typeMappingService
                    .getItemTypeById(tenantId, DaoUtils.getInteger(rs, DEFAULT_ITEM_TYPE_COLUMN_NAME))),
            typeMappingService
                    .getActionTypeById(tenantId,
                            DaoUtils.getInteger(rs, DEFAULT_ACTION_TYPE_COLUMN_NAME)),
            DaoUtils.getInteger(rs, DEFAULT_RATING_VALUE_COLUMN_NAME),
            DaoUtils.getBoolean(rs, DEFAULT_SEARCH_SUCCEEDED_COLUMN_NAME),
            DaoUtils.getInteger(rs, DEFAULT_NUMBER_OF_FOUND_ITEMS),
            DaoUtils.getStringIfPresent(rs, DEFAULT_DESCRIPTION_COLUMN_NAME),
            DaoUtils.getDate(rs, DEFAULT_ACTION_TIME_COLUMN_NAME));
}
 
开发者ID:customertimes,项目名称:easyrec-PoC,代码行数:22,代码来源:TypedActionDAOMysqlImpl.java


示例10: insertAction

import org.easyrec.model.core.ActionVO; //导入依赖的package包/类
@Override
public int insertAction(ActionVO<Integer, Integer> action, boolean useDateFromVO) {
    if (logger.isTraceEnabled()) {
        logger.trace("inserting action=" + action);
    }

    // validate non-empty fields (NOT NULL)
    validateNonEmptyFields(action, useDateFromVO);

    Object[] args = {action.getTenant(), action.getUser(), action.getSessionId(), action.getIp(),
            ((action.getItem() != null) ? action.getItem().getItem() : null),
            ((action.getItem() != null) ? action.getItem().getType() : null), action.getActionType(),
            action.getRatingValue(), action.getSearchSucceeded(), action.getNumberOfFoundItems(),
            action.getDescription(), ((useDateFromVO && action.getActionTime() != null) ? action.getActionTime() :
                                      new Date(System.currentTimeMillis()))};

    KeyHolder keyHolder = new GeneratedKeyHolder();

    int rowsAffected = getJdbcTemplate().update(PS_INSERT_ACTION.newPreparedStatementCreator(args), keyHolder);

    // retrieve auto increment id, and set to VO
    action.setId(keyHolder.getKey().intValue());

    return rowsAffected;
}
 
开发者ID:customertimes,项目名称:easyrec-PoC,代码行数:26,代码来源:ActionDAOMysqlImpl.java


示例11: mapRow

import org.easyrec.model.core.ActionVO; //导入依赖的package包/类
public ActionVO<Integer, Integer> mapRow(ResultSet rs, int rowNum)
        throws SQLException {
    ActionVO<Integer, Integer> actionVO =
            new ActionVO<Integer, Integer>(
                    DaoUtils.getInteger(rs, DEFAULT_ID_COLUMN_NAME),
                    DaoUtils.getInteger(rs, DEFAULT_TENANT_COLUMN_NAME),
                    DaoUtils.getInteger(rs, DEFAULT_USER_COLUMN_NAME),
                    DaoUtils.getStringIfPresent(rs, DEFAULT_SESSION_COLUMN_NAME),
                    DaoUtils.getStringIfPresent(rs, DEFAULT_IP_COLUMN_NAME),
                    new ItemVO<Integer, Integer>(DaoUtils.getInteger(rs, DEFAULT_TENANT_COLUMN_NAME),
                            DaoUtils.getInteger(rs, DEFAULT_ITEM_COLUMN_NAME),
                            DaoUtils.getInteger(rs, DEFAULT_ITEM_TYPE_COLUMN_NAME)),
                    DaoUtils.getInteger(rs, DEFAULT_ACTION_TYPE_COLUMN_NAME),
                    DaoUtils.getInteger(rs, DEFAULT_RATING_VALUE_COLUMN_NAME),
                    DaoUtils.getBoolean(rs, DEFAULT_SEARCH_SUCCEEDED_COLUMN_NAME),
                    DaoUtils.getInteger(rs, DEFAULT_NUMBER_OF_FOUND_ITEMS),
                    DaoUtils.getStringIfPresent(rs, DEFAULT_DESCRIPTION_COLUMN_NAME),
                    DaoUtils.getDate(rs, DEFAULT_ACTION_TIME_COLUMN_NAME));
    return actionVO;
}
 
开发者ID:customertimes,项目名称:easyrec-PoC,代码行数:21,代码来源:ActionDAOMysqlImpl.java


示例12: testInsertAction

import org.easyrec.model.core.ActionVO; //导入依赖的package包/类
@Test
@DataSet(DATA_FILENAME_ONE_LESS)
@ExpectedDataSet(DATA_FILENAME_NO_ACTIONTIME)
public void testInsertAction() {
    ActionVO<Integer, Integer> action = null;
    try {
        action = new ActionVO<Integer, Integer>(2, 2, "abc5", "127.0.0.1",
                new ItemVO<Integer, Integer>(2, 1, 1), 1, null, null, null, null);
    } catch (Exception e) {
        fail("caught exception: " + e);
    }
    assertTrue(action.getId() == null);
    actionDAO.insertAction(action, false);

    assertThat(action.getId(), is(not(1)));
    assertThat(action.getId(), is(not(2)));
    assertThat(action.getId(), is(not(3)));
    assertThat(action.getId(), is(not(4)));
    assertThat(action.getId(), is(not(5)));
}
 
开发者ID:customertimes,项目名称:easyrec-PoC,代码行数:21,代码来源:ActionDAOTest.java


示例13: generateActions

import org.easyrec.model.core.ActionVO; //导入依赖的package包/类
public int generateActions(int tenantId, TIntSet itemTypeIds, int actionTypeId, Date since) {
    Preconditions.checkNotNull(itemTypeIds);
    Preconditions.checkArgument(itemTypeIds.size() > 0, "at least one itemtype must be given");

    if (since == null) since = getNewestActionDate(tenantId, itemTypeIds);

    if (isOnSameDataSourceAsEasyrec()) {
        Object[] args = new Object[]{tenantId, actionTypeId, since};

        String query = QUERY_GENERATE.replace("@@@", generateItemTypeInClause(itemTypeIds));

        return getJdbcTemplate().update(query, args, ARGT_GENERATE);
    }

    // when not on same datasource the tenantId is ignored and all actions are copied

    Iterator<ActionVO<Integer, Integer>> actions = actionDAO
            .getActionIterator(5000, new TimeConstraintVO(since, null));
    int result = 0;

    while (actions.hasNext()) {
        ActionVO<Integer, Integer> actionVO = actions.next();

        if (actionVO.getTenant() != tenantId) continue;
        if (actionVO.getActionType() != actionTypeId) continue;
        if (!itemTypeIds.contains(actionVO.getItem().getType())) continue;

        result += insertAction(actionVO);
    }

    return result;
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:33,代码来源:ActionDAOMysqlImpl.java


示例14: insertAction

import org.easyrec.model.core.ActionVO; //导入依赖的package包/类
public int insertAction(ActionVO<Integer, Integer> action) {
    String query = QUERY_INSERT + QUERY_INSERT_VALUE;
    query = query.substring(0, query.length() - 2);

    Object[] args = new Object[]{action.getTenant(), action.getUser(), action.getItem().getItem(),
            action.getItem().getType(), action.getRatingValue(), action.getActionTime()};

    return getJdbcTemplate().update(query, args, ARGT_INSERT);
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:10,代码来源:ActionDAOMysqlImpl.java


示例15: insertActionsBulk

import org.easyrec.model.core.ActionVO; //导入依赖的package包/类
private int insertActionsBulk(final int bulkSize,
                              final List<ActionVO<Integer, Integer>> thisBulk,
                              int currentResult) {
    List<Object> args = new ArrayList<Object>(thisBulk.size() * ARGT_INSERT.length);

    StringBuilder query = new StringBuilder(QUERY_INSERT);
    TIntArrayList argt = new TIntArrayList(bulkSize * ARGT_INSERT.length);

    //noinspection ForLoopReplaceableByForEach
    for (int i = 0; i < thisBulk.size(); i++) {
        query.append(QUERY_INSERT_VALUE);
        argt.addAll(ARGT_INSERT);
    }

    query.replace(query.length() - 2, query.length(), "");

    for (ActionVO<Integer, Integer> action : thisBulk) {
        args.add(action.getTenant());
        args.add(action.getUser());
        args.add(action.getItem().getItem());
        args.add(action.getItem().getType());
        args.add(action.getRatingValue());
        args.add(action.getActionTime());
    }

    try {
        currentResult += getJdbcTemplate().update(query.toString(), args.toArray(), argt.toArray());
    } catch (Exception e) {
        logger.warn("An error occurred!", e);
    }
    return currentResult;
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:33,代码来源:ActionDAOMysqlImpl.java


示例16: insertAction_shouldStoreActionOnce

import org.easyrec.model.core.ActionVO; //导入依赖的package包/类
@Test
public void insertAction_shouldStoreActionOnce() {
    final long ID = 100;
    final int TENANT = 1;
    final int ITEM = 10;
    final int ITEMTYPE = 1;
    final int USER = 10;
    final int RATINGVALUE = 20;
    TIntSet itemTypeIds = new TIntHashSet(new int[]{ITEMTYPE});

    ActionVO<Integer, Integer> action =
            new ActionVO<>(
                    ID, TENANT, USER, null, null, new ItemVO<>(TENANT, ITEM, ITEMTYPE), 2,
                    RATINGVALUE, null, createDate("2007-04-15 13:01:00.0"));

    int rowsModified = actionDAO.insertAction(action);

    assertThat(rowsModified, is(1));

    action.setActionTime(new Date());
    action.setRatingValue(100);
    rowsModified = actionDAO.insertAction(action);

    assertThat(rowsModified, is(0));

    List<RatingVO<Integer, Integer>> ratings = actionDAO.getRatings(TENANT, itemTypeIds, USER);

    assertThat(ratings.size(), is(1));
    assertThat(ratings, hasItem(equalTo(createRating(ITEM, USER, RATINGVALUE, "2007-04-15 13:01:00.0"))));
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:31,代码来源:ActionDAOMysqlImplTest.java


示例17: insertActions_shouldStoreActionsOnce

import org.easyrec.model.core.ActionVO; //导入依赖的package包/类
@Test
@SuppressWarnings({"unchecked"})
public void insertActions_shouldStoreActionsOnce() {
    final long ID = 100;
    final int TENANT = 1;
    final int ITEM = 10;
    final int ITEMTYPE = 1;
    final int USER = 10;
    final int RATINGVALUE = 20;
    TIntSet itemTypeIds = new TIntHashSet(new int[]{1});

    ActionVO<Integer, Integer> action1 =
            new ActionVO<>(
                    ID + 1, TENANT, USER, null, null,
                    new ItemVO<>(TENANT, ITEM + 1, ITEMTYPE), 2,
                    RATINGVALUE + 1, null, createDate("2007-04-15 13:01:00.0"));
    ActionVO<Integer, Integer> action2 =
            new ActionVO<>(
                    ID + 2, TENANT, USER, null, null,
                    new ItemVO<>(TENANT, ITEM + 2, ITEMTYPE), 2,
                    RATINGVALUE + 2, null, createDate("2007-04-15 13:02:00.0"));
    ActionVO<Integer, Integer> action3 =
            new ActionVO<>(
                    ID + 3, TENANT, USER, null, null,
                    new ItemVO<>(TENANT, ITEM + 1, ITEMTYPE), 2,
                    RATINGVALUE + 3, null, createDate("2007-04-15 13:03:00.0"));
    List<ActionVO<Integer, Integer>> actions = Arrays.asList(action1, action2, action3);

    int rowsModified = actionDAO.insertActions(actions);

    assertThat(rowsModified, is(2));

    List<RatingVO<Integer, Integer>> ratings = actionDAO.getRatings(TENANT, itemTypeIds, USER);

    assertThat(ratings.size(), is(2));
    assertThat(ratings, hasItem(equalTo(createRating(ITEM + 1, USER, RATINGVALUE + 1, "2007-04-15 13:01:00.0"))));
    assertThat(ratings, hasItem(equalTo(createRating(ITEM + 2, USER, RATINGVALUE + 2, "2007-04-15 13:02:00.0"))));
    assertThat(ratings,
            not(hasItem(equalTo(createRating(ITEM + 1, USER, RATINGVALUE + 3, "2007-04-15 13:03:00.0")))));
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:41,代码来源:ActionDAOMysqlImplTest.java


示例18: getActionsForUsers

import org.easyrec.model.core.ActionVO; //导入依赖的package包/类
@Override
    public List<ActionVO<Integer,Integer>> getActionsForUsers(Integer userId, AggregatorConfigurationInt configuration) {
        
        //sort by itemID, then check on itemID,typeID change look in profile -> this way only 1 query is needed 
        List<Object> args = Lists.newArrayList();
        List<Integer> argt = Lists.newArrayList();
        
        // get all Baskets
        StringBuilder query = new StringBuilder();
        query.append("SELECT * FROM ").append(BaseActionDAO.DEFAULT_TABLE_NAME);
        query.append(" WHERE ").append(BaseActionDAO.DEFAULT_TENANT_COLUMN_NAME).append("=")
                .append(configuration.getTenantId()).append(" AND ").append(BaseActionDAO.DEFAULT_USER_COLUMN_NAME)
                .append("=").append(userId);
        if (configuration.getActionType() != null) {
        query.append(" AND ").append(BaseActionDAO.DEFAULT_ACTION_TYPE_COLUMN_NAME).append("=?");
                args.add(configuration.getActionType());
                argt.add(Types.INTEGER);
        }
        
        // delta updates don't work since we only store Top x of every field
//        if (configuration.getLastRun() != null) {
//            query.append(" AND ").append(BaseActionDAO.DEFAULT_ACTION_TIME_COLUMN_NAME).append(">=?");
//                args.add(configuration.getLastRun());
//                argt.add(Types.TIMESTAMP);
//        }
        
        query.append(" ORDER BY ").append(BaseActionDAO.DEFAULT_ITEM_COLUMN_NAME).append(" ASC");
        
        
        return getJdbcTemplate().query(query.toString(), args.toArray(), Ints.toArray(argt), actionVORowMapper);
        
        
        // only if config for itemprofile, load the item profile
        
    }
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:36,代码来源:AggregatorActionDAOMysqlImpl.java


示例19: previewTrack

import org.easyrec.model.core.ActionVO; //导入依赖的package包/类
@Override
public void previewTrack(Integer tenant, Integer user, String sessionId, String ip, Integer trackId,
                         String description) {
    insertAction(new ActionVO<>(tenant, user, sessionId, ip,
            new ItemVO<>(tenant, trackId, TypeMappingService.ITEM_TYPE_TRACK),
            TypeMappingService.ACTION_TYPE_PREVIEW, null, description));
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:8,代码来源:MusicActionServiceImpl.java


示例20: addTrackToPlaylist

import org.easyrec.model.core.ActionVO; //导入依赖的package包/类
@Override
public void addTrackToPlaylist(Integer tenant, Integer user, String sessionId, String ip, Integer trackId,
                               String description) {
    insertAction(new ActionVO<>(tenant, user, sessionId, ip,
            new ItemVO<>(tenant, trackId, TypeMappingService.ITEM_TYPE_TRACK),
            TypeMappingService.ACTION_TYPE_ADD_TO_PLAYLIST, null, description));
}
 
开发者ID:major2015,项目名称:easyrec_major,代码行数:8,代码来源:MusicActionServiceImpl.java



注:本文中的org.easyrec.model.core.ActionVO类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DiscreteDistribution类代码示例发布时间:2022-05-16
下一篇:
Java NotAuthorizedException类代码示例发布时间:2022-05-16
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap