I am trying to create a join statement to select a ManyToOne relationship. The join I would like is:
Code:
select * from GuardTracker.tbook, GuardTracker.dbo_nmmain_localcopy where GuardTracker.tbook.name_id = GuardTracker.dbo_nmmain_localcopy.name_id and GuardTracker.tbook.EndDT is null
I have 2 entity that represent the matching tables:
Code:
/**
* PACS May 4, 2011
*/
package org.guardtracker.jes.db.hibernate.entity;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@Entity
@Table(name = "tbook")
public class Tbook implements Serializable{
private Integer bid;
private int bookId;
private int name_id;
private String ext1Link;
private Date begDt;
private Date endDt;
private Date insDt;
private Boolean status1yn;
private Boolean status2yn;
private Boolean status3yn;
private String calcFlagList;
private Integer calcFlagCount;
public Tbook() {
}
public Tbook(int bookId, int name_id, Date begDt, Date insDt) {
this.bookId = bookId;
this.name_id = name_id;
this.begDt = begDt;
this.insDt = insDt;
}
public Tbook(int bookId, int name_id, String ext1Link, Date begDt,
Date endDt, Date insDt, Boolean status1yn, Boolean status2yn,
Boolean status3yn, String calcFlagList, Integer calcFlagCount) {
this.bookId = bookId;
this.name_id = name_id;
this.ext1Link = ext1Link;
this.begDt = begDt;
this.endDt = endDt;
this.insDt = insDt;
this.status1yn = status1yn;
this.status2yn = status2yn;
this.status3yn = status3yn;
this.calcFlagList = calcFlagList;
this.calcFlagCount = calcFlagCount;
}
@Id
@Column(name="BID", nullable=false)
public Integer getBid() {
return this.bid;
}
public void setBid(Integer bid) {
this.bid = bid;
}
List<InmateDemographics> inmateDemo1 = new ArrayList<InmateDemographics>(0);
@OneToMany(mappedBy="tbook")
@Column(name="name_id")
public List<InmateDemographics> getInmateDemographics()
{
return inmateDemo1;
}
public void setInmateDemographics(List<InmateDemographics> idemo)
{
inmateDemo1 = idemo;
}
@Column(name = "book_id")
public int getBookId() {
return this.bookId;
}
public void setBookId(int bookId) {
this.bookId = bookId;
}
@Column(name = "name_id")
public int getName_id() {
return this.name_id;
}
public void setName_id(int name_id) {
this.name_id = name_id;
}
@Column(name = "ext1_link")
public String getExt1Link() {
return this.ext1Link;
}
public void setExt1Link(String ext1Link) {
this.ext1Link = ext1Link;
}
@Column(name = "begDt")
public Date getBegDt() {
return this.begDt;
}
public void setBegDt(Date begDt) {
this.begDt = begDt;
}
@Column(name = "endDt")
public Date getEndDt() {
return this.endDt;
}
public void setEndDt(Date endDt) {
this.endDt = endDt;
}
@Column(name = "insDt")
public Date getInsDt() {
return this.insDt;
}
public void setInsDt(Date insDt) {
this.insDt = insDt;
}
@Column(name = "status1yn")
public Boolean getStatus1yn() {
return this.status1yn;
}
public void setStatus1yn(Boolean status1yn) {
this.status1yn = status1yn;
}
@Column(name = "status2yn")
public Boolean getStatus2yn() {
return this.status2yn;
}
public void setStatus2yn(Boolean status2yn) {
this.status2yn = status2yn;
}
@Column(name = "status3yn")
public Boolean getStatus3yn() {
return this.status3yn;
}
public void setStatus3yn(Boolean status3yn) {
this.status3yn = status3yn;
}
@Column(name = "calcFlagList")
public String getCalcFlagList() {
return this.calcFlagList;
}
public void setCalcFlagList(String calcFlagList) {
this.calcFlagList = calcFlagList;
}
@Column(name = "calcFlagCount")
public Integer getCalcFlagCount() {
return this.calcFlagCount;
}
public void setCalcFlagCount(Integer calcFlagCount) {
this.calcFlagCount = calcFlagCount;
}
}
And InmateDemoGraphics:
Code:
package org.guardtracker.jes.db.hibernate.entity;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@Entity
@Table(name = "dbo_nmmain_localcopy")
public class InmateDemographics implements Serializable {
private int name_id;
private String nametype;
private String warnflag;
private String lastname;
private String firstname;
private String middlename;
private String suffix;
private String race;
private String sex;
private Date dob;
private String age;
private String ssn;
private String streetnbr;
private String streetdir;
private String street;
private String aptFlr;
private String city;
private String state;
private String zip;
private String drLic;
private String dlState;
private Integer aliasId;
private String hair;
private String eye;
private String eye2;
private String height;
private String height2;
private Integer weight;
private Integer weight2;
private String age2;
private String shoesize;
private String resStatus;
private String citizenshp;
private String employer;
private String emplAddr;
private Date datehired;
private String occupation;
private String hphone;
private String wphone;
private String mphone;
private String pager;
private String fedrlic;
private String marital;
private String skintone;
private String birthplace;
private String birthstate;
private String birthcntry;
private String ethnic;
private String nmNarr;
private String business;
private String nmimage;
private Boolean restrictnm;
private String category1;
private String category2;
private Boolean nmchkbox1;
private Boolean nmchkbox2;
private String nmquality;
private String histflag;
private String milibranch;
private String milistatus;
private String attorney;
private String attnyphone;
private String religion;
private Byte dependants;
private String education;
private String occupclass;
private Date dateofresd;
private Date dod;
private String cntCnt;
private String insurance;
private String insurNbr;
private String localId;
private Integer localId2;
private String stateId;
private String fbiNbr;
private String docNbr;
private String immigrtnbr;
private String dnatest;
private Date dnadate;
private String ncicfpc;
private String henry1;
private String henry2;
private String henry11;
private String henry21;
private String ncffinpr;
private Integer geox;
private Integer geoy;
private String geoother;
private String district;
private String zone;
private String tract;
private String reportarea;
private String neighborhd;
private String subdivisn;
private String soundlast;
private String soundfirst;
private String sysflag;
private Date addtime;
private String adduser;
private String addmodule;
private String addconsole;
private String residcode;
private String residdesc;
private String creserve1;
private String creserve2;
private Integer nreserve1;
private String addrsource;
private String mobnamad;
private String mobilepkey;
private String dlClass;
private String dlCdl;
private String emailaddr;
private String bloodtyp;
private String recblock;
private String fpflag;
private String sparId;
private String spartype;
private String grade;
private String locacode;
private Integer dvVict;
private Integer dvOf;
private String language;
private String convkey;
private String noanadopt;
public InmateDemographics() {
}
public InmateDemographics(int nameId) {
this.name_id = nameId;
}
public InmateDemographics(int nameId, String nametype, String warnflag,
String lastname, String firstname, String middlename,
String suffix, String race, String sex, Date dob, String age,
String ssn, String streetnbr, String streetdir, String street,
String aptFlr, String city, String state, String zip, String drLic,
String dlState, Integer aliasId, String hair, String eye,
String eye2, String height, String height2, Integer weight,
Integer weight2, String age2, String shoesize, String resStatus,
String citizenshp, String employer, String emplAddr,
Date datehired, String occupation, String hphone, String wphone,
String mphone, String pager, String fedrlic, String marital,
String skintone, String birthplace, String birthstate,
String birthcntry, String ethnic, String nmNarr, String business,
String nmimage, Boolean restrictnm, String category1,
String category2, Boolean nmchkbox1, Boolean nmchkbox2,
String nmquality, String histflag, String milibranch,
String milistatus, String attorney, String attnyphone,
String religion, Byte dependants, String education,
String occupclass, Date dateofresd, Date dod, String cntCnt,
String insurance, String insurNbr, String localId,
Integer localId2, String stateId, String fbiNbr, String docNbr,
String immigrtnbr, String dnatest, Date dnadate, String ncicfpc,
String henry1, String henry2, String henry11, String henry21,
String ncffinpr, Integer geox, Integer geoy, String geoother,
String district, String zone, String tract, String reportarea,
String neighborhd, String subdivisn, String soundlast,
String soundfirst, String sysflag, Date addtime, String adduser,
String addmodule, String addconsole, String residcode,
String residdesc, String creserve1, String creserve2,
Integer nreserve1, String addrsource, String mobnamad,
String mobilepkey, String dlClass, String dlCdl, String emailaddr,
String bloodtyp, String recblock, String fpflag, String sparId,
String spartype, String grade, String locacode, Integer dvVict,
Integer dvOf, String language, String convkey, String noanadopt) {
this.name_id = nameId;
this.nametype = nametype;
this.warnflag = warnflag;
this.lastname = lastname;
this.firstname = firstname;
this.middlename = middlename;
this.suffix = suffix;
this.race = race;
this.sex = sex;
this.dob = dob;
this.age = age;
this.ssn = ssn;
this.streetnbr = streetnbr;
this.streetdir = streetdir;
this.street = street;
this.aptFlr = aptFlr;
this.city = city;
this.state = state;
this.zip = zip;
this.drLic = drLic;
this.dlState = dlState;
this.aliasId = aliasId;
this.hair = hair;
this.eye = eye;
this.eye2 = eye2;
this.height = height;
this.height2 = height2;
this.weight = weight;
this.weight2 = weight2;
this.age2 = age2;
this.shoesize = shoesize;
this.resStatus = resStatus;
this.citizenshp = citizenshp;
this.employer = employer;
this.emplAddr = emplAddr;
this.datehired = datehired;
this.occupation = occupation;
this.hphone = hphone;
this.wphone = wphone;
this.mphone = mphone;
this.pager = pager;
this.fedrlic = fedrlic;
this.marital = marital;
this.skintone = skintone;
this.birthplace = birthplace;
this.birthstate = birthstate;
this.birthcntry = birthcntry;
this.ethnic = ethnic;
this.nmNarr = nmNarr;
this.business = business;
this.nmimage = nmimage;
this.restrictnm = restrictnm;
this.category1 = category1;
this.category2 = category2;
this.nmchkbox1 = nmchkbox1;
this.nmchkbox2 = nmchkbox2;
this.nmquality = nmquality;
this.histflag = histflag;
this.milibranch = milibranch;
this.milistatus = milistatus;
this.attorney = attorney;
this.attnyphone = attnyphone;
this.religion = religion;
this.dependants = dependants;
this.education = education;
this.occupclass = occupclass;
this.dateofresd = dateofresd;
this.dod = dod;
this.cntCnt = cntCnt;
this.insurance = insurance;
this.insurNbr = insurNbr;
this.localId = localId;
this.localId2 = localId2;
this.stateId = stateId;
this.fbiNbr = fbiNbr;
this.docNbr = docNbr;
this.immigrtnbr = immigrtnbr;
this.dnatest = dnatest;
this.dnadate = dnadate;
this.ncicfpc = ncicfpc;
this.henry1 = henry1;
this.henry2 = henry2;
this.henry11 = henry11;
this.henry21 = henry21;
this.ncffinpr = ncffinpr;
this.geox = geox;
this.geoy = geoy;
this.geoother = geoother;
this.district = district;
this.zone = zone;
this.tract = tract;
this.reportarea = reportarea;
this.neighborhd = neighborhd;
this.subdivisn = subdivisn;
this.soundlast = soundlast;
this.soundfirst = soundfirst;
this.sysflag = sysflag;
this.addtime = addtime;
this.adduser = adduser;
this.addmodule = addmodule;
this.addconsole = addconsole;
this.residcode = residcode;
this.residdesc = residdesc;
this.creserve1 = creserve1;
this.creserve2 = creserve2;
this.nreserve1 = nreserve1;
this.addrsource = addrsource;
this.mobnamad = mobnamad;
this.mobilepkey = mobilepkey;
this.dlClass = dlClass;
this.dlCdl = dlCdl;
this.emailaddr = emailaddr;
this.bloodtyp = bloodtyp;
this.recblock = recblock;
this.fpflag = fpflag;
this.sparId = sparId;
this.spartype = spartype;
this.grade = grade;
this.locacode = locacode;
this.dvVict = dvVict;
this.dvOf = dvOf;
this.language = language;
this.convkey = convkey;
this.noanadopt = noanadopt;
}
/**
* @return the nameId
*/
@Id
public int getName_id() {
return this.name_id;
}
/**
* @param nameId the nameId to set
*/
public void setName_id(int name_id) {
this.name_id = name_id;
}
/**
* @return the nametype
*/
@Column(name = "nametype")
public String getNametype() {
return this.nametype;
}
/**
* @param nametype the nametype to set
*/
public void setNametype(String nametype) {
this.nametype = nametype;
}
/**
* @return the warnflag
*/
@Column(name = "warnflag")
public String getWarnflag() {
return this.warnflag;
}
/**
* @param warnflag the warnflag to set
*/
public void setWarnflag(String warnflag) {
this.warnflag = warnflag;
}
/**
* @return the lastname
*/
@Column(name = "lastname")
public String getLastname() {
return this.lastname;
}
/**
* @param lastname the lastname to set
*/
public void setLastname(String lastname) {
this.lastname = lastname;
}
/**
* @return the firstname
*/
@Column(name = "firstname")
public String getFirstname() {
return this.firstname;
}
/**
* @param firstname the firstname to set
*/
public void setFirstname(String firstname) {
this.firstname = firstname;
}
/**
* @return the middlename
*/
@Column(name = "middlename")
public String getMiddlename() {
return this.middlename;
}
/**
* @param middlename the middlename to set
*/
public void setMiddlename(String middlename) {
this.middlename = middlename;
}
/**
* @return the suffix
*/
@Column(name = "suffix")
public String getSuffix() {
return this.suffix;
}
/**
* @param suffix the suffix to set
*/
public void setSuffix(String suffix) {
this.suffix = suffix;
}
/**
* @return the race
*/
@Column(name = "race")
public String getRace() {
return this.race;
}
/**
* @param race the race to set
*/
public void setRace(String race) {
this.race = race;
}
/**
* @return the sex
*/
@Column(name = "sex")
public String getSex() {
return this.sex;
}
/**
* @param sex the sex to set
*/
public void setSex(String sex) {
this.sex = sex;
}
/**
* @return the dob
*/
@Column(name = "dob")
public Date getDob() {
return this.dob;
}
/**
* @param dob the dob to set
*/
public void setDob(Date dob) {
this.dob = dob;
}
/**
* @return the age
*/
@Column(name = "age")
public String getAge() {
return this.age;
}
/**
* @param age the age to set
*/
public void setAge(String age) {
this.age = age;
}
/**
* @return the ssn
*/
@Column(name = "ssn")
public String getSsn() {
return this.ssn;
}
/**
* @param ssn the ssn to set
*/
public void setSsn(String ssn) {
this.ssn = ssn;
}
/**
* @return the streetnbr
*/
@Column(name = "streetnbr")
public String getStreetnbr() {
return this.streetnbr;
}
/**
* @param streetnbr the streetnbr to set
*/
public void setStreetnbr(String streetnbr) {
this.streetnbr = streetnbr;
}
/**
* @return the streetdir
*/
@Column(name = "streetdir")
public String getStreetdir() {
return this.streetdir;
}
/**
* @param streetdir the streetdir to set
*/
public void setStreetdir(String streetdir) {
this.streetdir = streetdir;
}
/**
* @return the street
*/
@Column(name = "street")
public String getStreet() {
return this.street;
}
/**
* @param street the street to set
*/
public void setStreet(String street) {
this.street = street;
}
/**
* @return the aptFlr
*/
@Column(name = "apt_flr")
public String getAptFlr() {
return this.aptFlr;
}
/**
* @param aptFlr the aptFlr to set
*/
public void setAptFlr(String aptFlr) {
this.aptFlr = aptFlr;
}
/**
* @return the city
*/
@Column(name = "city")
public String getCity() {
return this.city;
}
/**
* @param city the city to set
*/
public void setCity(String city) {
this.city = city;
}
/**
* @return the state
*/
@Column(name = "state")
public String getState() {
return this.state;
}
/**
* @param state the state to set
*/
public void setState(String state) {
this.state = state;
}
/**
* @return the zip
*/
@Column(name = "zip")
public String getZip() {
return this.zip;
}
/**
* @param zip the zip to set
*/
public void setZip(String zip) {
this.zip = zip;
}
/**
* @return the drLic
*/
@Column(name = "dr_lic")
public String getDrLic() {
return this.drLic;
}
/**
* @param drLic the drLic to set
*/
public void setDrLic(String drLic) {
this.drLic = drLic;
}
/**
* @return the dlState
*/
@Column(name = "dl_state")
public String getDlState() {
return this.dlState;
}
/**
* @param dlState the dlState to set
*/
public void setDlState(String dlState) {
this.dlState = dlState;
}
/**
* @return the aliasId
*/
@Column(name = "alias_id")
public Integer getAliasId() {
return this.aliasId;
}
/**
* @param aliasId the aliasId to set
*/
public void setAliasId(Integer aliasId) {
this.aliasId = aliasId;
}
/**
* @return the hair
*/
@Column(name = "hair")
public String getHair() {
return this.hair;
}
/**
* @param hair the hair to set
*/
public void setHair(String hair) {
this.hair = hair;
}
/**
* @return the eye
*/
@Column(name = "eye")
public String getEye() {
return this.eye;
}
/**
* @param eye the eye to set
*/
public void setEye(String eye) {
this.eye = eye;
}
/**
* @return the eye2
*/
@Column(name = "eye2")
public String getEye2() {
return this.eye2;
}
/**
* @param eye2 the eye2 to set
*/
public void setEye2(String eye2) {
this.eye2 = eye2;
}
/**
* @return the height
*/
@Column(name = "height")
public String getHeight() {
return this.height;
}
/**
* @param height the height to set
*/
public void setHeight(String height) {
this.height = height;
}
/**
* @return the height2
*/
@Column(name = "height2")
public String getHeight2() {
return this.height2;
}
/**
* @param height2 the height2 to set
*/
public void setHeight2(String height2) {
this.height2 = height2;
}
/**
* @return the weight
*/
@Column(name = "weight")
public Integer getWeight() {
return this.weight;
}
/**
* @param weight the weight to set
*/
public void setWeight(Integer weight) {
this.weight = weight;
}
/**
* @return the weight2
*/
@Column(name = "weight2")
public Integer getWeight2() {
return this.weight2;
}
/**
* @param weight2 the weight2 to set
*/
public void setWeight2(Integer weight2) {
this.weight2 = weight2;
}
/**
* @return the age2
*/
@Column(name = "age2")
public String getAge2() {
return this.age2;
}
/**
* @param age2 the age2 to set
*/
public void setAge2(String age2) {
this.age2 = age2;
}
/**
* @return the shoesize
*/
@Column(name = "shoesize")
public String getShoesize() {
return this.shoesize;
}
/**
* @param shoesize the shoesize to set
*/
public void setShoesize(String shoesize) {
this.shoesize = shoesize;
}
/**
* @return the resStatus
*/
@Column(name = "res_status")
public String getResStatus() {
return this.resStatus;
}
/**
* @param resStatus the resStatus to set
*/
public void setResStatus(String resStatus) {
this.resStatus = resStatus;
}
/**
* @return the citizenshp
*/
@Column(name = "citizenshp")
public String getCitizenshp() {
return this.citizenshp;
}
/**
* @param citizenshp the citizenshp to set
*/
public void setCitizenshp(String citizenshp) {
this.citizenshp = citizenshp;
}
/**
* @return the employer
*/
@Column(name = "employer")
public String getEmployer() {
return this.employer;
}
/**
* @param employer the employer to set
*/
public void setEmployer(String employer) {
this.employer = employer;
}
/**
* @return the emplAddr
*/
@Column(name = "empl_addr")
public String getEmplAddr() {
return this.emplAddr;
}
/**
* @param emplAddr the emplAddr to set
*/
public void setEmplAddr(String emplAddr) {
this.emplAddr = emplAddr;
}
/**
* @return the datehired
*/
@Column(name = "datehired")
public Date getDatehired() {
return this.datehired;
}
/**
* @param datehired the datehired to set
*/
public void setDatehired(Date datehired) {
this.datehired = datehired;
}
/**
* @return the occupation
*/
@Column(name = "occupation")
public String getOccupation() {
return this.occupation;
}
/**
* @param occupation the occupation to set
*/
public void setOccupation(String occupation) {
this.occupation = occupation;
}
/**
* @return the hphone
*/
@Column(name = "hphone")
public String getHphone() {
return this.hphone;
}
/**
* @param hphone the hphone to set
*/
public void setHphone(String hphone) {
this.hphone = hphone;
}
/**
* @return the wphone
*/
@Column(name = "wphone")
public String getWphone() {
return this.wphone;
}
/**
* @param wphone the wphone to set
*/
public void setWphone(String wphone) {
this.wphone = wphone;
}
/**
* @return the mphone
*/
@Column(name = "mphone")
public String getMphone() {
return this.mphone;
}
/**
* @param mphone the mphone to set
*/
public void setMphone(String mphone) {
this.mphone = mphone;
}
/**
* @return the pager
*/
@Column(name = "pager")
public String getPager() {
return this.pager;
}
/**
* @param pager the pager to set
*/
public void setPager(String pager) {
this.pager = pager;
}
/**
* @return the fedrlic
*/
@Column(name = "fedrlic")
public String getFedrlic() {
return this.fedrlic;
}
/**
* @param fedrlic the fedrlic to set
*/
public void setFedrlic(String fedrlic) {
this.fedrlic = fedrlic;
}
/**
* @return the marital
*/
@Column(name = "marital")
public String getMarital() {
return this.marital;
}
/**
* @param marital the marital to set
*/
public void setMarital(String marital) {
this.marital = marital;
}
/**
* @return the skintone
*/
@Column(name = "skintone")
public String getSkintone() {
return this.skintone;
}
/**
* @param skintone the skintone to set
*/
public void setSkintone(String skintone) {
this.skintone = skintone;
}
/**
* @return the birthplace
*/
@Column(name = "birthplace")
public String getBirthplace() {
return this.birthplace;
}
/**
* @param birthplace the birthplace to set
*/
public void setBirthplace(String birthplace) {
this.birthplace = birthplace;
}
/**
* @return the birthstate
*/
@Column(name = "birthstate")
public String getBirthstate() {
return this.birthstate;
}
/**
* @param birthstate the birthstate to set
*/
public void setBirthstate(String birthstate) {
this.birthstate = birthstate;
}
/**
* @return the birthcntry
*/
@Column(name = "birthcntry")
public String getBirthcntry() {
return this.birthcntry;
}
/**
* @param birthcntry the birthcntry to set
*/
public void setBirthcntry(String birthcntry) {
this.birthcntry = birthcntry;
}
/**
* @return the ethnic
*/
@Column(name = "ethnic")
public String getEthnic() {
return this.ethnic;
}
/**
* @param ethnic the ethnic to set
*/
public void setEthnic(String ethnic) {
this.ethnic = ethnic;
}
/**
* @return the nmNarr
*/
@Column(name = "nm_narr")
public String getNmNarr() {
return this.nmNarr;
}
/**
* @param nmNarr the nmNarr to set
*/
public void setNmNarr(String nmNarr) {
this.nmNarr = nmNarr;
}
/**
* @return the business
*/
@Column(name = "business")
public String getBusiness() {
return this.business;
}
/**
* @param business the business to set
*/
public void setBusiness(String business) {
this.business = business;
}
/**
* @return the nmimage
*/
@Column(name = "nmimage")
public String getNmimage() {
return this.nmimage;
}
/**
* @param nmimage the nmimage to set
*/
public void setNmimage(String nmimage) {
this.nmimage = nmimage;
}
/**
* @return the restrictnm
*/
@Column(name = "restrictnm")
public Boolean getRestrictnm() {
return this.restrictnm;
}
/**
* @param restrictnm the restrictnm to set
*/
public void setRestrictnm(Boolean restrictnm) {
this.restrictnm = restrictnm;
}
/**
* @return the category1
*/
@Column(name = "category1")
public String getCategory1() {
return this.category1;
}
/**
* @param category1 the category1 to set
*/
public void setCategory1(String category1) {
this.category1 = category1;
}
/**
* @return the category2
*/
@Column(name = "category2")
public String getCategory2() {
return this.category2;
}
/**
* @param category2 the category2 to set
*/
public void setCategory2(String category2) {
this.category2 = category2;
}
/**
* @return the nmchkbox1
*/
@Column(name = "nmchkbox1")
public Boolean getNmchkbox1() {
return this.nmchkbox1;
}
/**
* @param nmchkbox1 the nmchkbox1 to set
*/
public void setNmchkbox1(Boolean nmchkbox1) {
this.nmchkbox1 = nmchkbox1;
}
/**
* @return the nmchkbox2
*/
@Column(name = "nmchkbox2")
public Boolean getNmchkbox2() {
return this.nmchkbox2;
}
/**
* @param nmchkbox2 the nmchkbox2 to set
*/
public void setNmchkbox2(Boolean nmchkbox2) {
this.nmchkbox2 = nmchkbox2;
}
/**
* @return the nmquality
*/
@Column(name = "nmquality")
public String getNmquality() {
return this.nmquality;
}
/**
* @param nmquality the nmquality to set
*/
public void setNmquality(String nmquality) {
this.nmquality = nmquality;
}
/**
* @return the histflag
*/
@Column(name = "histflag")
public String getHistflag() {
return this.histflag;
}
/**
* @param histflag the histflag to set
*/
public void setHistflag(String histflag) {
this.histflag = histflag;
}
/**
* @return the milibranch
*/
@Column(name = "milibranch")
public String getMilibranch() {
return this.milibranch;
}
/**
* @param milibranch the milibranch to set
*/
public void setMilibranch(String milibranch) {
this.milibranch = milibranch;
}
/**
* @return the milistatus
*/
@Column(name = "milistatus")
public String getMilistatus() {
return this.milistatus;
}
/**
* @param milistatus the milistatus to set
*/
public void setMilistatus(String milistatus) {
this.milistatus = milistatus;
}
/**
* @return the attorney
*/
@Column(name = "attorney")
public String getAttorney() {
return this.attorney;
}
/**
* @param attorney the attorney to set
*/
public void setAttorney(String attorney) {
this.attorney = attorney;
}
/**
* @return the attnyphone
*/
@Column(name = "attnyphone")
public String getAttnyphone() {
return this.attnyphone;
}
/**
* @param attnyphone the attnyphone to set
*/
public void setAttnyphone(String attnyphone) {
this.attnyphone = attnyphone;
}
/**
* @return the religion
*/
@Column(name = "religion")
public String getReligion() {
return this.religion;
}
/**
* @param religion the religion to set
*/
public void setReligion(String religion) {
this.religion = religion;
}
/**
* @return the dependants
*/
@Column(name = "dependants")
public Byte getDependants() {
return this.dependants;
}
/**
* @param dependants the dependants to set
*/
public void setDependants(Byte dependants) {
this.dependants = dependants;
}
/**
* @return the education
*/
@Column(name = "education")
public String getEducation() {
return this.education;
}
/**
* @param education the education to set
*/
public void setEducation(String education) {
this.education = education;
}
/**
* @return the occupclass
*/
@Column(name = "occupclass")
public String getOccupclass() {
return this.occupclass;
}
/**
* @param occupclass the occupclass to set
*/
public void setOccupclass(String occupclass) {
this.occupclass = occupclass;
}
/**
* @return the dateofresd
*/
@Column(name = "dateofresd")
public Date getDateofresd() {
return this.dateofresd;
}
/**
* @param dateofresd the dateofresd to set
*/
public void setDateofresd(Date dateofresd) {
this.dateofresd = dateofresd;
}
/**
* @return the dod
*/
@Column(name = "dod")
public Date getDod() {
return this.dod;
}
/**
* @param dod the dod to set
*/
public void setDod(Date dod) {
this.dod = dod;
}
/**
* @return the cntCnt
*/
@Column(name = "cnt_cnt")
public String getCntCnt() {
return this.cntCnt;
}
/**
* @param cntCnt the cntCnt to set
*/
public void setCntCnt(String cntCnt) {
this.cntCnt = cntCnt;
}
/**
* @return the insurance
*/
@Column(name = "insurance")
public String getInsurance() {
return this.insurance;
}
/**
* @param insurance the insurance to set
*/
public void setInsurance(String insurance) {
this.insurance = insurance;
}
/**
* @return the insurNbr
*/
@Column(name = "insur_nbr")
public String getInsurNbr() {
return this.insurNbr;
}
/**
* @param insurNbr the insurNbr to set
*/
public void setInsurNbr(String insurNbr) {
this.insurNbr = insurNbr;
}
/**
* @return the localId
*/
@Column(name = "local_id")
public String getLocalId() {
return this.localId;
}
/**
* @param localId the localId to set
*/
public void setLocalId(String localId) {
this.localId = localId;
}
/**
* @return the localId2
*/
@Column(name = "local_id2")
public Integer getLocalId2() {
return this.localId2;
}
/**
* @param localId2 the localId2 to set
*/
public void setLocalId2(Integer localId2) {
this.localId2 = localId2;
}
/**
* @return the stateId
*/
@Column(name = "state_id")
public String getStateId() {
return this.stateId;
}
/**
* @param stateId the stateId to set
*/
public void setStateId(String stateId) {
this.stateId = stateId;
}
/**
* @return the fbiNbr
*/
@Column(name = "fbi_nbr")
public String getFbiNbr() {
return this.fbiNbr;
}
/**
* @param fbiNbr the fbiNbr to set
*/
public void setFbiNbr(String fbiNbr) {
this.fbiNbr = fbiNbr;
}
/**
* @return the docNbr
*/
@Column(name = "doc_nbr")
public String getDocNbr() {
return this.docNbr;
}
/**
* @param docNbr the docNbr to set
*/
public void setDocNbr(String docNbr) {
this.docNbr = docNbr;
}
/**
* @return the immigrtnbr
*/
@Column(name = "immigrtnbr")
public String getImmigrtnbr() {
return this.immigrtnbr;
}
/**
* @param immigrtnbr the immigrtnbr to set
*/
public void setImmigrtnbr(String immigrtnbr) {
this.immigrtnbr = immigrtnbr;
}
/**
* @return the dnatest
*/
@Column(name = "dnatest")
public String getDnatest() {
return this.dnatest;
}
/**
* @param dnatest the dnatest to set
*/
public void setDnatest(String dnatest) {
this.dnatest = dnatest;
}
/**
* @return the dnadate
*/
@Column(name = "dnadate")
public Date getDnadate() {
return this.dnadate;
}
/**
* @param dnadate the dnadate to set
*/
public void setDnadate(Date dnadate) {
this.dnadate = dnadate;
}
/**
* @return the ncicfpc
*/
@Column(name = "ncicfpc")
public String getNcicfpc() {
return this.ncicfpc;
}
/**
* @param ncicfpc the ncicfpc to set
*/
public void setNcicfpc(String ncicfpc) {
this.ncicfpc = ncicfpc;
}
/**
* @return the henry1
*/
@Column(name = "henry1")
public String getHenry1() {
return this.henry1;
}
/**
* @param henry1 the henry1 to set
*/
public void setHenry1(String henry1) {
this.henry1 = henry1;
}
/**
* @return the henry2
*/
@Column(name = "henry2")
public String getHenry2() {
return this.henry2;
}
/**
* @param henry2 the henry2 to set
*/
public void setHenry2(String henry2) {
this.henry2 = henry2;
}
/**
* @return the henry11
*/
@Column(name = "henry11")
public String getHenry11() {
return this.henry11;
}
/**
* @param henry11 the henry11 to set
*/
public void setHenry11(String henry11) {
this.henry11 = henry11;
}
/**
* @return the henry21
*/
@Column(name = "henry21")
public String getHenry21() {
return this.henry21;
}
/**
* @param henry21 the henry21 to set
*/
public void setHenry21(String henry21) {
this.henry21 = henry21;
}
/**
* @return the ncffinpr
*/
@Column(name = "ncffinpr")
public String getNcffinpr() {
return this.ncffinpr;
}
/**
* @param ncffinpr the ncffinpr to set
*/
public void setNcffinpr(String ncffinpr) {
this.ncffinpr = ncffinpr;
}
/**
* @return the geox
*/
@Column(name = "geox")
public Integer getGeox() {
return this.geox;
}
/**
* @param geox the geox to set
*/
public void setGeox(Integer geox) {
this.geox = geox;
}
/**
* @return the geoy
*/
@Column(name = "geoy")
public Integer getGeoy() {
return this.geoy;
}
/**
* @param geoy the geoy to set
*/
public void setGeoy(Integer geoy) {
this.geoy = geoy;
}
/**
* @return the geoother
*/
@Column(name = "geoother")
public String getGeoother() {
return this.geoother;
}
/**
* @param geoother the geoother to set
*/
public void setGeoother(String geoother) {
this.geoother = geoother;
}
/**
* @return the district
*/
@Column(name = "district")
public String getDistrict() {
return this.district;
}
/**
* @param district the district to set
*/
public void setDistrict(String district) {
this.district = district;
}
/**
* @return the zone
*/
@Column(name = "zone")
public String getZone() {
return this.zone;
}
/**
* @param zone the zone to set
*/
public void setZone(String zone) {
this.zone = zone;
}
/**
* @return the tract
*/
@Column(name = "tract")
public String getTract() {
return this.tract;
}
/**
* @param tract the tract to set
*/
public void setTract(String tract) {
this.tract = tract;
}
/**
* @return the reportarea
*/
@Column(name = "reportarea")
public String getReportarea() {
return this.reportarea;
}
/**
* @param reportarea the reportarea to set
*/
public void setReportarea(String reportarea) {
this.reportarea = reportarea;
}
/**
* @return the neighborhd
*/
@Column(name = "neighborhd")
public String getNeighborhd() {
return this.neighborhd;
}
/**
* @param neighborhd the neighborhd to set
*/
public void setNeighborhd(String neighborhd) {
this.neighborhd = neighborhd;
}
/**
* @return the subdivisn
*/
@Column(name = "subdivisn")
public String getSubdivisn() {
return this.subdivisn;
}
/**
* @param subdivisn the subdivisn to set
*/
public void setSubdivisn(String subdivisn) {
this.subdivisn = subdivisn;
}
/**
* @return the soundlast
*/
@Column(name = "soundlast")
public String getSoundlast() {
return this.soundlast;
}
/**
* @param soundlast the soundlast to set
*/
public void setSoundlast(String soundlast) {
this.soundlast = soundlast;
}
/**
* @return the soundfirst
*/
@Column(name = "soundfirst")
public String getSoundfirst() {
return this.soundfirst;
}
/**
* @param soundfirst the soundfirst to set
*/
public void setSoundfirst(String soundfirst) {
this.soundfirst = soundfirst;
}
/**
* @return the sysflag
*/
@Column(name = "sysflag")
public String getSysflag() {
return this.sysflag;
}
/**
* @param sysflag the sysflag to set
*/
public void setSysflag(String sysflag) {
this.sysflag = sysflag;
}
/**
* @return the addtime
*/
@Column(name = "addtime")
public Date getAddtime() {
return this.addtime;
}
/**
* @param addtime the addtime to set
*/
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
/**
* @return the adduser
*/
@Column(name = "adduser")
public String getAdduser() {
return this.adduser;
}
/**
* @param adduser the adduser to set
*/
public void setAdduser(String adduser) {
this.adduser = adduser;
}
/**
* @return the addmodule
*/
@Column(name = "addmodule")
public String getAddmodule() {
return this.addmodule;
}
/**
* @param addmodule the addmodule to set
*/
public void setAddmodule(String addmodule) {
this.addmodule = addmodule;
}
/**
* @return the addconsole
*/
@Column(name = "addconsole")
public String getAddconsole() {
return this.addconsole;
}
/**
* @param addconsole the addconsole to set
*/
public void setAddconsole(String addconsole) {
this.addconsole = addconsole;
}
/**
* @return the residcode
*/
@Column(name = "residcode")
public String getResidcode() {
return this.residcode;
}
/**
* @param residcode the residcode to set
*/
public void setResidcode(String residcode) {
this.residcode = residcode;
}
/**
* @return the residdesc
*/
@Column(name = "residdesc")
public String getResiddesc() {
return this.residdesc;
}
/**
* @param residdesc the residdesc to set
*/
public void setResiddesc(String residdesc) {
this.residdesc = residdesc;
}
/**
* @return the creserve1
*/
@Column(name = "creserve1")
public String getCreserve1() {
return this.creserve1;
}
/**
* @param creserve1 the creserve1 to set
*/
public void setCreserve1(String creserve1) {
this.creserve1 = creserve1;
}
/**
* @return the creserve2
*/
@Column(name = "creserve2")
public String getCreserve2() {
return this.creserve2;
}
/**
* @param creserve2 the creserve2 to set
*/
public void setCreserve2(String creserve2) {
this.creserve2 = creserve2;
}
/**
* @return the nreserve1
*/
@Column(name = "nreserve1")
public Integer getNreserve1() {
return this.nreserve1;
}
/**
* @param nreserve1 the nreserve1 to set
*/
public void setNreserve1(Integer nreserve1) {
this.nreserve1 = nreserve1;
}
/**
* @return the addrsource
*/
@Column(name = "addrsource")
public String getAddrsource() {
return this.addrsource;
}
/**
* @param addrsource the addrsource to set
*/
public void setAddrsource(String addrsource) {
this.addrsource = addrsource;
}
/**
* @return the mobnamad
*/
@Column(name = "mobnamad")
public String getMobnamad() {
return this.mobnamad;
}
/**
* @param mobnamad the mobnamad to set
*/
public void setMobnamad(String mobnamad) {
this.mobnamad = mobnamad;
}
/**
* @return the mobilepkey
*/
@Column(name = "mobilepkey")
public String getMobilepkey() {
return this.mobilepkey;
}
/**
* @param mobilepkey the mobilepkey to set
*/
public void setMobilepkey(String mobilepkey) {
this.mobilepkey = mobilepkey;
}
/**
* @return the dlClass
*/
@Column(name = "dl_class")
public String getDlClass() {
return this.dlClass;
}
/**
* @param dlClass the dlClass to set
*/
public void setDlClass(String dlClass) {
this.dlClass = dlClass;
}
/**
* @return the dlCdl
*/
@Column(name = "dl_cdl")
public String getDlCdl() {
return this.dlCdl;
}
/**
* @param dlCdl the dlCdl to set
*/
public void setDlCdl(String dlCdl) {
this.dlCdl = dlCdl;
}
/**
* @return the emailaddr
*/
@Column(name = "emailaddr")
public String getEmailaddr() {
return this.emailaddr;
}
/**
* @param emailaddr the emailaddr to set
*/
public void setEmailaddr(String emailaddr) {
this.emailaddr = emailaddr;
}
/**
* @return the bloodtyp
*/
@Column(name = "bloodtyp")
public String getBloodtyp() {
return this.bloodtyp;
}
/**
* @param bloodtyp the bloodtyp to set
*/
public void setBloodtyp(String bloodtyp) {
this.bloodtyp = bloodtyp;
}
/**
* @return the recblock
*/
@Column(name = "recblock")
public String getRecblock() {
return this.recblock;
}
/**
* @param recblock the recblock to set
*/
public void setRecblock(String recblock) {
this.recblock = recblock;
}
/**
* @return the fpflag
*/
@Column(name = "fpflag")
public String getFpflag() {
return this.fpflag;
}
/**
* @param fpflag the fpflag to set
*/
public void setFpflag(String fpflag) {
this.fpflag = fpflag;
}
/**
* @return the sparId
*/
@Column(name = "spar_id")
public String getSparId() {
return this.sparId;
}
/**
* @param sparId the sparId to set
*/
public void setSparId(String sparId) {
this.sparId = sparId;
}
/**
* @return the spartype
*/
@Column(name = "spartype")
public String getSpartype() {
return this.spartype;
}
/**
* @param spartype the spartype to set
*/
public void setSpartype(String spartype) {
this.spartype = spartype;
}
/**
* @return the grade
*/
@Column(name = "grade")
public String getGrade() {
return this.grade;
}
/**
* @param grade the grade to set
*/
public void setGrade(String grade) {
this.grade = grade;
}
/**
* @return the locacode
*/
@Column(name = "locacode")
public String getLocacode() {
return this.locacode;
}
/**
* @param locacode the locacode to set
*/
public void setLocacode(String locacode) {
this.locacode = locacode;
}
/**
* @return the dvVict
*/
@Column(name = "dv_vict")
public Integer getDvVict() {
return this.dvVict;
}
/**
* @param dvVict the dvVict to set
*/
public void setDvVict(Integer dvVict) {
this.dvVict = dvVict;
}
/**
* @return the dvOf
*/
@Column(name = "dv_of")
public Integer getDvOf() {
return this.dvOf;
}
/**
* @param dvOf the dvOf to set
*/
public void setDvOf(Integer dvOf) {
this.dvOf = dvOf;
}
/**
* @return the language
*/
@Column(name = "language")
public String getLanguage() {
return this.language;
}
/**
* @param language the language to set
*/
public void setLanguage(String language) {
this.language = language;
}
/**
* @return the convkey
*/
@Column(name = "convkey")
public String getConvkey() {
return this.convkey;
}
/**
* @param convkey the convkey to set
*/
public void setConvkey(String convkey) {
this.convkey = convkey;
}
/**
* @return the noanadopt
*/
@Column(name = "noanadopt")
public String getNoanadopt() {
return this.noanadopt;
}
/**
* @param noanadopt the noanadopt to set
*/
public void setNoanadopt(String noanadopt) {
this.noanadopt = noanadopt;
}
public Tbook tbook = null;
/**
* @return the tbook
*/
@ManyToOne
@JoinColumn(name="name_id", insertable=false, updatable=false)
public Tbook getTbook() {
return this.tbook;
}
/**
* @param tbook the tbook to set
*/
public void setTbook(Tbook tbook) {
this.tbook = tbook;
}
}
Hibernate returns all of the Tbook values but only some of the InmateDemographics. The Join statement returns what I need. What am I doing wrong?
I have been trying different combinations and I think that using:
Code:
List<InmateDemographics> inmateDemo1 = new ArrayList<InmateDemographics>(0);
@OneToMany(mappedBy="tbook")
@Column(name="name_id")
public List<InmateDemographics> getInmateDemographics()
{
return inmateDemo1;
}
public void setInmateDemographics(List<InmateDemographics> idemo)
{
inmateDemo1 = idemo;
}
Code:
public Tbook tbook = null;
/**
* @return the tbook
*/
@ManyToOne
@JoinColumn(name="name_id", insertable=false, updatable=false)
public Tbook getTbook() {
return this.tbook;
}
/**
* @param tbook the tbook to set
*/
public void setTbook(Tbook tbook) {
this.tbook = tbook;
}
Should do the trick. No Love!