attach domain before setting reference to attached domainoption

This commit is contained in:
Peter Hormanns 2012-09-21 16:31:44 +02:00
parent 5a46f47d37
commit b44aab8d2d

View File

@ -96,6 +96,7 @@ public class DomainModuleImpl extends AbstractModuleImpl {
domainOption.setName("greylisting");
domainOptions.add(domainOption);
EntityManager em = getTransaction().getEntityManager();
em.persist(dom);
Query q = em.createQuery("SELECT opt FROM " +
DomainOption.class.getAnnotation(javax.persistence.Entity.class).name() +
" opt WHERE opt.name=:optName");