james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tellier Benoit (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MAILBOX-356) Error(s) in JPA mapping annotation(s)
Date Fri, 07 Dec 2018 08:35:00 GMT

    [ https://issues.apache.org/jira/browse/MAILBOX-356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16712488#comment-16712488
] 

Tellier Benoit commented on MAILBOX-356:
----------------------------------------

Hi,

Thanks for the nice report.

Regarding the ANNOTATION_KEY issue, we should perform the rename and explain in the upgrade
instruction [1]  that a user doing the upgrade to 3.3.0 needs to manually rename the column.

Would you like to contribute this change?

[1] https://github.com/apache/james-project/blob/master/upgrade-instructions.md

> 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-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message