[ROO-3279] Hibernate startup fails when JoinColumns has multiple JoinColumn with distinct nullable attribute values Created: 18/Sep/12  Updated: 02/Oct/12  Resolved: 02/Oct/12

Status: Resolved
Project: Spring Roo
Component/s: @ CORE, PERSISTENCE
Affects Version/s: 1.2.2.RELEASE
Fix Version/s: 1.2.3.RELEASE

Type: Bug Priority: Major
Reporter: Mario Martínez Sánchez - gvNIX - DISID Assignee: Alan Stewart
Resolution: Complete Votes: 0
Labels: jpa, roo
Remaining Estimate: 1h
Time Spent: Not Specified
Original Estimate: 1h

Ubuntu 12.04, JDK 1.0.6_33, maven 3.0.4, Oracle

Attachments: File patch.diff    


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:

@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.

Comment by Alan Stewart [ 02/Oct/12 ]

Applied patch in Git ID f54d05d9bd0f64697b5c31f54996434943bf2a5e. Please test and verify

Comment by Mario Martínez Sánchez - gvNIX - DISID [ 02/Oct/12 ]

Verified, regards Alan

Generated at Sun Jul 12 07:41:40 UTC 2020 using Jira 8.5.4#805004-sha1:0444eab799707f9ad7b248d69f858774aadfd250.