Java 类org.springframework.jdbc.core.SqlParameter 实例源码

项目:lams    文件:RdbmsOperation.java   
/**
 * Validate the named parameters passed to an execute method based on declared parameters.
 * Subclasses should invoke this method before every {@code executeQuery()} or
 * {@code update()} method.
 * @param parameters parameter Map supplied. May be {@code null}.
 * @throws InvalidDataAccessApiUsageException if the parameters are invalid
 */
protected void validateNamedParameters(Map<String, ?> parameters) throws InvalidDataAccessApiUsageException {
    checkCompiled();
    Map<String, ?> paramsToUse = (parameters != null ? parameters : Collections.<String, Object> emptyMap());
    int declaredInParameters = 0;
    for (SqlParameter param : this.declaredParameters) {
        if (param.isInputValueProvided()) {
            if (!supportsLobParameters() &&
                    (param.getSqlType() == Types.BLOB || param.getSqlType() == Types.CLOB)) {
                throw new InvalidDataAccessApiUsageException(
                        "BLOB or CLOB parameters are not allowed for this kind of operation");
            }
            if (param.getName() != null && !paramsToUse.containsKey(param.getName())) {
                throw new InvalidDataAccessApiUsageException("The parameter named '" + param.getName() +
                        "' was not among the parameters supplied: " + paramsToUse.keySet());
            }
            declaredInParameters++;
        }
    }
    validateParameterCount(paramsToUse.size(), declaredInParameters);
}
项目:buffer-slayer    文件:BatchJdbcTemplateTest.java   
@Test
public void updateWithPreparedStatementCreator() {
  reporter = AsyncReporter.builder(new JdbcTemplateSender(underlying))
      .pendingMaxMessages(2)
      .bufferedMaxMessages(2)
      .messageTimeout(0, TimeUnit.MILLISECONDS)
      .build();
  batchJdbcTemplate = new BatchJdbcTemplate(underlying, reporter);

  PreparedStatementCreatorFactory creatorFactory = new PreparedStatementCreatorFactory(INSERTION);
  creatorFactory.addParameter(new SqlParameter(Types.VARCHAR));
  creatorFactory.addParameter(new SqlParameter(Types.TIMESTAMP));

  PreparedStatementCreator creator = creatorFactory
      .newPreparedStatementCreator(new Object[]{randomString(), new Date()});

  batchJdbcTemplate.update(creator);
  batchJdbcTemplate.update(creator);

  reporter.flush();
  int rowCount = batchJdbcTemplate.queryForObject("SELECT COUNT(1) FROM test;", Integer.class);
  assertEquals(2, rowCount);
}
项目:cf-mta-deploy-service    文件:HanaSecureTokenStore.java   
private OAuth2AccessToken readAccessTokenFromSecureStore(String tokenKey) {
    if (tokenKey.length() > TOKEN_KEY_MAX_LENGTH) {
        throw new IllegalArgumentException(Messages.TOKEN_KEY_FORMAT_NOT_VALID);
    }

    SqlParameter storeNameParam = new SqlParameter(Types.VARCHAR);
    SqlParameter forXsApplicationUserParam = new SqlParameter(Types.BOOLEAN);
    SqlParameter keyParam = new SqlParameter(Types.VARCHAR);
    SqlOutParameter valueParam = new SqlOutParameter("VALUE", Types.VARBINARY);

    List<SqlParameter> paramList = Arrays.asList(storeNameParam, forXsApplicationUserParam, keyParam, valueParam);
    Map<String, Object> result = null;
    try {
        result = callRetrieve(tokenKey, paramList, PROCEDURE_SECURESTORE_RETRIEVE);
    } catch (BadSqlGrammarException e) {
        throwIfShouldNotIgnore(e, RETRIEVE_PROCEDURE_NAME);
        result = callRetrieve(tokenKey, paramList, PROCEDURE_SECURESTORE_RETRIEVE_LEGACY);
    }
    byte[] tokenBytes = (byte[]) result.get("VALUE");
    if (tokenBytes == null) {
        throw new IllegalArgumentException(Messages.TOKEN_NOT_FOUND_IN_SECURE_STORE);
    }
    byte[] decompressedBytes = CompressUtil.decompress(tokenBytes);
    OAuth2AccessToken accessToken = TokenUtil.createToken(new String(decompressedBytes, StandardCharsets.UTF_8));
    return accessToken;
}
项目:lams    文件:RdbmsOperation.java   
/**
 * Validate the parameters passed to an execute method based on declared parameters.
 * Subclasses should invoke this method before every {@code executeQuery()}
 * or {@code update()} method.
 * @param parameters parameters supplied (may be {@code null})
 * @throws InvalidDataAccessApiUsageException if the parameters are invalid
 */
protected void validateParameters(Object[] parameters) throws InvalidDataAccessApiUsageException {
    checkCompiled();
    int declaredInParameters = 0;
    for (SqlParameter param : this.declaredParameters) {
        if (param.isInputValueProvided()) {
            if (!supportsLobParameters() &&
                    (param.getSqlType() == Types.BLOB || param.getSqlType() == Types.CLOB)) {
                throw new InvalidDataAccessApiUsageException(
                        "BLOB or CLOB parameters are not allowed for this kind of operation");
            }
            declaredInParameters++;
        }
    }
    validateParameterCount((parameters != null ? parameters.length : 0), declaredInParameters);
}
项目:lams    文件:NamedParameterJdbcTemplate.java   
@Override
public int update(
        String sql, SqlParameterSource paramSource, KeyHolder generatedKeyHolder, String[] keyColumnNames)
        throws DataAccessException {

    ParsedSql parsedSql = getParsedSql(sql);
    String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
    Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, null);
    List<SqlParameter> declaredParameters = NamedParameterUtils.buildSqlParameterList(parsedSql, paramSource);
    PreparedStatementCreatorFactory pscf = new PreparedStatementCreatorFactory(sqlToUse, declaredParameters);
    if (keyColumnNames != null) {
        pscf.setGeneratedKeysColumnNames(keyColumnNames);
    }
    else {
        pscf.setReturnGeneratedKeys(true);
    }
    return getJdbcOperations().update(pscf.newPreparedStatementCreator(params), generatedKeyHolder);
}
项目:lams    文件:AbstractJdbcCall.java   
/**
 * Add a declared parameter to the list of parameters for the call.
 * Only parameters declared as {@code SqlParameter} and {@code SqlInOutParameter}
 * will be used to provide input values. This is different from the {@code StoredProcedure} class
 * which for backwards compatibility reasons allows input values to be provided for parameters declared
 * as {@code SqlOutParameter}.
 * @param parameter the {@link SqlParameter} to add
 */
public void addDeclaredParameter(SqlParameter parameter) {
    Assert.notNull(parameter, "The supplied parameter must not be null");
    if (!StringUtils.hasText(parameter.getName())) {
        throw new InvalidDataAccessApiUsageException(
                "You must specify a parameter name when declaring parameters for \"" + getProcedureName() + "\"");
    }
    this.declaredParameters.add(parameter);
    if (logger.isDebugEnabled()) {
        logger.debug("Added declared parameter for [" + getProcedureName() + "]: " + parameter.getName());
    }
}
项目:lams    文件:AbstractJdbcCall.java   
/**
 * Method to perform the actual compilation.  Subclasses can override this template method to perform
 * their own compilation.  Invoked after this base class's compilation is complete.
 */
protected void compileInternal() {
    this.callMetaDataContext.initializeMetaData(getJdbcTemplate().getDataSource());

    // iterate over the declared RowMappers and register the corresponding SqlParameter
    for (Map.Entry<String, RowMapper<?>> entry : this.declaredRowMappers.entrySet()) {
        SqlParameter resultSetParameter =
                this.callMetaDataContext.createReturnResultSetParameter(entry.getKey(), entry.getValue());
        this.declaredParameters.add(resultSetParameter);
    }
    this.callMetaDataContext.processParameters(this.declaredParameters);

    this.callString = this.callMetaDataContext.createCallString();
    if (logger.isDebugEnabled()) {
        logger.debug("Compiled stored procedure. Call string is [" + this.callString + "]");
    }

    this.callableStatementFactory =
            new CallableStatementCreatorFactory(getCallString(), this.callMetaDataContext.getCallParameters());
    this.callableStatementFactory.setNativeJdbcExtractor(getJdbcTemplate().getNativeJdbcExtractor());

    onCompileInternal();
}
项目:spring4-understanding    文件:RdbmsOperation.java   
/**
 * Validate the parameters passed to an execute method based on declared parameters.
 * Subclasses should invoke this method before every {@code executeQuery()}
 * or {@code update()} method.
 * @param parameters parameters supplied (may be {@code null})
 * @throws InvalidDataAccessApiUsageException if the parameters are invalid
 */
protected void validateParameters(Object[] parameters) throws InvalidDataAccessApiUsageException {
    checkCompiled();
    int declaredInParameters = 0;
    for (SqlParameter param : this.declaredParameters) {
        if (param.isInputValueProvided()) {
            if (!supportsLobParameters() &&
                    (param.getSqlType() == Types.BLOB || param.getSqlType() == Types.CLOB)) {
                throw new InvalidDataAccessApiUsageException(
                        "BLOB or CLOB parameters are not allowed for this kind of operation");
            }
            declaredInParameters++;
        }
    }
    validateParameterCount((parameters != null ? parameters.length : 0), declaredInParameters);
}
项目:spring4-understanding    文件:RdbmsOperation.java   
/**
 * Validate the named parameters passed to an execute method based on declared parameters.
 * Subclasses should invoke this method before every {@code executeQuery()} or
 * {@code update()} method.
 * @param parameters parameter Map supplied. May be {@code null}.
 * @throws InvalidDataAccessApiUsageException if the parameters are invalid
 */
protected void validateNamedParameters(Map<String, ?> parameters) throws InvalidDataAccessApiUsageException {
    checkCompiled();
    Map<String, ?> paramsToUse = (parameters != null ? parameters : Collections.<String, Object> emptyMap());
    int declaredInParameters = 0;
    for (SqlParameter param : this.declaredParameters) {
        if (param.isInputValueProvided()) {
            if (!supportsLobParameters() &&
                    (param.getSqlType() == Types.BLOB || param.getSqlType() == Types.CLOB)) {
                throw new InvalidDataAccessApiUsageException(
                        "BLOB or CLOB parameters are not allowed for this kind of operation");
            }
            if (param.getName() != null && !paramsToUse.containsKey(param.getName())) {
                throw new InvalidDataAccessApiUsageException("The parameter named '" + param.getName() +
                        "' was not among the parameters supplied: " + paramsToUse.keySet());
            }
            declaredInParameters++;
        }
    }
    validateParameterCount(paramsToUse.size(), declaredInParameters);
}
项目:spring4-understanding    文件:NamedParameterJdbcTemplate.java   
@Override
public int update(
        String sql, SqlParameterSource paramSource, KeyHolder generatedKeyHolder, String[] keyColumnNames)
        throws DataAccessException {

    ParsedSql parsedSql = getParsedSql(sql);
    String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
    Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, null);
    List<SqlParameter> declaredParameters = NamedParameterUtils.buildSqlParameterList(parsedSql, paramSource);
    PreparedStatementCreatorFactory pscf = new PreparedStatementCreatorFactory(sqlToUse, declaredParameters);
    if (keyColumnNames != null) {
        pscf.setGeneratedKeysColumnNames(keyColumnNames);
    }
    else {
        pscf.setReturnGeneratedKeys(true);
    }
    return getJdbcOperations().update(pscf.newPreparedStatementCreator(params), generatedKeyHolder);
}
项目:spring4-understanding    文件:AbstractJdbcCall.java   
/**
 * Delegate method to perform the actual compilation.
 * <p>Subclasses can override this template method to perform their own compilation.
 * Invoked after this base class's compilation is complete.
 */
protected void compileInternal() {
    this.callMetaDataContext.initializeMetaData(getJdbcTemplate().getDataSource());

    // Iterate over the declared RowMappers and register the corresponding SqlParameter
    for (Map.Entry<String, RowMapper<?>> entry : this.declaredRowMappers.entrySet()) {
        SqlParameter resultSetParameter =
                this.callMetaDataContext.createReturnResultSetParameter(entry.getKey(), entry.getValue());
        this.declaredParameters.add(resultSetParameter);
    }
    this.callMetaDataContext.processParameters(this.declaredParameters);

    this.callString = this.callMetaDataContext.createCallString();
    if (logger.isDebugEnabled()) {
        logger.debug("Compiled stored procedure. Call string is [" + this.callString + "]");
    }

    this.callableStatementFactory =
            new CallableStatementCreatorFactory(getCallString(), this.callMetaDataContext.getCallParameters());
    this.callableStatementFactory.setNativeJdbcExtractor(getJdbcTemplate().getNativeJdbcExtractor());

    onCompileInternal();
}
项目:spring4-understanding    文件:SqlQueryTests.java   
@Test
public void testQueryWithoutEnoughParams() {
    MappingSqlQuery<Integer> query = new MappingSqlQuery<Integer>() {
        @Override
        protected Integer mapRow(ResultSet rs, int rownum) throws SQLException {
            return rs.getInt(1);
        }
    };
    query.setDataSource(dataSource);
    query.setSql(SELECT_ID_WHERE);
    query.declareParameter(new SqlParameter(COLUMN_NAMES[0], COLUMN_TYPES[0]));
    query.declareParameter(new SqlParameter(COLUMN_NAMES[1], COLUMN_TYPES[1]));
    query.compile();

    thrown.expect(InvalidDataAccessApiUsageException.class);
    query.execute();
}
项目:spring4-understanding    文件:SqlQueryTests.java   
@Test
public void testQueryWithMissingMapParams() {
    MappingSqlQuery<Integer> query = new MappingSqlQuery<Integer>() {
        @Override
        protected Integer mapRow(ResultSet rs, int rownum) throws SQLException {
            return rs.getInt(1);
        }
    };
    query.setDataSource(dataSource);
    query.setSql(SELECT_ID_WHERE);
    query.declareParameter(new SqlParameter(COLUMN_NAMES[0], COLUMN_TYPES[0]));
    query.declareParameter(new SqlParameter(COLUMN_NAMES[1], COLUMN_TYPES[1]));
    query.compile();

    thrown.expect(InvalidDataAccessApiUsageException.class);
    query.executeByNamedParam(Collections.singletonMap(COLUMN_NAMES[0], "value"));
}
项目:Camel    文件:TemplateStoredProcedure.java   
public TemplateStoredProcedure(JdbcTemplate jdbcTemplate, Template template) {
    this.template = template;
    setDataSource(jdbcTemplate.getDataSource());

    setSql(template.getProcedureName());

    for (Object parameter : template.getParameterList()) {
        if (parameter instanceof InputParameter) {
            InputParameter inputParameter = (InputParameter) parameter;
            declareParameter(new SqlParameter(inputParameter.getName(), inputParameter.getSqlType()));
            inputParameterList.add(inputParameter);

        } else if (parameter instanceof OutParameter) {
            OutParameter outParameter = (OutParameter) parameter;
            declareParameter(new SqlOutParameter(outParameter.getOutValueMapKey(), outParameter.getSqlType()));
            setFunction(false);
        }
    }

    LOG.debug("Compiling stored procedure: {}", template.getProcedureName());
    compile();
}
项目:Camel    文件:BatchCallableStatementCreatorFactory.java   
private List<SqlParameter> createParams() {
    List<SqlParameter> params = new ArrayList<>();

    for (Object parameter : template.getParameterList()) {
        if (parameter instanceof InputParameter) {
            InputParameter inputParameter = (InputParameter) parameter;
            params.add(new SqlParameter(inputParameter.getName(), inputParameter.getSqlType()));

        } else {
            throw new UnsupportedOperationException("Only IN parameters supported by batch!");
        }
    }


    return params;
}
项目:gnvc-ims    文件:GoodreceiveDetailDaoImpl.java   
/**
 * Method 'insert'
 * 
 * @param dto
 * @return GoodreceiveDetailPk
 */
public GoodreceiveDetailPk insert(GoodreceiveDetail dto)
{
    SqlUpdate su = new SqlUpdate( dataSource, "INSERT INTO " + getTableName() + " ( grnumber, productcode, qtyreal, status, expirydate, remark, lotid, qtygood, qtydmg, producttype ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )");
    su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) );
    su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) );
    su.declareParameter( new SqlParameter( java.sql.Types.DECIMAL) );
    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.INTEGER) );
    su.declareParameter( new SqlParameter( java.sql.Types.DECIMAL) );
    su.declareParameter( new SqlParameter( java.sql.Types.DECIMAL) );
    su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) );
    su.compile();
    su.update( new Object[] { dto.getGrnumber(),dto.getProductcode(),dto.getQtyreal(),dto.getStatus(),dto.getExpirydate(),dto.getRemark(),dto.getLotid(),dto.getQtygood(),dto.getQtydmg(),dto.getProducttype()} );
    GoodreceiveDetailPk pk = new GoodreceiveDetailPk();
    pk.setId( jdbcTemplate.queryForInt("select @@IDENTITY") );
    return pk;
}
项目:gnvc-ims    文件:FishWeightTypeDaoImpl.java   
@Override
public void update(int id, FishWeightType dto) throws DaoException {
    String query = "UPDATE " + getTableName() + 
            " SET code=?, description=?, " +
            " updated_date=?, updated_by=?, is_active=?, is_delete=?" +
            " WHERE id=?";
    SqlUpdate su = new SqlUpdate(dataSource, query);

    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.VARCHAR));
    su.declareParameter(new SqlParameter(java.sql.Types.CHAR));
    su.declareParameter(new SqlParameter(java.sql.Types.CHAR));
    su.declareParameter(new SqlParameter(java.sql.Types.INTEGER));
    su.compile();

    su.update(new Object[] {dto.getCode(), dto.getDescription(),
            dto.getUpdatedDate(), dto.getUpdatedBy(), dto.getIsActive(), dto.getIsDelete(), id});
}
项目:gnvc-ims    文件:PoDaoImpl.java   
/**
 * 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()});
}
项目:class-guard    文件:RdbmsOperation.java   
/**
 * Validate the named parameters passed to an execute method based on declared parameters.
 * Subclasses should invoke this method before every {@code executeQuery()} or
 * {@code update()} method.
 * @param parameters parameter Map supplied. May be {@code null}.
 * @throws InvalidDataAccessApiUsageException if the parameters are invalid
 */
protected void validateNamedParameters(Map<String, ?> parameters) throws InvalidDataAccessApiUsageException {
    checkCompiled();
    Map paramsToUse = (parameters != null ? parameters : Collections.emptyMap());
    int declaredInParameters = 0;
    for (SqlParameter param : this.declaredParameters) {
        if (param.isInputValueProvided()) {
            if (!supportsLobParameters() &&
                    (param.getSqlType() == Types.BLOB || param.getSqlType() == Types.CLOB)) {
                throw new InvalidDataAccessApiUsageException(
                        "BLOB or CLOB parameters are not allowed for this kind of operation");
            }
            if (param.getName() != null && !paramsToUse.containsKey(param.getName())) {
                throw new InvalidDataAccessApiUsageException("The parameter named '" + param.getName() +
                        "' was not among the parameters supplied: " + paramsToUse.keySet());
            }
            declaredInParameters++;
        }
    }
    validateParameterCount(paramsToUse.size(), declaredInParameters);
}
项目:gnvc-ims    文件:PutawayDetailDaoImpl.java   
@Override
//untuk meng-update balance after picking
public void updateBalance(PutawayDetail dto) throws PickingDetailDaoException {
    // TODO Auto-generated method stub
    //String locationCode = dto.getLocationCode();
    System.out.println(">>>>>>>>>>>>>>>dto :"+dto);

    SqlUpdate su = new SqlUpdate( dataSource, 
    "update " + getTableName() + " set balance = ? " +
    "where location_code = ? and product_id = ? and corp_id = ? and wh_code = ?  and putaway_id = ?");

    //su.declareParameter( new SqlParameter( java.sql.Types.INTEGER) );
    su.declareParameter( new SqlParameter( java.sql.Types.INTEGER) );
    //su.declareParameter( new SqlParameter( java.sql.Types.INTEGER) );
    //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.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.compile();
    su.update( new Object[] { dto.getBalance(),dto.getLocationCode(),dto.getProductId(),dto.getCorpId(), dto.getWhCode(), dto.getPutawayId()} );

}
项目:gnvc-ims    文件:PoDaoImpl.java   
/**
 * 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;
}
项目:class-guard    文件:NamedParameterJdbcTemplate.java   
public int update(
        String sql, SqlParameterSource paramSource, KeyHolder generatedKeyHolder, String[] keyColumnNames)
        throws DataAccessException {

    ParsedSql parsedSql = getParsedSql(sql);
    String sqlToUse = NamedParameterUtils.substituteNamedParameters(parsedSql, paramSource);
    Object[] params = NamedParameterUtils.buildValueArray(parsedSql, paramSource, null);
    List<SqlParameter> declaredParameters = NamedParameterUtils.buildSqlParameterList(parsedSql, paramSource);
    PreparedStatementCreatorFactory pscf = new PreparedStatementCreatorFactory(sqlToUse, declaredParameters);
    if (keyColumnNames != null) {
        pscf.setGeneratedKeysColumnNames(keyColumnNames);
    }
    else {
        pscf.setReturnGeneratedKeys(true);
    }
    return getJdbcOperations().update(pscf.newPreparedStatementCreator(params), generatedKeyHolder);
}
项目:gnvc-ims    文件:FishSupplierDaoImpl.java   
@Override
public void update(int id, FishSupplier dto) throws DaoException {
    String query = "UPDATE " + getTableName()
            + " SET code=?, name=?, address=?, telephone=?, fax=?, email=?,"
            + " contact_person=?, updated_date=?, updated_by=?, is_active=?, is_delete=?"
            + " WHERE id=?";

    SqlUpdate su = new SqlUpdate(dataSource, query);
    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.VARCHAR));
    su.declareParameter(new SqlParameter(java.sql.Types.CHAR));
    su.declareParameter(new SqlParameter(java.sql.Types.CHAR));
    su.declareParameter(new SqlParameter(java.sql.Types.INTEGER));
    su.compile();

    su.update(new Object[]{dto.getCode(), dto.getName(), dto.getAddress(), dto.getTelephone(),
        dto.getFax(), dto.getEmail(), dto.getContactPerson(), dto.getUpdatedDate(),
        dto.getUpdatedBy(), dto.getIsActive(), dto.getIsDelete(), id});
}
项目:gnvc-ims    文件:WarehouseDaoImpl.java   
/** 
 * Updates a single row in the warehouse table.
 */
public void update(WarehousePk pk, Warehouse dto) throws WarehouseDaoException
{
    SqlUpdate su = new SqlUpdate( dataSource, "UPDATE " + getTableName() + " SET wh_code = ?, wh_name = ?, category_name = ?, 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.VARCHAR) );
    su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) );
    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.getWhCode(),dto.getWhName(),dto.getCategoryName(),dto.getIsActive(),dto.getIsDelete(),dto.getCreatedBy(),dto.getCreatedDate(),dto.getUpdatedBy(),dto.getUpdatedDate(),pk.getId() } );
}
项目:gnvc-ims    文件:UomDaoImpl.java   
/**
 * Method 'insert'
 *
 * @param dto
 * @return UomPk
 */
public UomPk insert(Uom dto) {
    SqlUpdate su = new SqlUpdate(dataSource, "INSERT INTO " + getTableName() + " ( uom_code, uom_name, remarks, 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.VARCHAR));
    su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
    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.getUomCode(), dto.getUomName(), dto.getRemarks(), dto.getIsActive(), dto.getIsDelete(), dto.getCreatedBy(), dto.getCreatedDate(), dto.getUpdatedBy(), dto.getUpdatedDate()});
    UomPk pk = new UomPk();
    pk.setId(jdbcTemplate.queryForInt("select @@IDENTITY"));
    return pk;
}
项目:gnvc-ims    文件:BundleDetailDaoImpl.java   
/**
 * Method 'insert'
 * 
 * @param dto
 */
public void insert(BundleDetail dto)
{
    SqlUpdate su = new SqlUpdate( dataSource, "INSERT INTO " + getTableName() + " ( bundle_code, product_id, product_code, product_name, unit_code, qty_bundle, user_id, corp_id, wh_code ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ? )");
    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.INTEGER) );
    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.compile();
    su.update( new Object[] { dto.getBundleCode(),dto.getProductId(),dto.getProductCode(),dto.getProductName(),dto.getUnitCode(),dto.getQtyBundle(),dto.getUserId(),dto.getCorpId(),dto.getWhCode()} );
}
项目:gnvc-ims    文件:ConsigneeDaoImpl.java   
/**
 * Method 'insert'
 * 
 * @param dto
 * @return ConsigneePk
 */
public ConsigneePk insert(Consignee dto)
{
    SqlUpdate su = new SqlUpdate( dataSource, "INSERT INTO " + getTableName() + " ( consignee_name, consignee_pic, address1, address2, address3, consignee_phone, user_id, corp_id, wh_code, 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.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.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.getConsigneeName(),dto.getConsigneePIC(),dto.getAddress1(),dto.getAddress2(),dto.getAddress3(),dto.getConsigneePhone(),dto.getUserId(),dto.getCorpId(),dto.getWhCode(),dto.getIsActive(),dto.getIsDelete(),dto.getCreatedBy(),dto.getCreatedDate(),dto.getUpdatedBy(),dto.getUpdatedDate()} );
    return dto.createPk();
}
项目:gnvc-ims    文件:BundleDaoImpl.java   
/** 
 * Updates a single row in the bundle table.
 */
public void update(BundlePk pk, Bundle dto) throws BundleDaoException
{
    SqlUpdate su = new SqlUpdate( dataSource, "UPDATE " + getTableName() + " SET bundle_code = ?, bundle_name = ?, created_by = ?, created_date = ?, updated_by = ?, updated_date = ?, user_id = ?, wh_code = ?, corp_id = ? WHERE bundle_code = ?");
    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.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.VARCHAR) );
    su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) );
    su.compile();
    su.update( new Object[] { dto.getBundleCode(),dto.getBundleName(),dto.getCreatedBy(),dto.getCreatedDate(),dto.getUpdatedBy(),dto.getUpdatedDate(), dto.getUserId(),dto.getWhCode(),dto.getCorpId(),pk.getBundleCode() } );
}
项目:gnvc-ims    文件:StockOpnameDaoImpl.java   
/** 
 * Updates a single row in the stock_opname table.
 */
public void update(StockOpnamePk pk, StockOpname dto) throws StockOpnameDaoException
{
    SqlUpdate su = new SqlUpdate( dataSource, "UPDATE " + getTableName() + " SET product_code = ?, wh_code = ?, quantity = ?, balance = ?, 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.VARCHAR) );
    su.declareParameter( new SqlParameter( java.sql.Types.INTEGER) );
    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.getProductCode(),dto.getWhCode(),dto.getQuantity(),dto.getBalance(),dto.getIsActive(),dto.getIsDelete(),dto.getCreatedBy(),dto.getCreatedDate(),dto.getUpdatedBy(),dto.getUpdatedDate(),pk.getId() } );
}
项目:gnvc-ims    文件:FishWdsDaoImpl.java   
@Override
public void update(int id, FishWds dto) throws DaoException {
    String query = "UPDATE " + getTableName()
            + " SET wds_no=?, wds_date=?, vessel_id=?, requested_by=?,"
            + " approved_by=?, updated_date=?, updated_by=?, is_active=?, is_delete=?"
            + " WHERE id=?";

    SqlUpdate su = new SqlUpdate(dataSource, query);
    su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
    su.declareParameter(new SqlParameter(java.sql.Types.DATE));
    su.declareParameter(new SqlParameter(java.sql.Types.INTEGER));
    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.VARCHAR));
    su.declareParameter(new SqlParameter(java.sql.Types.CHAR));
    su.declareParameter(new SqlParameter(java.sql.Types.CHAR));
    su.declareParameter(new SqlParameter(java.sql.Types.INTEGER));
    su.compile();

    su.update(new Object[]{dto.getWdsNo(), dto.getWdsDate(), dto.getVesselId(),
        dto.getRequestedBy(), dto.getApprovedBy(), dto.getUpdatedDate(),
        dto.getUpdatedBy(), dto.getIsActive(), dto.getIsDelete(), id});

}
项目:gnvc-ims    文件:PickingDetailDaoImpl.java   
/**
 * Method 'insert'
 * 
 * @param dto
 * @return PickingDetailPk
 */
public PickingDetailPk insert(PickingDetail dto)
{
    SqlUpdate su = new SqlUpdate( dataSource, "INSERT INTO " + getTableName() + " ( picking_id, product_id, product_code, product_name, received_date, expired_date, unit_code, qty_order, qty_pick, balance, user_id, corp_id, location_code, wh_code, lotid ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )");
    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.TIMESTAMP) );
    su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) );
    su.declareParameter( new SqlParameter( java.sql.Types.INTEGER) );
    su.declareParameter( new SqlParameter( java.sql.Types.INTEGER) );
    su.declareParameter( new SqlParameter( java.sql.Types.INTEGER) );
    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.compile();
    su.update( new Object[] { dto.getPickingId(),dto.getProducts().getProductId(),dto.getProducts().getProductCode(),dto.getProducts().getProductName(),dto.getReceivedDate(),dto.getExpiredDate(),dto.getUnitCode(),dto.getQtyOrder(),dto.getQtyPick(),dto.getBalance(),dto.getUserId(),dto.getCorp().getId(),dto.getWhlocation().getLocationCode(),dto.getWh().getWhCode(),dto.getLotId()} );
    return dto.createPk();
}
项目:gnvc-ims    文件:WsDaoImpl.java   
/** 
 * Updates a single row in the ws table.
 */
public void update(WsPk pk, Ws dto) throws WsDaoException
{
    SqlUpdate su = new SqlUpdate( dataSource, "UPDATE " + getTableName() + " SET ws_code = ?, ws_date = ?, supplier_name = ?, fish_species = ?, fish_size = ?, fish_weight = ?, quantity = ?, remarks = ?, issued_by = ?, checked_by = ?, received_by = ?, 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.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.INTEGER) );
    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.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.getWsCode(),dto.getWsDate(),dto.getSupplierName(),dto.getFishSpecies(),dto.getFishSize(),dto.getFishWeight(),dto.getQuantity(),dto.getRemarks(),dto.getIssuedBy(),dto.getCheckedBy(),dto.getReceivedBy(),dto.getIsActive(),dto.getIsDelete(),dto.getCreatedBy(),dto.getCreatedDate(),dto.getUpdatedBy(),dto.getUpdatedDate(),pk.getId() } );
}
项目:gnvc-ims    文件:CanvassingDetailDaoImpl.java   
/** 
 * Updates a single row in the canvassing_detail table.
 */
public void update(CanvassingDetailPk pk, CanvassingDetail dto) throws CanvassingDetailDaoException
{
    SqlUpdate su = new SqlUpdate( dataSource, "UPDATE " + getTableName() + " SET prsnumber = ?, supplier_code = ?, productcode = ?, productname = ?, priceunit = ?, warranty = ?, termpayment = ?, termdelivery = ?, discount = ?, pph = ?, ppn = ?, is_selected = ? WHERE id = ?");
    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.DECIMAL) );
    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.DECIMAL) );
    su.declareParameter( new SqlParameter( java.sql.Types.DECIMAL) );
    su.declareParameter( new SqlParameter( java.sql.Types.DECIMAL) );
    su.declareParameter( new SqlParameter( java.sql.Types.CHAR) );
    su.declareParameter( new SqlParameter( java.sql.Types.INTEGER) );
    su.compile();
    su.update( new Object[] { dto.getPrsnumber(),dto.getSupplierCode(),dto.getProductcode(),dto.getProductname(),dto.getPriceunit(),dto.getWarranty(),dto.getTermpayment(),dto.getTermdelivery(),dto.getDiscount(),dto.getPph(),dto.getPpn(),dto.getIsSelected(),pk.getId() } );
}
项目:gnvc-ims    文件:CurrencyDaoImpl.java   
/**
 * Updates a single row in the currency table.
 */
public void update(CurrencyPk pk, Currency dto) throws CurrencyDaoException {
    SqlUpdate su = new SqlUpdate(dataSource, "UPDATE " + getTableName() + " SET currency_code = ?, currency_name = ?, currency_symbol = ?, 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.VARCHAR));
    su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
    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.getCurrencyCode(), dto.getCurrencyName(), dto.getCurrencySymbol(), dto.getIsActive(), dto.getIsDelete(), dto.getCreatedBy(), dto.getCreatedDate(), dto.getUpdatedBy(), dto.getUpdatedDate(), pk.getId()});
}
项目:gnvc-ims    文件:StockInventoryDaoImpl.java   
/**
 * Updates a single row in the stock_inventory table.
 */
public void update(StockInventoryPk pk, StockInventory dto) throws StockInventoryDaoException {
    System.out.println("update dto =" + dto);
    SqlUpdate su = new SqlUpdate(dataSource, "UPDATE " + getTableName() + " SET product_code = ?, wh_code = ?, balance = ?, start_balance = ?, 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.VARCHAR));
    su.declareParameter(new SqlParameter(java.sql.Types.DECIMAL));
    su.declareParameter(new SqlParameter(java.sql.Types.DECIMAL));
    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.getProductCode(), dto.getWhCode(), dto.getBalance(), dto.getStartBalance(), dto.getIsActive(), dto.getIsDelete(), dto.getCreatedBy(), dto.getCreatedDate(), dto.getUpdatedBy(), dto.getUpdatedDate(), pk.getId()});
}
项目:gnvc-ims    文件:ReplenishmentDaoImpl.java   
/**
 * Method 'insert'
 * 
 * @param dto
 * @return ReplenishmentPk
 */
public ReplenishmentPk insert(Replenishment dto)
{
    SqlUpdate su = new SqlUpdate( dataSource, "INSERT INTO " + getTableName() + " ( replenish_no, replenish_date, status_app, app_date, 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.TIMESTAMP) );
    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.getReplenishNo(),dto.getReplenishDate(),dto.getStatusApp(),dto.getAppDate(),dto.getCreatedBy(),dto.getCreatedDate(),dto.getUpdatedBy(),dto.getUpdatedDate()} );
    return dto.createPk();
}
项目:gnvc-ims    文件:PrsDaoImpl.java   
/**
 * Method 'insert'
 *
 * @param dto
 * @return PrsPk
 */
public PrsPk insert(Prs dto) {
    SqlUpdate su = new SqlUpdate(dataSource, "INSERT INTO " + getTableName() + " ( prsnumber, prsdate, requestdate, deliverydate, poreferensi, remarks, createdby, department_name, is_approved) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?)");
    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.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.compile();
    su.update(new Object[]{dto.getPrsnumber(), dto.getPrsdate(), dto.getRequestdate(), dto.getDeliverydate(), dto.getPoreferensi(), dto.getRemarks(), dto.getCreatedby(), dto.getDepartmentName(), dto.getIsApproved()});
    PrsPk pk = new PrsPk();
    pk.setId(jdbcTemplate.queryForInt("select @@IDENTITY"));
    return pk;
}
项目:gnvc-ims    文件:FishVesselDaoImpl.java   
@Override
public int insert(FishVessel dto) {
    String query = "INSERT INTO " + getTableName() + " (supplier_id, code, name, batch_no,"
            + "created_date, created_by, is_active, is_delete) VALUES(?,?,?,?,?,?,?,?)";

    SqlUpdate su = new SqlUpdate(dataSource, query);
    su.declareParameter(new SqlParameter(java.sql.Types.INTEGER));
    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.VARCHAR));
    su.declareParameter(new SqlParameter(java.sql.Types.CHAR));
    su.declareParameter(new SqlParameter(java.sql.Types.CHAR));
    su.compile();

    su.update(new Object[]{dto.getSupplierId(), dto.getCode(), dto.getName(),
        dto.getBatchNo(), dto.getCreatedDate(), dto.getCreatedBy(),
        dto.getIsActive(), dto.getIsDelete()});

    int primaryKey = jdbcTemplate.queryForInt("SELECT @@IDENTITY");
    return primaryKey;
}
项目:gnvc-ims    文件:FishBalanceDaoImpl.java   
@Override
public void updateActual(int id, FishBalance dto) throws DaoException {
    String query = "UPDATE fish_balance_actual"
            + " SET vessel_id=?, storage_id=?, fish_id=?, balance=?,"
            + " updated_date=?, updated_by=?, is_active=?, is_delete=?"
            + " WHERE id=?";

    SqlUpdate su = new SqlUpdate(dataSource, query);
    su.declareParameter(new SqlParameter(java.sql.Types.INTEGER));
    su.declareParameter(new SqlParameter(java.sql.Types.INTEGER));
    su.declareParameter(new SqlParameter(java.sql.Types.INTEGER));
    su.declareParameter(new SqlParameter(java.sql.Types.DECIMAL));
    su.declareParameter(new SqlParameter(java.sql.Types.TIMESTAMP));
    su.declareParameter(new SqlParameter(java.sql.Types.VARCHAR));
    su.declareParameter(new SqlParameter(java.sql.Types.CHAR));
    su.declareParameter(new SqlParameter(java.sql.Types.CHAR));
    su.declareParameter(new SqlParameter(java.sql.Types.INTEGER));
    su.compile();

    su.update(new Object[]{dto.getVesselId(), dto.getStorageId(), dto.getFishId(),
        dto.getBalance(), dto.getUpdatedDate(), dto.getUpdatedBy(),
        dto.getIsActive(), dto.getIsDelete(), id});
}
项目:gnvc-ims    文件:FishVesselDaoImpl.java   
@Override
public void update(int id, FishVessel dto) throws DaoException {
    String query = "UPDATE " + getTableName() + " SET supplier_id=?, code=?, name=?, "
            + "batch_no=?, updated_date=?, updated_by=?, is_active=?, is_delete=? WHERE id=?";

    SqlUpdate su = new SqlUpdate(dataSource, query);
    su.declareParameter(new SqlParameter(java.sql.Types.INTEGER));
    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.VARCHAR));
    su.declareParameter(new SqlParameter(java.sql.Types.CHAR));
    su.declareParameter(new SqlParameter(java.sql.Types.CHAR));
    su.declareParameter(new SqlParameter(java.sql.Types.INTEGER));
    su.compile();

    su.update(new Object[]{dto.getSupplierId(), dto.getCode(), dto.getName(),
        dto.getBatchNo(), dto.getUpdatedDate(), dto.getUpdatedBy(),
        dto.getIsActive(), dto.getIsDelete(), id});
}