-->
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: TableGenerator inside Embeddable not working?
PostPosted: Fri Aug 06, 2010 11:42 am 
Newbie

Joined: Fri Aug 06, 2010 11:30 am
Posts: 1
Hi, I am trying to autogenerate an id inside an Embeddable entity but is not working, just ignores the TableGenerator and the GeneratedValue.

Code:
@Embeddable
public class StatPk implements Serializable{

   @GeneratedValue(strategy=GenerationType.TABLE, generator="stats_seq")
   @TableGenerator(name="stats_seq", table="sequence_table", pkColumnName="seq_name", valueColumnName="seq_count", pkColumnValue="stats_seq", allocationSize=1000)
   @Column(name="stat_sequence")
   private Long statSequence;
   
   private RecordPk recordId;

************************
More code here
************************

Parent class here

@Entity
@Table(name="mail_stats")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class Stat implements Serializable{

   @EmbeddedId
   private StatPk id;

**************
more code here
**************



But the funny thing is that if I take those 2 properties and I set them in Other class with annotation @Id (stop using @EmbeddedId) it works just fine.
Any advice?

I am using Hibernate 3.5.4-Final and hibernate-jpa-2.0-api 1.0.0.Final.


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.