-->
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.  [ 3 posts ] 
Author Message
 Post subject: How to annotate a Collection attribute to map into Columns.
PostPosted: Tue May 08, 2007 6:01 am 
Newbie

Joined: Tue May 08, 2007 5:30 am
Posts: 2
Hello,

I have a pojo with a Collection<Integer> attribute. This attribute must be persisted in the same TABLE than the pojo ((de)normalization): one extra column (COL1-COL2- etc) per element in the Collection. The size of the Collection varies for each instance of the pojo (which means it should be possible to add a column dynamically into the TABLE).

Which Hibernate annotation should I use?

I am lost in the documentation and I don't know in which direction to go. Any help or guidance welcome.

Thank you,

Yves.

---
Extra info (where do I need this):

I need to persist/update a tree (pojo with parent/children attributes).
Every node is a row in a table, and contains the path to the root:
TABLE:
Name - Parent - Parent1 - Parent2 - etc
n1 - 0 - 0 - 0
n2 - n1 - 0 - 0
n3 - n2 - n1 - 0 - 0
etc.
---


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 08, 2007 9:05 am 
Senior
Senior

Joined: Sat Apr 21, 2007 11:01 pm
Posts: 144
Wouldn't it be better to normalise your tables? lol...

_________________
Everytime you get an answer to your question without giving credit; god kills a kitten. :(


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 08, 2007 11:50 am 
Newbie

Joined: Tue May 08, 2007 5:30 am
Posts: 2
As you should have guessed, it is a legacy database used by a working legacy open-source application.

I just need an administrative tool to populate this database from our own databases and my technology of choice is, among others, Hibernate with annotations.

Any suggestion welcome,

Yves


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.