@Test @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) public void testCreateId() { final Long createdId = daoHelper.createId(JUNIT_SEQUENCE_NAME); assertNotNull("The next sequence value isn't generated.", createdId); assertTrue("Unexpected next sequence value.", createdId >= 1); }
@Transactional(propagation = Propagation.MANDATORY) public Long createId(final String sequenceName) { Assert.isTrue(StringUtils.isNotBlank(sequenceName)); return getNamedParameterJdbcTemplate().queryForObject(createIdQuery, new MapSqlParameterSource(HelperParameters.SEQUENCE_NAME.name(), sequenceName), Long.class); }
DaoHelper extends NamedParameterJdbcDaoSupport { @Transactional(propagation = Propagation.MANDATORY) public Long createId(final String sequenceName) { Assert.isTrue(StringUtils.isNotBlank(sequenceName)); return getNamedParameterJdbcTemplate().queryForObject(createIdQuery, new MapSqlParameterSource(HelperParameters.SEQUENCE_NAME.name(), sequenceName), Long.class); } }
DaoHelper extends NamedParameterJdbcDaoSupport { @Transactional(propagation = Propagation.MANDATORY) public Long createId(final String sequenceName) { Assert.isTrue(StringUtils.isNotBlank(sequenceName)); return getNamedParameterJdbcTemplate().queryForObject(createIdQuery, new MapSqlParameterSource(HelperParameters.SEQUENCE_NAME.name(), sequenceName), Long.class); }  }
DaoHelper extends NamedParameterJdbcDaoSupport { @Transactional(propagation = Propagation.MANDATORY) public Long createId(final String sequenceName) { Assert.isTrue(StringUtils.isNotBlank(sequenceName)); return getNamedParameterJdbcTemplate().queryForObject(createIdQuery, new MapSqlParameterSource(HelperParameters.SEQUENCE_NAME.name(), sequenceName), Long.class); }  @Required void setCreateIdQuery(final String createIdQuery); @Transactional(propagation = Propagation.MANDATORY) Long createId(final String sequenceName); static String getQueryFilledWithIdArray(String queryTemplate, Collection<?> ids); static String getQueryFilledWithStringArray(String queryTemplate, Collection<String> ids); static String getQueryFilledWithTempTable(String queryTemplate, Collection<?> ids); @Required void setCreateIdsQuery(final String createIdsQuery); @Transactional(propagation = Propagation.MANDATORY) List<Long> createIds(final String sequenceName, final int count); String escapeUnderscore(String query); static String replaceInClause(String query, int paramsCount); }
DaoHelper extends NamedParameterJdbcDaoSupport { @Transactional(propagation = Propagation.MANDATORY) public Long createId(final String sequenceName) { Assert.isTrue(StringUtils.isNotBlank(sequenceName)); return getNamedParameterJdbcTemplate().queryForObject(createIdQuery, new MapSqlParameterSource(HelperParameters.SEQUENCE_NAME.name(), sequenceName), Long.class); }  @Required void setCreateIdQuery(final String createIdQuery); @Transactional(propagation = Propagation.MANDATORY) Long createId(final String sequenceName); static String getQueryFilledWithIdArray(String queryTemplate, Collection<?> ids); static String getQueryFilledWithStringArray(String queryTemplate, Collection<String> ids); static String getQueryFilledWithTempTable(String queryTemplate, Collection<?> ids); @Required void setCreateIdsQuery(final String createIdsQuery); @Transactional(propagation = Propagation.MANDATORY) List<Long> createIds(final String sequenceName, final int count); String escapeUnderscore(String query); static String replaceInClause(String query, int paramsCount); static final String QUOTE; }