use of keywhiz.jooq.tables.records.GroupsRecord in project keywhiz by square.
the class GroupDAO method createGroup.
public long createGroup(String name, String creator, String description, ImmutableMap<String, String> metadata) {
GroupsRecord r = dslContext.newRecord(GROUPS);
String jsonMetadata;
try {
jsonMetadata = mapper.writeValueAsString(metadata);
} catch (JsonProcessingException e) {
// Serialization of a Map<String, String> can never fail.
throw Throwables.propagate(e);
}
long now = OffsetDateTime.now().toEpochSecond();
r.setName(name);
r.setCreatedby(creator);
r.setCreatedat(now);
r.setUpdatedby(creator);
r.setUpdatedat(now);
r.setDescription(description);
r.setMetadata(jsonMetadata);
r.store();
return r.getId();
}
Aggregations