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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:27:46+00:00 2026-05-22T19:27:46+00:00

I have this code ArrayList<String> city = ‘Anniston’; Criteria crit = session.createCriteria(CandidateResumeInfo.class); crit.add(Restrictions.eq(resumeSearchable, 1));

  • 0

I have this code

ArrayList<String> city = 'Anniston';

Criteria  crit = session.createCriteria(CandidateResumeInfo.class);
 crit.add(Restrictions.eq("resumeSearchable", 1));

Now I want to add below criteria

crit.add(Restrictions.in("cities", city));

but the problem is that cities column is not in CandidateResumeInfo.class its in CandidateInfo Class.

Any idea how to add this criteria as well in the above one,how to add CandidateInfo class as well in the above criteria.

guess i need to do join or link these two tables but how, and will there be any changes in the entity classes?

These are my 2 classes

@Entity

@Table(name="candidateinfo")

public class CandidateInfo implements java.io.Serializable {

    private int id;
    private String firstName;
    private String lastName;
    private String city;
    private String stateProvince;
    private String zip;
    private String country;
    private Set candidateVideos = new HashSet();

    private String yearsOfExperience;
    private String loginName;
    private String password;
    private String address;
    private String emailAddress;
    private int passwordResetQuestionId;
    private String passwordResetAnswer;
    private String middleName;

    private String homeEveningPhone;
    private String workDayPhone;
    private boolean videoSubmited;
    private boolean resumeSubmited;
    private String cellPhone;
    private String availability=null;
    private String workStatus=null;

    private String desiredSalary=null;
    private String currentJobLevel=null;
    private String currentJobTitle=null;
    private String targetJobTitle=null;
    private String alternateTargetJobTitle1=null;
    private String alternateTargetJobTitle2=null;
    private String targetJobType=null;
    private String eventType=null;

    private String joinDate = null;
    private String lastLoginDate = null;

    //private SkillsBean skillsInfo;
    private Set skills = new HashSet();
    private Set candidateResumes = new HashSet();
    private Set targetJobCategoriesId = new HashSet();
    private Set targetJobLocationsId = new HashSet();


    public CandidateInfo() {
    }
    @Column(name="userid")
    public int getId() {
        return this.id;
    }

    @Column(name="loginname")
    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }
    @Column(name="password")
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
    @Column(name="address")
    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }


............................................................................

@Entity

@Table(name="candidateresumeinfo")

public class CandidateResumeInfo implements Serializable{

    private int resumeId;
    private int candidate_userId;
    private String resumeFileLocation;
    private int resumeSearchable;
    private Date lastUpdateDate;
    private String resumeTitle;
    private String resumeText;
    private String skills;
    private int rowCount;


    @Column(name="resumeSearchable")
    public int isResumeSearchable() {
        return resumeSearchable;
    }
    public void setResumeSearchable(int resumeSearchable) {
        this.resumeSearchable = resumeSearchable;
    }
    @Id 
    @GeneratedValue 
    @Column(name="resumeid")
    public int getResumeId() {
        return resumeId;
    }

    public void setResumeId(int resumeId) {
        this.resumeId = resumeId;
    }
    @Column(name="candidate_userid")
    public int getCandidate_userId() {
        return candidate_userId;
    }
    public void setCandidate_userId(int candidate_userId) {
        this.candidate_userId = candidate_userId;
    }
    @Column(name="resumelocation")
    public String getResumeFileLocation() {
        return resumeFileLocation;
    }

    public void setResumeFileLocation(String resumeFileLocation) {
        this.resumeFileLocation = resumeFileLocation;
    }

    @Column(name="resumetitle")
    public String getResumeTitle() {
        return resumeTitle;
    }
    public void setResumeTitle(String resumeTitle) {
        this.resumeTitle = resumeTitle;
    }
    @Column(name="resumetext")
    public String getResumeText() {
        return resumeText;
    }
    public void setResumeText(String resumeText) {
        this.resumeText = resumeText;
    }

    public void setLastUpdateDate(Date lastUpdateDate) {
        this.lastUpdateDate = lastUpdateDate;
    }
    @Column(name="lastUpdateDate")
    public Date getLastUpdateDate() {
        return lastUpdateDate;
    }
    @Column(name="skills")
    public String getSkills() {
        return skills;
    }

    public void setSkills(String skills) {
        this.skills = skills;
    }
    @Transient
    public int getRowCount() {
        return rowCount;
    }

    public void setRowCount(int count) {
        this.rowCount = count;
    }
  • 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-22T19:27:46+00:00Added an answer on May 22, 2026 at 7:27 pm

    u need to add relation like

    @ManyToOne(cascade = CascadeType.ALL)
        public CandidateResumeInfo getCandidateResumeInfo () {
        return this.candidateResumeInfo ;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the below code ArrayList<String> city = 'Anniston'; Criteria crit = session.createCriteria(CandidateResumeInfo.class); crit.add(Restrictions.eq(resumeSearchable,
i have this code: public class Test{ arrayList<String> list = new ArrayList<String>(); String[][] temp_list;
I have written this piece of code public class Test{ public static void main(String[]
I have this code snippet import java.util.ArrayList; import java.util.List; public class AssertTest { public
Let's say I have this: public class Whatever { private ArrayList<String> myList = new
I have written this code to join ArrayList elements: Can it be optimized more?
i have this code: ArrayList list = new ArrayList(); foreach (DataRow dataR in prenume.Rows)
Hey, I have this code here: ArrayList arrayList = new ArrayList(); arrayList.add(one); arrayList.add(two); arrayList.add(three);
I have this code: package com.problemio; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList;
I have this code: public class VoiceActivity extends Activity implements OnClickListener { private TextView

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.