[ https://issues.apache.org/jira/browse/MAILBOX-356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16724784#comment-16724784 ]
Dat Pham commented on MAILBOX-356: ---------------------------------- PR: [https://github.com/linagora/james-project/pull/2056] > 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 > Priority: Major > > 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-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org