-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Problem with OneToMany when migrating from 4.2.0 to 4.3.1 ..
PostPosted: Wed Feb 12, 2014 8:42 pm 
Newbie

Joined: Wed Feb 12, 2014 8:24 pm
Posts: 3
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 Table
C3_CPH_MSG_ID - PK
C3_CPH_ORGANISATN
C3_CPH_REF_NUMBER

Subject Table
C3_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>


Top
 Profile  
 
 Post subject: Re: Problem with OneToMany when migrating from 4.2.0 to 4.3.1 ..
PostPosted: Mon Feb 17, 2014 8:04 pm 
Newbie

Joined: Wed Feb 12, 2014 8:24 pm
Posts: 3
bump... anyone...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.