driftDef.setDriftHandlingMode(normal);
driftDef.setInterval(1800L);
driftDef.setBasedir(new DriftDefinition.BaseDirectory(fileSystem, "/foo/bar/test"));
template.setTemplateDefinition(driftDef);
executeInTransaction(new TransactionCallback() {
@Override
public void execute() throws Exception {
resourceType.addDriftDefinitionTemplate(template);
resourceType = em.merge(resourceType);
em.flush();