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 6812581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:27:58+00:00 2026-05-26T20:27:58+00:00

I’m making an application currently and I’ve started from creating a DB schema, which

  • 0

I’m making an application currently and I’ve started from creating a DB schema, which looks like this:

Database schema

There are few tables (users_groups_maps, articles_tags_maps reported_articles, favourite_articles and browse_later_articles) that represent many-to-many releationship. I created a reverse configuration file and started to reverse-engineer so I could get Java classes out of it (Annotations, JDK 5 and EJB3, which results in javax.persistence.* annotations).

The basic tables (such as warnings, users) are just fine (there are fields such as

private Set<BrowseLaterArticles> browseLaterArticleses = new HashSet<BrowseLaterArticles>(0);

, but I guess it’s just fine – I’m a hibernate newbie).

However, the problem (I guess) starts with those many-to-many relationships (for example UserGroupsMaps constructor looks like this:

public UsersGroupsMaps(UsersGroupsMapsId id, Users users, Groups groups) {
    this.id = id;
    this.users = users;
    this.groups = groups;
}

, where UserGroupsMapsId is a wrapper for userId and groupId pair)

Am I getting something wrong or should it be coded differently? I know there’s a ManyToMany annotation, why isn’t hibernate using it?

//Additionally, I have not-so-hibernate-related question – in comments and private_messages tables, there are those parent__id fields, which should refer to the same tables. I created a foreign keys to their own tables, but I’m not sure if it’s right, is it? How should it look like? In this care hibernate generates two fields with the same name:
private Comments comments;
in Comments class.

Regards,
Marcin

  • 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-26T20:27:58+00:00Added an answer on May 26, 2026 at 8:27 pm

    Your hibernate mapping is messed up somewhere. Hibernate gives you the option to not create objects for many-to-many join objects as long as there are no additional columns in that table. I assume you are using eclipse hibernate plugin? I would check the settings of the code generator to see if you can tell it not to create that object.

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

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
I am trying to understand how to use SyndicationItem to display feed which is

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.