fix oql syntax

This commit is contained in:
Peter Hormanns 2019-12-03 18:57:51 +01:00
parent da02f37ee4
commit fad4022cd5

View File

@ -51,7 +51,7 @@ public class AutoconfigAutodiscoverServlet extends HttpServlet {
final String domain = addrParts[1]; final String domain = addrParts[1];
final Transaction transaction = new Transaction("autoconfig"); final Transaction transaction = new Transaction("autoconfig");
final EntityManager em = transaction.getEntityManager(); final EntityManager em = transaction.getEntityManager();
final Query emailQuery = em.createQuery("SELECT addr FROM EMailAddresses addr WHERE addr.localpart = :localpart AND addr.domain = :domain AND ( addr.subdomain IS NULL OR addr.subdomain = :subdomain)"); final Query emailQuery = em.createQuery("SELECT addr FROM EMailAddresses addr WHERE addr.localpart = :localpart AND addr.domain.name = :domain AND ( addr.subdomain IS NULL OR addr.subdomain = :subdomain)");
emailQuery.setParameter("subdomain", ""); emailQuery.setParameter("subdomain", "");
emailQuery.setParameter("domain", domain); emailQuery.setParameter("domain", domain);
emailQuery.setParameter("localpart", localpart); emailQuery.setParameter("localpart", localpart);