new int[] {Types.VARCHAR,Types.INTEGER,Types.VARCHAR,Types.BIT});
creatorFactory.setReturnGeneratedKeys(true);
int rows = j.update(creatorFactory
.newPreparedStatementCreator(parameters), generatedKey);
if (rows != 1)
throw new HiveRuntimeException("Unable to create Resource: "
+ parameters);
if (generatedKey.getKeyList().size() == 0)
throw new HiveRuntimeException("Unable to retrieve generated primary key");
newResource.updateId(generatedKey.getKey().intValue());
// dependencies
for (SecondaryIndex si : newResource.getSecondaryIndexes())
new SecondaryIndexDao(ds).create(si);