You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Garry Hurley Jr (JIRA)" <ji...@apache.org> on 2018/12/06 15:31:00 UTC

[jira] [Created] (MAILBOX-356) Error(s) in JPA mapping annotation(s)

Garry Hurley Jr created MAILBOX-356:
---------------------------------------

             Summary: Error(s) in JPA mapping annotation(s)
                 Key: MAILBOX-356
                 URL: https://issues.apache.org/jira/browse/MAILBOX-356
             Project: James Mailbox
          Issue Type: Bug
          Components: jpa
    Affects Versions: master, 3.0.1, 3.1.0, 3.2.0
            Reporter: Garry Hurley Jr


This should be considered a reference for other similar issues.  

 

The JPAMailboxAnnotation class has a field named 'key' which is mapped to a field named 'KEY' that is supposed to be created in the database table JAMES_MAILBOX_ANNOTATION.  KEY is a reserved word in SQL, so all SQL-based databases will throw a syntax error on queries involving this field.  I suggest the column name be changed to ANNOTATION_KEY for better mapping.

 

In several class files, the named queries show errors in eclipse.  Apparently, the name of the object cannot be the same as that of the class in JPA (this might be an overly strict checkstyle setting, but it is good form regardless).  Take the following query from the JPASubscription class:

SELECT subscription FROM Subscription subscription WHERE subscription.username = :userParam AND subscription.mailbox = :mailboxParam

Rewriting it to get rid of the error is trivial:

SELECT subs FROM Subscription subs WHERE subs.username = :userParam AND subs.mailbox = :mailboxParam

 

I just found these two issues so far, the first while trying to deploy pre-built binaries and the second while trying to build my own.  There are undoubtedly more of each.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org