diff --git a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java index f868870..3880e0f 100644 --- a/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java +++ b/hsarback/src/de/hsadmin/mods/dom/DomainProcessorFactory.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.logging.Logger; import javax.persistence.EntityManager; import javax.persistence.Query; @@ -31,6 +32,8 @@ public class DomainProcessorFactory implements EntityProcessorFactory { "htdocs", "htdocs-ssl", "subs", "subs/www", "subs-ssl", "subs-ssl/www", "cgi", "fastcgi", "cgi-ssl", "fastcgi-ssl", "app", "app-ssl", "etc", "var" }; + private static final Logger LOG = Logger.getLogger(DomainProcessorFactory.class.getName()); + public Processor createCreateProcessor(EntityManager em, T entity) throws ProcessorException { String hiveName = entity.getHiveName(); Domain dom = (Domain) entity; @@ -134,15 +137,16 @@ public class DomainProcessorFactory implements EntityProcessorFactory { } private CompoundProcessor createHiveEMailSetupProcessor(EntityManager em, Domain dom) { + LOG.info("createHiveEMailSetupProcessor( " + dom.getName() + " )"); final EMailAddressProcessorFactory eMailAddressProcessorFactory = new EMailAddressProcessorFactory(); final CompoundProcessor emailAdrProcessor = new CompoundProcessor(); final Query query = em.createQuery( - "SELECT adr FROM " + - EMailAddress.class.getAnnotation(javax.persistence.Entity.class).name() + " adr " + - "WHERE adr.domain.name='" + dom.getName() + "'"); + "SELECT adr FROM EMailAddresses adr WHERE adr.domain.name = :domname"); + query.setParameter("domname", dom.getName()); final List resultList = query.getResultList(); for (final Object obj : resultList) { final EMailAddress eMailAddress = (EMailAddress) obj; + LOG.info("EMail: " + eMailAddress.getEMailAddress()); emailAdrProcessor.appendProcessor(eMailAddressProcessorFactory.createCreateProcessor(em, eMailAddress)); } return emailAdrProcessor; diff --git a/hsarback/src/de/hsadmin/mods/email/EMailAlias.java b/hsarback/src/de/hsadmin/mods/email/EMailAlias.java index 3d057ef..ba274c3 100644 --- a/hsarback/src/de/hsadmin/mods/email/EMailAlias.java +++ b/hsarback/src/de/hsadmin/mods/email/EMailAlias.java @@ -29,7 +29,7 @@ import de.hsadmin.mods.user.UnixUser; * Entity class for email aliases. * */ -@javax.persistence.Entity(name = "EMailAliases") +@Entity(name = "EMailAliases") @Table(name = "emailalias") @SequenceGenerator(name = "EMailAliasesSeqGen", sequenceName = "emailalias_emailalias_id_seq") @SearchFilter("obj.pac = :loginUserPac OR obj.pac.customer.name = :loginUserName")