@Override
public void createBucket(Bucket newBucket)
throws RepositoryException {
final String SQL =
"insert into bucket (" +
"experiment_id, description, label, allocation_percent, is_control, payload, state) " +
"values (?,?,?,?,?,?,?)";
try {
newTransaction().insert(
SQL,
newBucket.getExperimentID(),
newBucket.getDescription() != null
? newBucket.getDescription()
: "",
newBucket.getLabel().toString(),
newBucket.getAllocationPercent(),
newBucket.isControl() != null
? newBucket.isControl()
: false,
newBucket.getPayload() != null
? newBucket.getPayload()
: "",
Bucket.State.OPEN.toString());
} catch (WasabiException e) {
throw e;
} catch (Exception e) {
throw new RepositoryException("Could not create bucket \"" +
newBucket + "\"", e);
}
}