-->
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.  [ 1 post ] 
Author Message
 Post subject: hbm2ddl and Composite Ids
PostPosted: Thu Aug 20, 2009 9:41 am 
Beginner
Beginner

Joined: Sat Oct 09, 2004 2:35 pm
Posts: 43
Location: Tenerife
No way to make this work:
I create an annotated class that uses an Composite key and using hbm2ddl I try to create an sql containing ddl needed.
All tested code works perfectly till now but there's no way to make next one work:
Error given is:
java.lang.NoSuchMethodError: org.hibernate.util.ReflectHelper.isPublic(Ljava/lang/reflect/Member;)Z
and code:
Code:
package com.apl.aswir.model.main;

import javax.persistence.EmbeddedId;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;

@javax.persistence.Entity
@Table(name = "TEST")
@IdClass(TestId.class)
public class Test {
   
   // @EmbeddedId TestId id;
   
   private Long id1 = null;
   private Long id2 = null;
   @Id public Long getId1() {
      return id1;
   }
   public void setId1(Long id1) {
      this.id1 = id1;
   }
   @Id public Long getId2() {
      return id2;
   }
   public void setId2(Long id2) {
      this.id2 = id2;
   }

}

package com.apl.aswir.model.main;

import javax.persistence.Embeddable;

// @Embeddable
public class TestId {
   
   private Long id1 = null;
   private Long id2 = null;
   public Long getId1() {
      return id1;
   }
   public void setId1(Long id1) {
      this.id1 = id1;
   }
   public Long getId2() {
      return id2;
   }
   public void setId2(Long id2) {
      this.id2 = id2;
   }
}



I have tested 2 possible combinations:
    @IdClass
    @EmbeddedId
and both give same error.
any help would be very appreciated
Thanks in advance


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

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.