Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to map hierarchy that contains array of its own types

 
M. Saeed
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would appreciate any thoughts on this:

I have two classes A, B.

public class A{
}

public class B extends A{
A a[]; // has array of A's
}

// other classes C, D etc also extend A

Can anybody give some suggestions on how this can be mapped using Hibernate. I am using table per hierarchy strategy to map these classes.

To map B, I am currently thinking I will use table per hierarchy mixed with "table for class B". But this requires a many-to-one from B to A,whereas my requirement is the other way round.

Thanks in advance for any help.
M. Saeed

[ September 25, 2008: Message edited by: M. Saeed ]
[ September 25, 2008: Message edited by: M. Saeed ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic