コード例 #1
0
ファイル: PoDaoImpl.java プロジェクト: rmage/gnvc-ims
 /**
  * Method 'insert'
  *
  * @param dto
  * @return PoPk
  */
 public PoPk insert(Po dto) {
   SqlUpdate su =
       new SqlUpdate(
           dataSource,
           "INSERT INTO "
               + getTableName()
               + " ( ponumber, podate, prsnumber, prsdate, deliverydate, poreferensi, createdby, corpid, wh_code, department_name, supplier_name, currency, prsremarks, role_code,status, status_date,status, status_date_date ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )");
   su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
   su.declareParameter(new SqlParameter(java.sql.Types.TIMESTAMP));
   su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
   su.declareParameter(new SqlParameter(java.sql.Types.TIMESTAMP));
   su.declareParameter(new SqlParameter(java.sql.Types.TIMESTAMP));
   su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
   su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
   su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
   su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
   su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
   su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
   su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
   su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
   su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
   su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
   su.declareParameter(new SqlParameter(java.sql.Types.TIMESTAMP));
   su.compile();
   su.update(
       new Object[] {
         dto.getPonumber(),
         dto.getPodate(),
         dto.getPrsnumber(),
         dto.getPrsdate(),
         dto.getDeliverydate(),
         dto.getPoreferensi(),
         dto.getCreatedby(),
         dto.getCorpid(),
         dto.getWhCode(),
         dto.getDepartmentName(),
         dto.getSupplierName(),
         dto.getCurrency(),
         dto.getPrsremarks(),
         dto.getRoleCode(),
         dto.getStatus(),
         dto.getStatusdate()
       });
   PoPk pk = new PoPk();
   pk.setId(jdbcTemplate.queryForInt("select @@IDENTITY"));
   return pk;
 }
コード例 #2
0
ファイル: PoDaoImpl.java プロジェクト: rmage/gnvc-ims
 /** Updates a single row in the po table. */
 public void update(PoPk pk, Po dto) throws PoDaoException {
   SqlUpdate su =
       new SqlUpdate(
           dataSource,
           "UPDATE "
               + getTableName()
               + " SET ponumber = ?, podate = ?, prsnumber = ?, prsdate = ?, deliverydate = ?, poreferensi = ?, createdby = ?, corpid = ?, wh_code = ?, department_name = ?, supplier_name = ?, currency = ?, prsremarks = ?, role_code = ?,status, status_date = ?,status, status_date_date = ? WHERE id = ?");
   su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
   su.declareParameter(new SqlParameter(java.sql.Types.TIMESTAMP));
   su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
   su.declareParameter(new SqlParameter(java.sql.Types.TIMESTAMP));
   su.declareParameter(new SqlParameter(java.sql.Types.TIMESTAMP));
   su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
   su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
   su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
   su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
   su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
   su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
   su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
   su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
   su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
   su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
   su.declareParameter(new SqlParameter(java.sql.Types.TIMESTAMP));
   su.declareParameter(new SqlParameter(java.sql.Types.BIGINT));
   su.compile();
   su.update(
       new Object[] {
         dto.getPonumber(),
         dto.getPodate(),
         dto.getPrsnumber(),
         dto.getPrsdate(),
         dto.getDeliverydate(),
         dto.getPoreferensi(),
         dto.getCreatedby(),
         dto.getCorpid(),
         dto.getWhCode(),
         dto.getDepartmentName(),
         dto.getSupplierName(),
         dto.getCurrency(),
         dto.getPrsremarks(),
         dto.getRoleCode(),
         dto.getStatus(),
         dto.getStatusdate(),
         pk.getId()
       });
 }
コード例 #3
0
ファイル: PoDaoImpl.java プロジェクト: rmage/gnvc-ims
 /** Returns the rows from the po table that matches the specified primary-key value. */
 public Po findByPrimaryKey(PoPk pk) throws PoDaoException {
   return findByPrimaryKey(pk.getId());
 }
コード例 #4
0
ファイル: PoDaoImpl.java プロジェクト: rmage/gnvc-ims
 /** Deletes a single row in the po table. */
 @Transactional
 public void delete(PoPk pk) throws PoDaoException {
   jdbcTemplate.update("DELETE FROM " + getTableName() + " WHERE id = ?", pk.getId());
 }