Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3677400
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:13:01+00:00 2026-05-19T03:13:01+00:00

So the question is pretty much in the title. Let’s say I have some

  • 0

So the question is pretty much in the title.

Let’s say I have some classe: User, Post, Comment and Tag.

  • User has a @OneToMany List and
    @OneToMany List.
  • Post has
    @ManyToOne User, @OneToMany
    List, @ManyToMany List.
  • Comment has @ManyToOne List,
    @ManyToOne User.
  • Tag has @ManyToMany
    List.

I’m new to Hibernate, but I find it easy then to use for example the attributes of a Tag object to get all the Post objects related to that tag, or find the author of a Post object or all the Post written by a certain User.

Is it OK ?

I’m talking more in terms of performance here. I’m also using the Play! framework. I don’t know if this changes anything.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T03:13:02+00:00Added an answer on May 19, 2026 at 3:13 am

    I think some of them should be unidirectional.

    For example, in real-world scenario you usually don’t need to display “all Posts by User“, because they should be filtered or paginatied, so you need to run queries against the database instead of retrieving Posts from the User (because not filtering a collection at the database side in these use cases can be a real performance problem, especially if that collection is huge).

    Therefore having collection of Posts in User makes no sense. The same is true for User – Comment and Tag – Post relationships.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Pretty simple question: When i have a persistable object, it usually has a property
This question is pretty much the same as this .Net question exept for java.
Pretty much as the question asks. Answers preferably in pseudo code and referenced. The
Pretty much what the question says. What's the difference between the two classes of
That's pretty much the whole question. I've installed Visual C# 2008 Express on a
This is a pretty-much theoretical question, but.. How much of an operating system could
Question is pretty self explanitory. I want to do a simple find and replace,
My question is pretty straightforward: You are an executable file that outputs Access granted
My question is pretty vague :o) - But here is an example : When
I think the question is pretty self explanatory. Anyone done this before? UPDATE :

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.