-->
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: Is possible to have an embeddable class inside another?
PostPosted: Thu Feb 19, 2009 11:35 am 
Newbie

Joined: Thu Feb 19, 2009 11:24 am
Posts: 1
Hi guys,

For integration purposes, i usually use embeddable classes (aka 'components'). In my situation, it is necessary to create a 'component' made by other 'components', for instance:

Quote:

@Embeddable
public class BasicUser{
String username;
....
}

@Embeddable
public class AppUser{
@Embedded
BasicUser basicUser;
//other information I need to embed here
...
}

@Entity
public class SomeEntityClass{
@Embedded
AppUser user;
...
}


When I try to do that, Hibernate throws an exception about repetead column name. Even if I try do override the column name through @AtributeOverride It doesn´t work.

So, how could I solve this? Is possible to use a component inside a component?

Best regards,


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.