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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:26:10+00:00 2026-05-25T17:26:10+00:00

There is a classItem and it has some associated classes called Vehicle,Vmodel,Category,ItemName,Brand,SizeModel.Those each class

  • 0

There is a class”Item” and it has some associated classes called Vehicle,Vmodel,Category,ItemName,Brand,SizeModel.Those each class has properites id and a name(for example Vehicle class, “vid” and “vname”).Item class has itemcode.

Also I need to get Item objects from a given sample Item object(called “sItem“) which equal to my sample item object’s properties and my object’s associated objects properties.
Here is my code

Session session = getSession();
        List list = null;
        try {
            list = session.createCriteria(Item.class).add(Example.create(sItem))
                    .createCriteria("vehicle").add(Example.create(sItem.getVehicle())).
                    createCriteria("vmodel").add(Example.create(sItem.getVmodel())).
                    createCriteria("category").add(Example.create(sItem.getCategory())).
                    createCriteria("itemName").add(Example.create(sItem.getItemName())).
                    createCriteria("brands").add(Example.create(sItem.getBrands())).
                    createCriteria("sizeModel").add(Example.create(sItem.getSizeModel())).
                    list();
        } catch (HibernateException e) {
            e.printStackTrace();
        }

I refered this (15.6 section and last sample code in that section).

when this above code is executed, an error occures
(org.hibernate.QueryException: could not resolve property: vmodel of: Entity.Vehicle). Please any one let me know where is the problem and where should I checked. My all mappings and other configuring classes are created with Netbeans IDE.

  • 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-25T17:26:11+00:00Added an answer on May 25, 2026 at 5:26 pm

    Try to split your criteria creation code like this:

    Criteria baseCrit = session.createCriteria(Item.class).add(Example.create(sItem));
    baseCrit.createCriteria("vehicle").add(Example.create(sItem.getVehicle()));
    baseCrit.createCriteria("vmodel").add(Example.create(sItem.getVmodel()));
    baseCrit.createCriteria("category").add(Example.create(sItem.getCategory()));
    baseCrit.createCriteria("itemName").add(Example.create(sItem.getItemName()));
    baseCrit.createCriteria("brands").add(Example.create(sItem.getBrands()));
    baseCrit.createCriteria("sizeModel").add(Example.create(sItem.getSizeModel()));
    list = baseCrit.list();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There is a directed graph having a single designated node called root from which
There are two intents on the receiver side which are called from the same
I have an Item entity that has a ManyToOne relationship to a Category entity.
There are many class=item blocks on the page. For each one there is different
I have two classes: Action class, that has a method for executing VBScript files,
Imagine I have a table called item that has a column called price. In
To keep things organized I determined there are three item classes that a spider
There is a moment in my app, that I need to force to show
There is a column that exists in 2 tables. In table 1, this column
There's a Rails 3.2.3 web application which doesn't use any database. But in spite

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.