dg table : t_applicant id_applicant applicant_name error: > org.hibernate.QueryException: could not resolve property: Cv of: > mst.hrd.hibernate.model.annotation.Applicant [select > idApplicant.applicantName, CV.lastEducation, Vacancy.description from > mst.hrd.hibernate.model.annotation.Applicant as idApplicant inner join > idApplicant.Cv as CV left outer join idPosition.Vacancy as idPosition]
kode: ... "inner join idApplicant.Cv as CV " ... IMHO: karena di Applicant ga ada Cv, busyet, ga tau km ambil Cv tuh drmn, error: > org.hibernate.QueryException: could not resolve property: idCv of: > mst.hrd.hibernate.model.annotation.Applicant [select > idApplicant.applicantName,idCv.lastEducation, Vacancy.description from kode: ..."inner join idApplicant.idCv" ... IMHO: karena di Applicant ga ada idCv, busyet, ga tau km ambil idCv tuh drmn, suggest: sekalipun km bersikukuh pake hql yg sama (sejenis), ganti dg yg lebih terformat: select applicant.applicantName, CV.lastEducation, Vacancy.description from Applicant as applicant inner join applicant.Cv as cv left outer join idPosition.Vacancy as idPosition duhh, idPosition tuh drmn?? class-nya kan Applicant, maka selayaknya nama objectnya applicant atau app, atau appl, bukan idApplicant. itu bukan id. fiuhhhhh!! --- In jug-indonesia@yahoogroups.com, "onsir salman" <onsirsal...@...> wrote: > > Saya sdh coba spt ini masih error, > klw hql spt ini > applicant=HibernateConnection.session > .createQuery("select idApplicant.applicantName, "+ > "CV.lastEducation, "+ > "Vacancy.description "+ > "from Applicant as idApplicant "+ > "inner join idApplicant.Cv as CV "+ > "left outer join idPosition.Vacancy as idPosition") > .list(); > erornya > > org.hibernate.QueryException: could not resolve property: Cv of: > mst.hrd.hibernate.model.annotation.Applicant [select > idApplicant.applicantName, CV.lastEducation, Vacancy.description from > mst.hrd.hibernate.model.annotation.Applicant as idApplicant inner join > idApplicant.Cv as CV left outer join idPosition.Vacancy as idPosition] > at > org.hibernate.persister.entity.AbstractPropertyMapping.throwPropertyException(AbstractPropertyMapping.java:43) > at > org.hibernate.persister.entity.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:37) > > > > > > klw hqlnya spt ini > applicant=HibernateConnection.session > .createQuery("select idApplicant.applicantName," + > "idCv.lastEducation, "+ > "Vacancy.description "+ > "from Applicant as idApplicant "+ > "inner join idApplicant.idCv "+ > "left outer join idPosition.Vacancy as > idPosition") > .list(); > > errornya spt ini > org.hibernate.QueryException: could not resolve property: idCv of: > mst.hrd.hibernate.model.annotation.Applicant [select > idApplicant.applicantName,idCv.lastEducation, Vacancy.description from > mst.hrd.hibernate.model.annotation.Applicant as idApplicant inner join > idApplicant.idCv left outer join idPosition.Vacancy as idPosition] > at > org.hibernate.persister.entity.AbstractPropertyMapping.throwPropertyException(AbstractPropertyMapping.java:43) > at > org.hibernate.persister.entity.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:37) > at > org.hibernate.persister.entity.AbstractEntityPersister.toType(AbstractEntityPersister.java:1310) > at > org.hibernate.hql.ast.tree.FromElementType.getPropertyType(FromElementType.java:280) > > > > > apakah ada yang salah dlm desian table atau relasi di modelnya > > berikut kode nya > Bagaiamana cara menampilkan data dari tiga tabel, menggunakan hql, berikut > desain tabel nya > > t_applicant > id_applicant > applicant_name > > t_cv > id_cv > id_applicant > id_position > last_education > > t_vacancy > id_position > description > > saya ingin menampilkan > > applicantid,applicant_name,last_education,description > > ini kode nya > > > @Entity > @Table(name="t_applicant") > public class Applicant implements java.io.Serializable{ > > @Id > @GeneratedValue(strategy=GenerationType.AUTO) > @Column(name="ID_APPLICANT") > private long idApplicant; > @Column(name="APPLICANT_NAME") private String applicantName; > > @OneToOne > @JoinColumn(name="ID_APPLICANT") > private Cv cv; > > > > @Entity > @Table(name="t_cv") > public class Cv implements java.io.Serializable { > @Id > @GeneratedValue(strategy=GenerationType.AUTO) > @Column(name="ID_CV") > private long idCv; > > @Column(name="ID_APPLICANT") private long idApplicant; > @Column(name="LAST_EDUCATION") private String lastEducation; > > @OneToOne > @JoinColumn(name="ID_POSITION") > private Vacancy vacancy; > > > > @Entity > @Table(name="t_vacancy") > public class Vacancy implements java.io.Serializable{ > > @Id > @GeneratedValue(strategy=GenerationType.AUTO) > @Column(name="ID_POSITION") > private long idPosition; > > @Column(name="DESCRIPTION") private String description; >