コード例 #1
0
 /**
  * Method 'insert'
  *
  * @param dto
  * @return StatusCodePk
  */
 public StatusCodePk insert(StatusCode dto) {
   getJdbcTemplate()
       .update(
           "INSERT INTO "
               + getTableName()
               + " ( CODE_NAME, CODE_VALUE, DELETE_IND ) VALUES ( ?, ?, ? )",
           dto.getCodeName(),
           dto.getCodeValue(),
           dto.getDeleteInd());
   StatusCodePk pk = new StatusCodePk();
   pk.setId(getJdbcTemplate().queryForInt("select last_insert_id()"));
   return pk;
 }
コード例 #2
0
 /** Updates a single row in the STATUS_CODE table. */
 public void update(StatusCodePk pk, StatusCode dto) throws DataBaseJdbcException {
   getJdbcTemplate()
       .update(
           "UPDATE "
               + getTableName()
               + " SET ID = ?, CODE_NAME = ?, CODE_VALUE = ?, DELETE_IND = ? WHERE ID = ?",
           dto.getId(),
           dto.getCodeName(),
           dto.getCodeValue(),
           dto.getDeleteInd(),
           pk.getId());
 }
コード例 #3
0
 /** Deletes a single row in the STATUS_CODE table. */
 public void delete(StatusCodePk pk) throws DataBaseJdbcException {
   getJdbcTemplate().update("DELETE FROM " + getTableName() + " WHERE ID = ?", pk.getId());
 }
コード例 #4
0
 /** Returns the rows from the STATUS_CODE table that matches the specified primary-key value. */
 public StatusCode findByPrimaryKey(StatusCodePk pk) throws DataBaseJdbcException {
   return findByPrimaryKey(pk.getId());
 }