Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-3279

Hibernate startup fails when JoinColumns has multiple JoinColumn with distinct nullable attribute values

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 1.2.2.RELEASE
    • Fix Version/s: 1.2.3.RELEASE
    • Component/s: @ CORE, PERSISTENCE
    • Labels:
    • Environment:
      Ubuntu 12.04, JDK 1.0.6_33, maven 3.0.4, Oracle 10.0.4.0

      Description

      Hibernate fails on startup:

      org.hibernate.AnnotationException: Mixing nullable and non nullable columns in a property is not allowed: es.gva.cit.aplusu.domain.aum.TaumAplusu.taumAplusu
      

      When database reverse engineer generate JoinColumns annotation with multiple JoinColumn annotations and nullable attribute of some JoinColumn has distinct value that the rest:

      @ManyToOne
      @JoinColumns({ 
      @JoinColumn(name = "APLICACION", referencedColumnName = "APLICACION", nullable = false, insertable = false, updatable = false), @JoinColumn(name = "ROLUSUAR", referencedColumnName = "USUARIO", insertable = false, updatable = false)
      })
      

      All nullable attribute values should have same value (true or false).

      If all false or all true, there is no problem.

      But if mixing values set true for all.
      This configuration is less restrictive and should work with all others ORMs.

      I attach a patch with the diff.

        Attachments

          Activity

            People

            • Assignee:
              stewarta Alan Stewart
              Reporter:
              mmartinez Mario Martínez Sánchez - gvNIX - DISID
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified