driftDef.setEnabled(true);
driftDef.setDriftHandlingMode(normal);
driftDef.setInterval(1800L);
driftDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
executeInTransaction(false, new TransactionCallback() {
@Override
public void execute() throws Exception {
driftDef.setResource(resource);
getEntityManager().persist(driftDef);
}