Hi,
Hope some one can help - I'm trying to upgrade from Hibernate 4.2.0 to 4.3.1 and a OneToMany relationships seems to be falling over....
anyone know why my annotation works in 4.2.0 and not 4.3.1 ...
Message TableC3_CPH_MSG_ID - PK
C3_CPH_ORGANISATN
C3_CPH_REF_NUMBER
Subject TableC3_CPH_ORGANISATN PK
C3_CPH_REF_NUMBER PK
Code:
class Message {
....
@Column(name = "C3_CPH_REF_NUMBER", length = 30)
private String referenceNumber;
@Column(name = "C3_CPH_ORGANISATN", length = 5)
private String organisation;
@OneToMany(fetch = FetchType.EAGER, cascade = { CascadeType.ALL }, orphanRemoval = true)
@JoinColumns({ @JoinColumn(name = "C3_CPH_ORGANISATN", referencedColumnName = "C3_CPH_ORGANISATN", updatable = false, insertable = false),
@JoinColumn(name = "C3_CPH_REF_NUMBER", referencedColumnName = "C3_CPH_REF_NUMBER", updatable = false, insertable = false) })
private Set<Subject> subjects = new LinkedHashSet<Subject>();
....
}
When trying to save the Message class I get
Code:
INFO: HHH000327: Error performing load command : org.hibernate.PropertyAccessException: could not get a field value by reflection getter of Message.organisation
I believe it is
subjects relationship that is causing the error. there is a public getter and setter for 'organisation' so I'm not sure what the problem is in 4.3.1 ....
Maven entry working
Code:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>4.2.0.Final</version>
</dependency>
Maven entry NOT working
Code:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>4.3.1.Final</version>
</dependency>