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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:52:10+00:00 2026-05-22T18:52:10+00:00

I have these two classes @Table(name=candidateinfo) Class CandidateInfo { …. @OneToMany CandidateResume candidate; ….

  • 0

I have these two classes

@Table(name=”candidateinfo”)

Class CandidateInfo{

….
@OneToMany

CandidateResume candidate;
….

}

@Table(name=”candidateResume”)

Class CandidateResume{
….

@ManyToOne

CandidateInfo candidates;

…….

}

Now i want to add two restrictoins from 2 different classes(as above) in the below criteria

for this i have

Criteria crit = session.createCriteria(CandidateResumeInfo.class);

crit.add(Restrictions.eq(“resumeSearchable”, 1));// resumeSearchable is in CandidateResume

crit.createCriteria(“candidate”)

.add(Restrictions.eq(“userid”,1)); // userid is in CandidateInfo Class

List rsList = crit.list(); // At this line it goes to exception and not giving any error

for(Iterator it=rsList.iterator(); it.hasNext();)

  • 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-22T18:52:11+00:00Added an answer on May 22, 2026 at 6:52 pm

    Could you please explain what exactly are you trying to search but if I understand you correctly you want to search for all results where canditate id = 1 and candidateresume. searchable = 1;

    Then you need to make something like the following following query:

    String query= "from Candidate c join c.candidate resume where c.userid = :userid and resume.resumeSearchable =: searchable";   
    Query q = session.createQuery(query);
    q.addInteger("userid",1);
    q.addInteger("searchable",1);
    List<Candidate> = q.list();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have these two entities. One for Employees: [Table(Name = Employees)] public class Employee
I have these two classes public class Person { } public class Company {
Let's say we have these two classes: public class Base { public static int
I have two tables with these columns: Users: user, class, grade, location. Classes: class,
I have two classes that I would like to merge into a composite. These
Say I have two classes: Supplier, and Account. These classes are connected via has_one
I have these two modules : package G1; sub new { my $class =
I have these two methods on a class that differ only in one method
I have two tables (tbArea, tbPost) that relate to the following classes. class Area
On the database, I have these two tables: - Destination: - idDestination - name

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.