public void update(Resource resource) {
int columnType = resource.getIdIndex().getColumnInfo().getColumnType();
Object[] parameters = new Object[] { resource.getName(), resource.getPartitionDimension().getId(), JdbcTypeMapper.jdbcTypeToString(columnType),resource.isPartitioningResource(),resource.getId()};
KeyHolder generatedKey = new GeneratedKeyHolder();
JdbcTemplate j = getJdbcTemplate();
PreparedStatementCreatorFactory creatorFactory = new PreparedStatementCreatorFactory(
"UPDATE resource_metadata SET name=?,dimension_id=?,db_type=?,is_partitioning_resource=? WHERE id=?",
new int[] {Types.VARCHAR,Types.INTEGER,Types.VARCHAR,Types.INTEGER,Types.BIT});
creatorFactory.setReturnGeneratedKeys(true);
int rows = j.update(creatorFactory
.newPreparedStatementCreator(parameters), generatedKey);
if (rows != 1)
throw new HiveRuntimeException("Unable to update Resource: " + resource.getId());
// dependencies