This week's book giveaway is in the Java in General forum.
We're giving away four copies of Java by Comparison (eBook) and have Simon Harrer, Jörg Lenhard, Linus Dietz on-line!
See this thread for details.
Win a copy of Java by Comparison (eBook) this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Aggregation relationship via JPA annotations  RSS feed

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to establish the aggregation relationship between two Java classes through JPA annotations in order to persist them into a database.


Such as mentioned here, the aggregation relationship is unidirectional and thus, only it is necessary to map one side. From the solution given by this webpage, I think the solution will be:
However, in some examples of aggregation, the many side class appears inside the one side class. Thus, I am considering this too:
Which option is the proper one?
Weeds: because mother nature refuses to be your personal bitch. But this tiny ad is willing:
Thread Boost - a very different sort of advertising
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!