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

  • SEARCH
  • Home
  • 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 8225543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:27:06+00:00 2026-06-07T15:27:06+00:00

I do have a problem query problem with spring and hibernate. I’ve got a

  • 0

I do have a problem query problem with spring and hibernate.

I’ve got a class called Car which maps ManyToMany to my class Inventory. Inventory btw holds no references to the Car class.
This causes spring and hibernate to create the mapping table car_loading with a fk to the car and a fk to the inventory table.

I now want to query the inventory for a special car:

String squery = "SELECT i from Inventory i, car_loading loads WHERE i.id = loads.loading AND car = ?";

But I am getting the exception

org.hibernate.hql.ast.QuerySyntaxException: car_loading is not mapped

FYI: Hibernate doesn’t support the JOIN ON x.a = y.b leading me to do it that way…

Thanks inn advance for any help!

EDIT – My Mapping

public class Car {

    @OneToOne
    private Driver driver;

    @ManyToMany(cascade=CascadeType.ALL)
    private List<Inventory> loading = new ArrayList<Inventory>();   

    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(pattern="dd:MM:yyy HH:mm")
    private Date lastModified;
    //...
}

public class Inventory {

    private Integer shouldAmount;

    private Integer minAmount;

    private Integer isAmount;

    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(pattern="dd:MM:yyy HH:mm")
    private Date lastModified;
    //..
}
  • 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-06-07T15:27:08+00:00Added an answer on June 7, 2026 at 3:27 pm

    I saw this question and wanted to updated it. I did it the wrong way around. I could simply query the car and return all inventorys within this car. Because there is a relation from car to inventory, but not the other way around. So query a specific car and simply return the inventory list attribute did it for me…

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

Sidebar

Related Questions

I have a problem with a query using hibernate. The entity class EntityClass has
I am newbie to Hibernate criteria and I got problem with simple obtain class.
I ran into a problem with Hibernate concerning hql query execution on classes which
i have spring project under java, using hibernate query, i like to use pessimistic
I'm handling a problem in downcasting a query.uniqueResult() using hibernate. I have 2 classes:
I have an application which uses Spring and Hibernate. In my database there are
I am facing problem to get variable from query string. I have used htaccess
I have problem with my query on C, I’m using the oci8 driver. This
I have problem with SQL query. If given order contains items, witch does not
I have a problem with a query. This query works with phpMyAdmin, but I

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.