Uploaded image for project: 'James Mailbox'
  1. James Mailbox
  2. MAILBOX-356

Error(s) in JPA mapping annotation(s)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • master, 3.0.1, 3.1.0, 3.2.0
    • 3.3.0
    • jpa
    • None

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            PhantasyConcepts Garry Hurley Jr
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: