public DeleteCategory(DataSource dataSource) { super(dataSource, SQL_DELETE_CATEGORY); super.declareParameter(new SqlParameter("idCategory", Types.INTEGER)); }
/** 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() }); }
/** Updates a single row in the stock_in table. */ public void update(StockInPk pk, StockIn dto) throws StockInDaoException { SqlUpdate su = new SqlUpdate( dataSource, "UPDATE " + getTableName() + " SET document_no = ?, document_date = ?, product_code = ?, product_name = ?, quantity = ?, is_active = ?, is_delete = ?, created_by = ?, created_date = ?, updated_by = ?, updated_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.VARCHAR)); su.declareParameter(new SqlParameter(java.sql.Types.INTEGER)); su.declareParameter(new SqlParameter(java.sql.Types.CHAR)); su.declareParameter(new SqlParameter(java.sql.Types.CHAR)); 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.INTEGER)); su.compile(); su.update( new Object[] { dto.getDocumentNo(), dto.getDocumentDate(), dto.getProductCode(), dto.getProductName(), dto.getQuantity(), dto.getIsActive(), dto.getIsDelete(), dto.getCreatedBy(), dto.getCreatedDate(), dto.getUpdatedBy(), dto.getUpdatedDate(), pk.getId() }); }
/** * 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; }
/** * Method 'insert' * * @param dto * @return StockInPk */ public StockInPk insert(StockIn dto) { SqlUpdate su = new SqlUpdate( dataSource, "INSERT INTO " + getTableName() + " ( document_no, document_date, product_code, product_name, quantity, is_active, is_delete, created_by, created_date, updated_by, updated_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.VARCHAR)); su.declareParameter(new SqlParameter(java.sql.Types.INTEGER)); su.declareParameter(new SqlParameter(java.sql.Types.CHAR)); su.declareParameter(new SqlParameter(java.sql.Types.CHAR)); 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.compile(); su.update( new Object[] { dto.getDocumentNo(), dto.getDocumentDate(), dto.getProductCode(), dto.getProductName(), dto.getQuantity(), dto.getIsActive(), dto.getIsDelete(), dto.getCreatedBy(), dto.getCreatedDate(), dto.getUpdatedBy(), dto.getUpdatedDate() }); StockInPk pk = new StockInPk(); pk.setId(jdbcTemplate.queryForInt("select @@IDENTITY")); return pk; }