Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-1697

james_mail is being created incorrectly when using JPA and PostgreSQL due to final declarations

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      Using GIT master of james.

      Fields mail_bytes/header_bytes are absent in the declaration of james_mail when using PostgreSQL.

      james=# \d james_mail
             Table "public.james_mail"
            Column      |  Type   | Modifiers 
      ------------------+---------+-----------
       mailbox_id       | bigint  | not null
       mail_uid         | bigint  | not null
       mail_is_answered | boolean | not null
       mail_is_deleted  | boolean | not null
       mail_is_draft    | boolean | not null
       mail_is_flagged  | boolean | not null
       mail_modseq      | bigint  | 
       mail_is_recent   | boolean | not null
       mail_is_seen     | boolean | not null
      Indexes:
          "james_mail_pkey" PRIMARY KEY, btree (mailbox_id, mail_uid)
          "i_jms_mil_mail_is_deleted" btree (mail_is_deleted)
          "i_jms_mil_mail_is_recent" btree (mail_is_recent)
          "i_jms_mil_mail_is_seen" btree (mail_is_seen)
          "i_jms_mil_mail_modseq" btree (mail_modseq)
      Foreign-key constraints:
          "james_mail_mailbox_id_fkey" FOREIGN KEY (mailbox_id) REFERENCES james_mailbox(mailbox_id) ON DELETE CASCADE DEFERRABLE
      
      james=# \c postgres
      You are now connected to database "postgres" as user "postgres".
      postgres=# drop database james;                                                                                                                                                                      
      DROP DATABASE
      postgres=# create database james with owner james;                                                                                                           
      
      <JAMES RESTART>
      
      postgres=# \c james
      You are now connected to database "james" as user "postgres".
      james=# \d james_mail
             Table "public.james_mail"
            Column      |  Type   | Modifiers 
      ------------------+---------+-----------
       mailbox_id       | bigint  | not null
       mail_uid         | bigint  | not null
       mail_is_answered | boolean | not null
       mail_is_deleted  | boolean | not null
       mail_is_draft    | boolean | not null
       mail_is_flagged  | boolean | not null
       mail_modseq      | bigint  | 
       mail_is_recent   | boolean | not null
       mail_is_seen     | boolean | not null
       mail_bytes       | integer | not null
       header_bytes     | integer | not null
      Indexes:
          "james_mail_pkey" PRIMARY KEY, btree (mailbox_id, mail_uid)
          "i_jms_mil_mail_is_deleted" btree (mail_is_deleted)
          "i_jms_mil_mail_is_recent" btree (mail_is_recent)
          "i_jms_mil_mail_is_seen" btree (mail_is_seen)
          "i_jms_mil_mail_modseq" btree (mail_modseq)
      Foreign-key constraints:
          "james_mail_mailbox_id_fkey" FOREIGN KEY (mailbox_id) REFERENCES james_mailbox(mailbox_id) ON DELETE CASCADE DEFERRABLE
                                            
      

      The problem was caused by commit 9b2ce5de97244d21bea6e0fd857f5541d540c8be, after I changed private final InputStream header/body to just private InputStream header/body (and other fields from the JPA classes in the same folder from final to just private), the table has been created correctly.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kjchernov Konstantin J. Chernov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: