Uploaded image for project: 'Spring Data JDBC'
  1. Spring Data JDBC
  2. DATAJDBC-259

Store collections and arrays of simple types in an ARRAY column

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 1.0 RC2 (Lovelace)
    • Fix Version/s: 1.1 M2 (Moore)
    • Component/s: Core
    • Labels:
      None

      Description

      When I try to persist a Book with a Set of Ids of the Author aggregate, Spring Data JDBC tries to store all ids in the authors column instead of an association table.

      public class Book {public class Book {
          @Id private Long id;
          private String title;
          private LocalDate publishingDate;
          private Integer numPages;
          private Set<Long> authors;
       
          // getter and setter methods
      }
      

       

      Executed INSERT statement

      2018-09-08 14:14:11.190 DEBUG 9232 --- [ main] o.s.jdbc.core.JdbcTemplate : Executing prepared SQL statement [INSERT INTO book (title, publishing_date, num_pages, authors) VALUES (?, ?, ?, ?)]

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                schauder Jens Schauder
                Reporter:
                thjanssen Thorben Janssen
                Last updater:
                Christoph Strobl
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: