-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: using more than 1 left join - No getter method for property
PostPosted: Tue Dec 06, 2005 6:44 pm 
Beginner
Beginner

Joined: Wed Oct 19, 2005 3:30 pm
Posts: 25
I have a query set up. I was using an old query left joining several tables and successfully searching and displaying the results on a jsp. I just switched to using a parameter list and started writing the query over again to test it and it worked fine. Im now readding the rest of the joins to the query to test them all together but no matter what if I add a second join I get a No getter method for property id of bean scholarship


<query name="edu.asu.SFAO.getApplicableScholarships">
<![CDATA[
from edu.asu.SFAO.DAOs.Scholarship as scholarship
left join scholarship.majors as majors
left join scholarship.campuses as campuses
where majors in (:major)
]]>
</query>
does not work

<query name="edu.asu.SFAO.getApplicableScholarships">
<![CDATA[
from edu.asu.SFAO.DAOs.Scholarship as scholarship
left join scholarship.majors as majors
where majors in (:major)
]]>
</query>
works just fine

and


<query name="edu.asu.SFAO.getApplicableScholarships">
<![CDATA[
from edu.asu.SFAO.DAOs.Scholarship as scholarship
left join scholarship.majors as majors
left join scholarship.campuses as campuses
left join scholarship.classstandings as classstandings
where (scholarship.minimumGpa <= :minimumGpa) and
(scholarship.minimumHours <= :minimumHours) and
majors = :major and
classstandings = :classstanding and
campuses = :campus
]]>
</query>

works just fine




Hibernate version:
3.0.5

Mapping documents:
<?xml version="1.0"?>
<!--
Document : Scholarship.hbm.xml
Created on : March 1, 2005, 1:42 PM
Author : dsobiera
Description:
Purpose of the document follows.
-->


<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>

<class name="edu.asu.SFAO.DAOs.Scholarship" table="scholarship" lazy="true">
<meta attribute="class-description">
A representation of an ASU scholarship
</meta>

<id name="id" column="scholarshipID" unsaved-value="0" >
<meta attribute="scope-set">protected</meta>
<generator class="native"> </generator>
</id>

<property name="name" type="string" not-null="true" column="name"> </property>
<property name="amountType" type="int" not-null="true" column="amount_type"> </property>
<property name="amount" type="int" not-null="true" column="amount"> </property>
<property name="activationDate" type="string" not-null="true" column="activation_date"> </property>
<property name="deadlineDate" type="string" not-null="true" column="deadline_date"> </property>
<property name="openDeadline" type="int" not-null="true" column="open_deadline"> </property>
<property name="applicationUrl" type="string" not-null="true" column="application_url"> </property>
<property name="needBased" type="int" not-null="true" column="need_based"> </property>
<property name="globalList" type="int" not-null="true" column="global_list"> </property>
<property name="minimumGpa" type="int" not-null="true" column="minimum_gpa"> </property>
<property name="minimumHours" type="int" not-null="true" column="minimum_hours"> </property>
<property name="azResident" type="int" not-null="true" column="az_resident"> </property>
<property name="condition" type="string" not-null="true" column="condition"> </property>
<property name="eligibility" type="string" not-null="true" column="eligibility"> </property>
<property name="description" type="string" not-null="true" column="description"> </property>
<property name="comment" type="string" not-null="true" column="comment"> </property>
<property name="contactName" type="string" not-null="true" column="contact_name"> </property>
<property name="contactOrganization" type="string" not-null="true" column="contact_organization"> </property>
<property name="contactPhone" type="string" not-null="true" column="contact_phone"> </property>

<set name="campuses" table="scholarshipXcampus" inverse="false" cascade="all">
<meta attribute="field-description">
A scholarship can have many campuses associated with it
</meta>
<key column="scholarshipID" />
<many-to-many class="edu.asu.SFAO.DAOs.Campus" column="campusID" fetch="join"/>
</set>

<set name="classstandings" table="scholarshipXclassstanding" inverse="false" cascade="all">
<meta attribute="field-description">
A scholarship can have many classstandings associated with it
</meta>
<key column="scholarshipID" />
<many-to-many class="edu.asu.SFAO.DAOs.ClassStanding" column="classstandingID" fetch="join"/>
</set>

<set name="donorPrefs" table="scholarshipXdonorpref" inverse="false" cascade="all">
<meta attribute="field-description">
A scholarship can have many donor preferences associated with it
</meta>
<key column="scholarshipID" />
<many-to-many class="edu.asu.SFAO.DAOs.DonorPref" column="donorprefID" fetch="join"/>
</set>

<set name="majors" table="scholarshipXmajor" inverse="false" cascade="all" lazy="true">
<meta attribute="field-description">
A scholarship can have many majors associated with it
</meta>
<key column="scholarshipID"/>
<element column="majorCode" type="string"/>
</set>

</class>

<query name="edu.asu.SFAO.getApplicableScholarships">
<![CDATA[
from edu.asu.SFAO.DAOs.Scholarship as scholarship
left join scholarship.majors as majors
left join scholarship.campuses as campuses
where majors in (:major)
]]>
</query>

</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():
scholarships = hibScholarshipSearchSession.getNamedQuery("edu.asu.SFAO.getApplicableScholarships")
.setParameterList("major",majors,Hibernate.STRING)
.list();

Full stack trace of any exception that occurs:
javax.servlet.ServletException: No getter method for property id of bean scholarship
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
org.apache.jsp.WEB_002dINF.views.ScholarshipSearchResultsPage_jsp._jspService(org.apache.jsp.WEB_002dINF.views.ScholarshipSearchResultsPage_jsp:86)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:318)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
edu.asu.SFAO.Actions.HibernateActionServlet.doGet(HibernateActionServlet.java:199)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


Name and version of the database you are using:
MS SQL

The generated SQL (show_sql=true):
16:26:18,752 DEBUG SQL:324 - select scholarshi0_.scholarshipID as scholars1_, scholarshi0_.name as n
ame3_, scholarshi0_.amount_type as amount3_3_, scholarshi0_.amount as amount3_, scholarshi0_.activat
ion_date as activation5_3_, scholarshi0_.deadline_date as deadline6_3_, scholarshi0_.open_deadline a
s open7_3_, scholarshi0_.application_url as applicat8_3_, scholarshi0_.need_based as need9_3_, schol
arshi0_.global_list as global10_3_, scholarshi0_.minimum_gpa as minimum11_3_, scholarshi0_.minimum_h
ours as minimum12_3_, scholarshi0_.az_resident as az13_3_, scholarshi0_.condition as condition3_, sc
holarshi0_.eligibility as eligibi15_3_, scholarshi0_.description as descrip16_3_, scholarshi0_.comme
nt as comment3_, scholarshi0_.contact_name as contact18_3_, scholarshi0_.contact_organization as con
tact19_3_, scholarshi0_.contact_phone as contact20_3_ from scholarship scholarshi0_
16:26:18,781 DEBUG SQL:324 - select major0_.rowId as rowId1_, major0_.majorCode as majorCode9_, majo
r0_.majorTitle as majorTitle9_, major0_.concentration as concentr4_9_, major0_.active as active9_ fr
om major major0_ where major0_.majorCode<10000 and major0_.active=1 order by major0_.majorTitle
16:27:50,839 DEBUG SQL:324 - select scholarshi0_.scholarshipID as scholars1_0_, campus3_.campusID as
campusID1_, scholarshi0_.name as name3_0_, scholarshi0_.amount_type as amount3_3_0_, scholarshi0_.a
mount as amount3_0_, scholarshi0_.activation_date as activation5_3_0_, scholarshi0_.deadline_date as
deadline6_3_0_, scholarshi0_.open_deadline as open7_3_0_, scholarshi0_.application_url as applicat8
_3_0_, scholarshi0_.need_based as need9_3_0_, scholarshi0_.global_list as global10_3_0_, scholarshi0
_.minimum_gpa as minimum11_3_0_, scholarshi0_.minimum_hours as minimum12_3_0_, scholarshi0_.az_resid
ent as az13_3_0_, scholarshi0_.condition as condition3_0_, scholarshi0_.eligibility as eligibi15_3_0
_, scholarshi0_.description as descrip16_3_0_, scholarshi0_.comment as comment3_0_, scholarshi0_.con
tact_name as contact18_3_0_, scholarshi0_.contact_organization as contact19_3_0_, scholarshi0_.conta
ct_phone as contact20_3_0_, campus3_.name as name0_1_, campus3_.ordering as ordering0_1_ from schola
rship scholarshi0_ left outer join scholarshipXmajor majors1_ on scholarshi0_.scholarshipID=majors1_
.scholarshipID left outer join scholarshipXcampus campuses2_ on scholarshi0_.scholarshipID=campuses2
_.scholarshipID left outer join campus campus3_ on campuses2_.campusID=campus3_.campusID where major
s1_.majorCode in (? , ?)

Debug level Hibernate log excerpt:
16:27:52,259 ERROR [jsp]:704 - Servlet.service() for servlet jsp threw exception
javax.servlet.jsp.JspException: No getter method for property id of bean scholarship
at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:973)
at org.apache.struts.taglib.TagUtils.computeParameters(TagUtils.java:188)
at org.apache.struts.taglib.html.LinkTag.calculateURL(LinkTag.java:440)
at org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:341)
at org.apache.jsp.WEB_002dINF.views.ScholarshipSearchResultsPage_jsp._jspx_meth_html_link_0(org.apache.jsp.WEB_002dINF.views.ScholarshipSearchResultsPage_jsp:415)
at org.apache.jsp.WEB_002dINF.views.ScholarshipSearchResultsPage_jsp._jspx_meth_c_forEach_0(org.apache.jsp.WEB_002dINF.views.ScholarshipSearchResultsPage_jsp:363)
at org.apache.jsp.WEB_002dINF.views.ScholarshipSearchResultsPage_jsp._jspx_meth_tiles_put_4(org.apache.jsp.WEB_002dINF.views.ScholarshipSearchResultsPage_jsp:275)
at org.apache.jsp.WEB_002dINF.views.ScholarshipSearchResultsPage_jsp._jspx_meth_tiles_insert_0(org.apache.jsp.WEB_002dINF.views.ScholarshipSearchResultsPage_jsp:124)
at org.apache.jsp.WEB_002dINF.views.ScholarshipSearchResultsPage_jsp._jspService(org.apache.jsp.WEB_002dINF.views.ScholarshipSearchResultsPage_jsp:79)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:318)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at edu.asu.SFAO.Actions.HibernateActionServlet.doGet(HibernateActionServlet.java:199)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:307)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:385)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:748)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:678)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:871)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:534)
16:27:52,263 ERROR [action]:253 - Servlet.service() for servlet action threw exception
javax.servlet.jsp.JspException: No getter method for property id of bean scholarship
at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:973)
at org.apache.struts.taglib.TagUtils.computeParameters(TagUtils.java:188)
at org.apache.struts.taglib.html.LinkTag.calculateURL(LinkTag.java:440)
at org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:341)
at org.apache.jsp.WEB_002dINF.views.ScholarshipSearchResultsPage_jsp._jspx_meth_html_link_0(org.apache.jsp.WEB_002dINF.views.ScholarshipSearchResultsPage_jsp:415)
at org.apache.jsp.WEB_002dINF.views.ScholarshipSearchResultsPage_jsp._jspx_meth_c_forEach_0(org.apache.jsp.WEB_002dINF.views.ScholarshipSearchResultsPage_jsp:363)
at org.apache.jsp.WEB_002dINF.views.ScholarshipSearchResultsPage_jsp._jspx_meth_tiles_put_4(org.apache.jsp.WEB_002dINF.views.ScholarshipSearchResultsPage_jsp:275)
at org.apache.jsp.WEB_002dINF.views.ScholarshipSearchResultsPage_jsp._jspx_meth_tiles_insert_0(org.apache.jsp.WEB_002dINF.views.ScholarshipSearchResultsPage_jsp:124)
at org.apache.jsp.WEB_002dINF.views.ScholarshipSearchResultsPage_jsp._jspService(org.apache.jsp.WEB_002dINF.views.ScholarshipSearchResultsPage_jsp:79)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:318)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at edu.asu.SFAO.Actions.HibernateActionServlet.doGet(HibernateActionServlet.java:199)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:307)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:385)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:748)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:678)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:871)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:534)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 07, 2005 2:54 pm 
Beginner
Beginner

Joined: Wed Oct 19, 2005 3:30 pm
Posts: 25
bump


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.