-->
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.  [ 3 posts ] 
Author Message
 Post subject: [org.hibernate.hql.PARSER] - illegal syntax near collection
PostPosted: Tue Oct 10, 2006 12:37 pm 
Beginner
Beginner

Joined: Mon Apr 24, 2006 9:47 pm
Posts: 33
Location: Kansas City, MO
Hibernate version: 3.1.2

Mapping documents:

Resource.hbm.xml
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
    <class name="com.nkics.socialworkprn.swan.domain.Resource" table="RESOURCE">
        <id name="id" type="int">
            <column name="RESOURCE_ID" />
            <generator class="native" />
        </id>
        <one-to-one name="user" cascade="all"/>
        <many-to-one name="coordinator" class="com.nkics.socialworkprn.swan.domain.Coordinator" fetch="select">
            <column name="COORDINATOR_RESOURCE_ID" />
        </many-to-one>
        <many-to-one name="driversLicenseState" class="com.nkics.socialworkprn.swan.domain.State" fetch="select" lazy="false" cascade="persist,save-update,merge">
            <column name="RESOURCE_DRIVERS_LICENSE_STATE_ID" />
        </many-to-one>
        <many-to-one name="office" class="com.nkics.socialworkprn.swan.domain.Office" fetch="select" lazy="false" cascade="persist,save-update,merge">
            <column name="OFFICE_ID" not-null="true" />
        </many-to-one>
        <many-to-one name="resourceSource" class="com.nkics.socialworkprn.swan.domain.ResourceSource" fetch="select" lazy="false" cascade="persist,save-update,merge">
            <column name="RESOURCE_SOURCE_ID" />
        </many-to-one>
        <many-to-one name="state" class="com.nkics.socialworkprn.swan.domain.State" fetch="select" lazy="false" cascade="persist,save-update,merge">
            <column name="STATE_ID" />
        </many-to-one>
        <property name="firstName" type="string">
            <column name="RESOURCE_FIRST_NAME" length="40" not-null="true" />
        </property>
        <property name="middleName" type="string">
            <column name="RESOURCE_MIDDLE_NAME" length="40" />
        </property>
        <property name="lastName" type="string">
            <column name="RESOURCE_LAST_NAME" length="40" not-null="true" />
        </property>
        <property name="nickname" type="string">
            <column name="RESOURCE_NICKNAME" length="40" />
        </property>
        <property name="active" type="boolean">
            <column name="RESOURCE_ACTIVE" not-null="true" />
        </property>
        <property name="addressLine1" type="string">
            <column name="RESOURCE_ADDRESS_LINE1" length="40" />
        </property>
        <property name="addressLine2" type="string">
            <column name="RESOURCE_ADDRESS_LINE2" length="40" />
        </property>
        <property name="city" type="string">
            <column name="RESOURCE_ADDRESS_CITY" length="40" />
        </property>
        <property name="zip5" type="string">
            <column name="RESOURCE_ADDRESS_ZIP5" length="5" />
        </property>
        <property name="zip4" type="string">
            <column name="RESOURCE_ADDRESS_ZIP4" length="4" />
        </property>
        <property name="emergencyContactName" type="string">
            <column name="RESOURCE_EMERGENCY_CONTACT_NAME" length="128" />
        </property>
        <property name="emergencyContactPhone" type="string">
            <column name="RESOURCE_EMERGENCY_CONTACT_PHONE" length="10" />
        </property>
        <property name="email" type="string">
            <column name="RESOURCE_EMAIL" length="128" />
        </property>
        <property name="hoursPerWeek" type="integer">
            <column name="RESOURCE_HOURS_PER_WEEK" />
        </property>
        <property name="ssn" type="string">
            <column name="RESOURCE_SSN" length="9" />
        </property>
        <property name="birthdate" type="timestamp">
            <column name="RESOURCE_BIRTHDATE" length="23" />
        </property>
        <property name="male" type="boolean">
            <column name="RESOURCE_MALE" not-null="false" />
        </property>
        <property name="malpracticeInsuranceCo" type="string">
            <column name="RESOURCE_MALPRACTICE_INSURANCE_CO" length="40" />
        </property>
        <property name="malpracticeInsurancePolicyNo" type="string">
            <column name="RESOURCE_MALPRACTICE_INSURANCE_POLICY_NO" length="40" />
        </property>
        <property name="malpracticeInsuranceExpires" type="timestamp">
            <column name="RESOURCE_MALPRACTICE_INSURANCE_EXPIRES" length="23" />
        </property>
        <property name="expiryCpr" type="timestamp">
            <column name="RESOURCE_EXPIRY_CPR" length="23" />
        </property>
        <property name="expiryTb" type="timestamp">
            <column name="RESOURCE_EXPIRY_TB" length="23" />
        </property>
        <property name="expiryHepb" type="timestamp">
            <column name="RESOURCE_EXPIRY_HEPB" length="23" />
        </property>
        <property name="expiryAutoInsurance" type="timestamp">
            <column name="RESOURCE_EXPIRY_AUTO_INSURANCE" length="23" />
        </property>
        <property name="driversLicenseNo" type="string">
            <column name="RESOURCE_DRIVERS_LICENSE_NO" length="40" />
        </property>
        <property name="referenceRelease" type="boolean">
            <column name="RESOURCE_REFERENCE_RELEASE" />
        </property>
        <property name="hippaTraining" type="boolean">
            <column name="RESOURCE_HIPPA_TRAINING" />
        </property>
        <property name="agreementSigned" type="timestamp">
            <column name="RESOURCE_AGREEMENT_SIGNED" length="23" />
        </property>
        <property name="experienceNote" type="string">
            <column name="RESOURCE_EXPERIENCE_NOTE" length="2000" />
        </property>
        <property name="languageNote" type="string">
            <column name="RESOURCE_LANGUAGE_NOTE" length="2000" />
        </property>
        <property name="generalNote" type="string">
            <column name="RESOURCE_GENERAL_NOTE" length="2000" />
        </property>
        <property name="targetHourlyRate" type="double">
            <column name="RESOURCE_TARGET_HOURLY_RATE" precision="53" scale="0" />
        </property>
        <property name="availableForWork" type="timestamp">
            <column name="RESOURCE_AVAILABLE_FOR_WORK" length="23" />
        </property>
        <property name="availableForTravel" type="boolean">
            <column name="RESOURCE_AVAILABLE_TRAVEL" />
        </property>
        <property name="availableForPermanentPlacement" type="boolean">
            <column name="RESOURCE_AVAILABLE_PERMANENT_PLACEMENT" />
        </property>
        <property name="resumeReceived" type="timestamp">
            <column name="RESOURCE_RESUME_RECEIVED" length="23" />
        </property>
        <property name="backgroundCheck" type="timestamp">
            <column name="RESOURCE_BACKGROUND_CHECK" length="23" />
        </property>
        <property name="drugScreen" type="timestamp">
            <column name="RESOURCE_DRUG_SCREEN" length="23" />
        </property>
        <property name="resourceUpdated" type="timestamp">
            <column name="RESOURCE_UPDATED" length="23" />
        </property>
        <property name="resourceCreated" type="timestamp">
            <column name="RESOURCE_CREATED" length="23" not-null="true" />
        </property>
        <set name="activities" table="RESOURCE_ACTIVITY" lazy="true" cascade="persist,save-update,merge">
           <key column="RESOURCE_ID" />
           <many-to-many class="com.nkics.socialworkprn.swan.domain.Activity" column="ACTIVITY_ID"/>
        </set>
        <set name="dayOfWeeks" table="RESOURCE_DAY_OF_WEEK" lazy="true" cascade="persist,save-update,merge">
           <key column="RESOURCE_ID" />
           <many-to-many class="com.nkics.socialworkprn.swan.domain.DayOfWeek" column="DAY_OF_WEEK_ID"/>
        </set>
        <set name="experiences" table="RESOURCE_EXPERIENCE" lazy="true" cascade="persist,save-update,merge">
           <key column="RESOURCE_ID" />
           <many-to-many class="com.nkics.socialworkprn.swan.domain.Experience" column="EXPERIENCE_ID"/>
        </set>
        <set name="languages" table="RESOURCE_LANGUAGE" lazy="true" cascade="persist,save-update,merge">
           <key column="RESOURCE_ID" />
           <many-to-many class="com.nkics.socialworkprn.swan.domain.Language" column="LANGUAGE_ID"/>
        </set>
        <set name="resourcePhones" inverse="true" cascade="all,delete-orphan">
            <key>
                <column name="RESOURCE_ID" not-null="true" />
            </key>
            <one-to-many class="com.nkics.socialworkprn.swan.domain.ResourcePhone" />
        </set>
        <set name="interviews" inverse="true" cascade="all,delete-orphan">
            <key>
                <column name="RESOURCE_ID" not-null="true" />
            </key>
            <one-to-many class="com.nkics.socialworkprn.swan.domain.Interview" />
        </set>
        <set name="resourceMeetings" inverse="true" cascade="all,delete-orphan">
            <key>
                <column name="RESOURCE_ID" not-null="true" />
            </key>
            <one-to-many class="com.nkics.socialworkprn.swan.domain.ResourceMeeting" />
        </set>
        <set name="workHistories" inverse="true" cascade="all,delete-orphan">
            <key>
                <column name="RESOURCE_ID" not-null="true" />
            </key>
            <one-to-many class="com.nkics.socialworkprn.swan.domain.WorkHistory" />
        </set>
        <set name="educationHistories" inverse="true" cascade="all,delete-orphan">
            <key>
                <column name="RESOURCE_ID" not-null="true" />
            </key>
            <one-to-many class="com.nkics.socialworkprn.swan.domain.EducationHistory" />
        </set>
        <set name="resourceStateCredentials" inverse="true" cascade="all,delete-orphan">
            <key>
                <column name="RESOURCE_ID" not-null="true" />
            </key>
            <one-to-many class="com.nkics.socialworkprn.swan.domain.ResourceStateCredential" />
        </set>
        <set name="references" inverse="true" cascade="all,delete-orphan">
            <key>
                <column name="RESOURCE_ID" not-null="true" />
            </key>
            <one-to-many class="com.nkics.socialworkprn.swan.domain.Reference" />
        </set>
        <joined-subclass name="com.nkics.socialworkprn.swan.domain.Staff" table="STAFF">
         <key column="RESOURCE_ID" />
           <property name="left" type="timestamp">
               <column name="STAFF_LEFT" length="23" />
           </property>
           <set name="requisitionStaffTargets" inverse="true">
               <key>
                   <column name="STAFF_RESOURCE_ID" not-null="true" />
               </key>
               <one-to-many class="com.nkics.socialworkprn.swan.domain.RequisitionStaffTarget" />
           </set>
           <set name="supervisories" inverse="true">
               <key>
                   <column name="STAFF_RESOURCE_ID" not-null="true" />
               </key>
               <one-to-many class="com.nkics.socialworkprn.swan.domain.Supervisory" />
           </set>
           <joined-subclass name="com.nkics.socialworkprn.swan.domain.Coordinator" table="COORDINATOR">
            <key column="RESOURCE_ID" />
              <set name="coordinatorMeetings" inverse="true">
                  <key>
                      <column name="COORDINATOR_RESOURCE_ID" not-null="true" />
                  </key>
                  <one-to-many class="com.nkics.socialworkprn.swan.domain.Meeting" />
              </set>
              <set name="coordinatorInterviews" inverse="true">
                  <key>
                      <column name="COORDINATOR_RESOURCE_ID" not-null="true" />
                  </key>
                  <one-to-many class="com.nkics.socialworkprn.swan.domain.Interview" />
              </set>
              <set name="officeActivities" inverse="true">
                  <key>
                      <column name="COORDINATOR_RESOURCE_ID" not-null="true" />
                  </key>
                  <one-to-many class="com.nkics.socialworkprn.swan.domain.OfficeActivity" />
              </set>
            <set name="requisitions" inverse="true">
                  <key>
                      <column name="COORDINATOR_RESOURCE_ID" not-null="true" />
                  </key>
                  <one-to-many class="com.nkics.socialworkprn.swan.domain.Requisition" />
              </set>
              <set name="resources" inverse="true">
                  <key>
                      <column name="COORDINATOR_RESOURCE_ID" />
                  </key>
                  <one-to-many class="com.nkics.socialworkprn.swan.domain.Resource" />
              </set>
              <set name="coordinatorSupervisories" inverse="true">
                  <key>
                      <column name="COORDINATOR_RESOURCE_ID" />
                  </key>
                  <one-to-many class="com.nkics.socialworkprn.swan.domain.Supervisory" />
              </set>
         </joined-subclass>
        </joined-subclass>
    </class>
</hibernate-mapping>

WorkHistory.hbm.xml
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
    <class name="com.nkics.socialworkprn.swan.domain.WorkHistory" table="WORK_HISTORY">
        <id name="id" type="int">
            <column name="WORK_HISTORY_ID" />
            <generator class="native" />
        </id>
        <many-to-one name="leadType" class="com.nkics.socialworkprn.swan.domain.LeadType" fetch="select">
            <column name="LEAD_TYPE_ID" not-null="true" />
        </many-to-one>
        <many-to-one name="resource" class="com.nkics.socialworkprn.swan.domain.Resource" fetch="select">
            <column name="RESOURCE_ID" not-null="true" />
        </many-to-one>
        <property name="startDate" type="timestamp">
            <column name="WORK_HISTORY_START" length="23" not-null="true" />
        </property>
        <property name="endDate" type="timestamp">
            <column name="WORK_HISTORY_END" length="23" />
        </property>
        <property name="company" type="string">
            <column name="WORK_HISTORY_COMPANY" length="128" not-null="true" />
        </property>
        <property name="title" type="string">
            <column name="WORK_HISTORY_TITLE" length="40" not-null="true" />
        </property>
        <property name="description" type="string">
            <column name="WORK_HISTORY_DESCRIPTION" length="2000" not-null="true" />
        </property>
    </class>
</hibernate-mapping>

LeadType.hbm.xml
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
    <class name="com.nkics.socialworkprn.swan.domain.LeadType" table="LEAD_TYPE">
        <id name="id" type="int">
            <column name="LEAD_TYPE_ID" />
            <generator class="native" />
        </id>
        <property name="name" type="string">
            <column name="LEAD_TYPE_NAME" length="40" not-null="true" unique="true" />
        </property>
        <property name="description" type="string">
            <column name="LEAD_TYPE_DESCRIPTION" length="100" not-null="true" />
        </property>
    </class>
</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():
Code:
String hqlString = "from com.nkics.socialworkprn.swan.domain.Resource as resource where ( resource.workHistories.leadType.id = 1 AND resource.class = Resource )";

Query resourceQuery = session.createQuery(hqlString);  // ***Exception is thrown here. ***

Full stack trace of any exception that occurs:
Code:
2006-10-10 11:02:40,813 ERROR [org.hibernate.hql.PARSER] -  illegal syntax near collection: leadType
2006-10-10 11:02:40,813 ERROR [com.nkics.socialworkprn.swan.persistence.hibernate.HibernateResourceDao] - search failed
java.lang.NullPointerException
   at org.hibernate.hql.ast.tree.DotNode.getColumns(DotNode.java:97)
   at org.hibernate.hql.ast.tree.DotNode.initText(DotNode.java:210)
   at org.hibernate.hql.ast.tree.DotNode.resolve(DotNode.java:204)
   at org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:94)
   at org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:90)
   at org.hibernate.hql.ast.HqlSqlWalker.resolve(HqlSqlWalker.java:660)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.expr(HqlSqlBaseWalker.java:1215)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.exprOrSubquery(HqlSqlBaseWalker.java:4032)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:3518)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1758)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1683)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.whereClause(HqlSqlBaseWalker.java:776)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:577)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
   at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:218)
   at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:158)
   at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:109)
   at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:75)
   at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:54)
   at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
   at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:134)
   at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:113)
   at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1602)
   at com.nkics.socialworkprn.swan.persistence.hibernate.HibernateResourceDao.search(HibernateResourceDao.java:267)
   at com.nkics.socialworkprn.swan.service.defaults.DefaultSearchService.candidateSearch(DefaultSearchService.java:104)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
   at $Proxy13.candidateSearch(Unknown Source)
   at com.nkics.socialworkprn.swan.mvc.search.provider.CandidateSearchProvider.loadList(CandidateSearchProvider.java:94)
   at org.springframework.beans.support.RefreshablePagedListHolder.refresh(RefreshablePagedListHolder.java:163)
   at com.nkics.socialworkprn.swan.mvc.search.SearchController.updateCandidateSearchResults(SearchController.java:201)
   at com.nkics.socialworkprn.swan.mvc.search.SearchController.onFormChange(SearchController.java:181)
   at org.springframework.web.servlet.mvc.SimpleFormController.onFormChange(SimpleFormController.java:308)
   at org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:253)
   at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:249)
   at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
   at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:723)
   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:663)
   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:394)
   at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:358)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   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.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:292)
   at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
   at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:79)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
   at org.acegisecurity.ui.switchuser.SwitchUserProcessingFilter.doFilter(SwitchUserProcessingFilter.java:382)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
   at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:143)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
   at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:138)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
   at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:174)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
   at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:207)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
   at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:246)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
   at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:220)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
   at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:173)
   at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:120)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
   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.coyote.http11.Http11Processor.process(Http11Processor.java:869)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
   at java.lang.Thread.run(Thread.java:595)

Name and version of the database you are using: SQL Server Desktop Engine v8.00.760 (SP3)

The generated SQL (show_sql=true): None

Debug level Hibernate log excerpt:
Code:
2006-10-10 11:31:24,732 DEBUG [com.nkics.socialworkprn.swan.mvc.search.SearchController] - Removing form session attribute [com.nkics.socialworkprn.swan.mvc.search.SearchController.FORM.searchForm]
2006-10-10 11:31:24,810 DEBUG [com.nkics.socialworkprn.swan.mvc.search.SearchController] - Detected form change request -> routing request to onFormChange
2006-10-10 11:31:24,841 DEBUG [org.hibernate.impl.SessionImpl] - opened session at timestamp: 4753399336308736
2006-10-10 11:31:24,841 DEBUG [org.hibernate.transaction.JDBCTransaction] - begin
2006-10-10 11:31:24,841 DEBUG [org.hibernate.jdbc.ConnectionManager] - opening JDBC connection
2006-10-10 11:31:24,841 DEBUG [org.hibernate.transaction.JDBCTransaction] - current autocommit status: true
2006-10-10 11:31:24,841 DEBUG [org.hibernate.transaction.JDBCTransaction] - disabling autocommit
2006-10-10 11:31:24,841 DEBUG [org.hibernate.jdbc.JDBCContext] - after transaction begin
2006-10-10 11:31:24,841 DEBUG [com.nkics.socialworkprn.swan.service.defaults.DefaultSearchService] - START candidateSearch
2006-10-10 11:31:24,857 DEBUG [com.nkics.socialworkprn.swan.persistence.hibernate.HibernateResourceDao] - START search
2006-10-10 11:31:24,857 DEBUG [com.nkics.socialworkprn.swan.persistence.hibernate.HibernateSearchUtil] - START getHQLString
2006-10-10 11:31:24,857 DEBUG [com.nkics.socialworkprn.swan.persistence.hibernate.HibernateSearchUtil] - RETURN getHQLString: from com.nkics.socialworkprn.swan.domain.Resource as resource where ( resource.workHistories.leadType.id = 1 AND resource.class = Resource )
2006-10-10 11:31:24,857 DEBUG [com.nkics.socialworkprn.swan.persistence.hibernate.HibernateSearchUtil] - END getHQLString
2006-10-10 11:31:24,873 DEBUG [org.hibernate.engine.query.QueryPlanCache] - unable to locate HQL query plan in cache; generating (from com.nkics.socialworkprn.swan.domain.Resource as resource where ( resource.workHistories.leadType.id = 1 AND resource.class = Resource ) )
2006-10-10 11:31:25,013 DEBUG [org.hibernate.hql.ast.QueryTranslatorImpl] - parse() - HQL: from com.nkics.socialworkprn.swan.domain.Resource as resource where ( resource.workHistories.leadType.id = 1 AND resource.class = Resource )
2006-10-10 11:31:25,029 DEBUG [org.hibernate.hql.ast.HqlParser] - handleDotIdent() : new LT(2) token - [".",<15> previously: <15>,line=1,col=122,possibleID=false]
2006-10-10 11:31:25,044 DEBUG [org.hibernate.hql.ast.AST] - --- HQL AST ---
\-[QUERY] 'query'
    +-[SELECT_FROM] 'SELECT_FROM'
    |  \-[FROM] 'from'
    |     \-[RANGE] 'RANGE'
    |        +-[DOT] '.'
    |        |  +-[DOT] '.'
    |        |  |  +-[DOT] '.'
    |        |  |  |  +-[DOT] '.'
    |        |  |  |  |  +-[DOT] '.'
    |        |  |  |  |  |  +-[IDENT] 'com'
    |        |  |  |  |  |  \-[IDENT] 'nkics'
    |        |  |  |  |  \-[IDENT] 'socialworkprn'
    |        |  |  |  \-[IDENT] 'swan'
    |        |  |  \-[IDENT] 'domain'
    |        |  \-[IDENT] 'Resource'
    |        \-[ALIAS] 'resource'
    \-[WHERE] 'where'
       \-[AND] 'AND'
          +-[EQ] '='
          |  +-[DOT] '.'
          |  |  +-[DOT] '.'
          |  |  |  +-[DOT] '.'
          |  |  |  |  +-[IDENT] 'resource'
          |  |  |  |  \-[IDENT] 'workHistories'
          |  |  |  \-[IDENT] 'leadType'
          |  |  \-[IDENT] 'id'
          |  \-[NUM_INT] '1'
          \-[EQ] '='
             +-[DOT] '.'
             |  +-[IDENT] 'resource'
             |  \-[IDENT] 'class'
             \-[IDENT] 'Resource'

2006-10-10 11:31:25,044 DEBUG [org.hibernate.hql.ast.ErrorCounter] - throwQueryException() : no errors
2006-10-10 11:31:25,138 DEBUG [org.hibernate.hql.antlr.HqlSqlBaseWalker] - select << begin [level=1, statement=select]
2006-10-10 11:31:25,419 DEBUG [org.hibernate.hql.ast.tree.FromElement] - FromClause{level=1} :  com.nkics.socialworkprn.swan.domain.Resource (resource) -> resource0_
2006-10-10 11:31:25,419 DEBUG [org.hibernate.hql.ast.tree.FromReferenceNode] - Resolved :  resource -> resource0_.RESOURCE_ID
2006-10-10 11:31:25,419 DEBUG [org.hibernate.hql.ast.tree.DotNode] - getDataType() : workHistories -> org.hibernate.type.SetType(com.nkics.socialworkprn.swan.domain.Resource.workHistories)
2006-10-10 11:31:25,435 DEBUG [org.hibernate.hql.ast.tree.FromElementFactory] - createEntityAssociation() : One to many - path = resource.workHistories role = com.nkics.socialworkprn.swan.domain.Resource.workHistories associatedEntityName = com.nkics.socialworkprn.swan.domain.WorkHistory
2006-10-10 11:31:25,435 DEBUG [org.hibernate.hql.ast.tree.FromElement] - FromClause{level=1} :  com.nkics.socialworkprn.swan.domain.WorkHistory (no alias) -> workhistor1_
2006-10-10 11:31:25,435 DEBUG [org.hibernate.hql.ast.tree.FromClause] - addJoinByPathMap() : resource.workHistories -> WORK_HISTORY workhistor1_
2006-10-10 11:31:25,435 DEBUG [org.hibernate.hql.ast.tree.DotNode] - dereferenceCollection() : Created new FROM element for resource.workHistories : WORK_HISTORY workhistor1_
2006-10-10 11:31:25,435 DEBUG [org.hibernate.hql.ast.tree.FromReferenceNode] - Resolved :  resource.workHistories -> .
2006-10-10 11:31:25,435 DEBUG [org.hibernate.hql.ast.tree.DotNode] - getDataType() : leadType -> org.hibernate.type.ManyToOneType(com.nkics.socialworkprn.swan.domain.LeadType)
2006-10-10 11:31:25,451 ERROR [org.hibernate.hql.PARSER] -  illegal syntax near collection: leadType
2006-10-10 11:31:25,451 DEBUG [org.hibernate.hql.ast.ErrorCounter] -  illegal syntax near collection: leadType
illegal syntax near collection: leadType
   at org.hibernate.hql.ast.tree.DotNode.checkLhsIsNotCollection(DotNode.java:485)
   at org.hibernate.hql.ast.tree.DotNode.resolve(DotNode.java:193)
   at org.hibernate.hql.ast.tree.DotNode.resolveFirstChild(DotNode.java:139)
   at org.hibernate.hql.ast.HqlSqlWalker.lookupProperty(HqlSqlWalker.java:397)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.addrExpr(HqlSqlBaseWalker.java:4316)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.expr(HqlSqlBaseWalker.java:1211)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.exprOrSubquery(HqlSqlBaseWalker.java:4032)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:3518)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1758)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1683)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.whereClause(HqlSqlBaseWalker.java:776)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:577)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
   at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:218)
   at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:158)
   at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:109)
   at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:75)
   at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:54)
   at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
   at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:134)
   at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:113)
   at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1602)
   at com.nkics.socialworkprn.swan.persistence.hibernate.HibernateResourceDao.search(HibernateResourceDao.java:267)
   at com.nkics.socialworkprn.swan.service.defaults.DefaultSearchService.candidateSearch(DefaultSearchService.java:104)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
   at $Proxy13.candidateSearch(Unknown Source)
   at com.nkics.socialworkprn.swan.mvc.search.provider.CandidateSearchProvider.loadList(CandidateSearchProvider.java:94)
   at org.springframework.beans.support.RefreshablePagedListHolder.refresh(RefreshablePagedListHolder.java:163)
   at com.nkics.socialworkprn.swan.mvc.search.SearchController.updateCandidateSearchResults(SearchController.java:201)
   at com.nkics.socialworkprn.swan.mvc.search.SearchController.onFormChange(SearchController.java:181)
   at org.springframework.web.servlet.mvc.SimpleFormController.onFormChange(SimpleFormController.java:308)
   at org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:253)
   at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:249)
   at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
   at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:723)
   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:663)
   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:394)
   at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:358)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   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.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:292)
   at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
   at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:79)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
   at org.acegisecurity.ui.switchuser.SwitchUserProcessingFilter.doFilter(SwitchUserProcessingFilter.java:382)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
   at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:143)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
   at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:138)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
   at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:174)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
   at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:207)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
   at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:246)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
   at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:220)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
   at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:173)
   at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:120)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
   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.coyote.http11.Http11Processor.process(Http11Processor.java:869)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
   at java.lang.Thread.run(Thread.java:595)
2006-10-10 11:31:25,466 DEBUG [org.hibernate.hql.ast.tree.DotNode] - getDataType() : id -> org.hibernate.type.IntegerType@1198967
2006-10-10 11:31:25,466 ERROR [com.nkics.socialworkprn.swan.persistence.hibernate.HibernateResourceDao] - search failed
java.lang.NullPointerException
   at org.hibernate.hql.ast.tree.DotNode.getColumns(DotNode.java:97)
   at org.hibernate.hql.ast.tree.DotNode.initText(DotNode.java:210)
   at org.hibernate.hql.ast.tree.DotNode.resolve(DotNode.java:204)
   at org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:94)
   at org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:90)
   at org.hibernate.hql.ast.HqlSqlWalker.resolve(HqlSqlWalker.java:660)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.expr(HqlSqlBaseWalker.java:1215)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.exprOrSubquery(HqlSqlBaseWalker.java:4032)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:3518)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1758)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1683)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.whereClause(HqlSqlBaseWalker.java:776)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:577)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
   at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:218)
   at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:158)
   at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:109)
   at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:75)
   at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:54)
   at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
   at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:134)
   at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:113)
   at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1602)
   at com.nkics.socialworkprn.swan.persistence.hibernate.HibernateResourceDao.search(HibernateResourceDao.java:267)
   at com.nkics.socialworkprn.swan.service.defaults.DefaultSearchService.candidateSearch(DefaultSearchService.java:104)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
   at $Proxy13.candidateSearch(Unknown Source)
   at com.nkics.socialworkprn.swan.mvc.search.provider.CandidateSearchProvider.loadList(CandidateSearchProvider.java:94)
   at org.springframework.beans.support.RefreshablePagedListHolder.refresh(RefreshablePagedListHolder.java:163)
   at com.nkics.socialworkprn.swan.mvc.search.SearchController.updateCandidateSearchResults(SearchController.java:201)
   at com.nkics.socialworkprn.swan.mvc.search.SearchController.onFormChange(SearchController.java:181)
   at org.springframework.web.servlet.mvc.SimpleFormController.onFormChange(SimpleFormController.java:308)
   at org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:253)
   at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:249)
   at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
   at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:723)
   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:663)
   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:394)
   at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:358)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
   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.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:292)
   at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
   at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:79)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
   at org.acegisecurity.ui.switchuser.SwitchUserProcessingFilter.doFilter(SwitchUserProcessingFilter.java:382)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
   at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:143)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
   at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:138)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
   at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:174)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
   at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:207)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
   at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:246)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
   at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:220)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
   at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:173)
   at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:120)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
   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.coyote.http11.Http11Processor.process(Http11Processor.java:869)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
   at java.lang.Thread.run(Thread.java:595)
2006-10-10 11:31:25,466 DEBUG [com.nkics.socialworkprn.swan.persistence.hibernate.HibernateResourceDao] - END search
2006-10-10 11:31:25,466 DEBUG [org.hibernate.transaction.JDBCTransaction] - rollback
2006-10-10 11:31:25,466 DEBUG [org.hibernate.transaction.JDBCTransaction] - re-enabling autocommit
2006-10-10 11:31:25,466 DEBUG [org.hibernate.transaction.JDBCTransaction] - rolled back JDBC Connection
2006-10-10 11:31:25,466 DEBUG [org.hibernate.jdbc.JDBCContext] - after transaction completion
2006-10-10 11:31:25,466 DEBUG [org.hibernate.jdbc.ConnectionManager] - transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources!
2006-10-10 11:31:25,466 DEBUG [org.hibernate.impl.SessionImpl] - after transaction completion
2006-10-10 11:31:25,466 DEBUG [org.hibernate.impl.SessionImpl] - closing session
2006-10-10 11:31:25,466 DEBUG [org.hibernate.jdbc.ConnectionManager] - performing cleanup
2006-10-10 11:31:25,466 DEBUG [org.hibernate.jdbc.ConnectionManager] - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
2006-10-10 11:31:25,466 DEBUG [org.hibernate.jdbc.JDBCContext] - after transaction completion
2006-10-10 11:31:25,466 DEBUG [org.hibernate.jdbc.ConnectionManager] - transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources!
2006-10-10 11:31:25,466 DEBUG [org.hibernate.impl.SessionImpl] - after transaction completion


Top
 Profile  
 
 Post subject: Implicit Joins are not supported on Collection Properties
PostPosted: Tue Oct 10, 2006 4:35 pm 
Beginner
Beginner

Joined: Mon Apr 24, 2006 9:47 pm
Posts: 33
Location: Kansas City, MO
I read that "Implicit joins are always directed along many-to-one or one-to-one associations, never through a collection-valued association (you can't write item.bids.amount)." (Hibernate 266)

So, because "workHistories" is a collection property, I cannot restrict my query by "resource.workHistories.leadType.id = 1".

But to add confusition, why does the following statement work, "resource.activities.id = 1"?

Why does one work and not the other?

Citations
Christian Bauer and Gavin King. "Retrieving objects efficiently" Hibernate in Action. Manning Publications Co., 2005.


Top
 Profile  
 
 Post subject: Solution
PostPosted: Tue Oct 10, 2006 5:52 pm 
Beginner
Beginner

Joined: Mon Apr 24, 2006 9:47 pm
Posts: 33
Location: Kansas City, MO
In the previous post I asked why 'resource.activities.id = 1' works and 'resource.workHistories.leadType.id' doesn't. I believe that even though the book 'Hibernate in Action' doesn't say it, Hibernate supports implicit joins for many-to-many relationships in addition to the many-to-one and one-to-one relationships documented in the book. Correct me if I'm wrong.

Therefore...

The original HQL was:
Code:
from com.nkics.socialworkprn.swan.domain.Resource as resource where ( resource.workHistories.leadType.id = 1 AND resource.class = Resource )


I got an exception from Hibernate because 'resource.workHistories' is a one-to-many collection.

To solve this problem I had to restructure the HQL as follows:
Code:
from Resource as resource join fetch resource.workHistories as workHistory where ( workHistory.leadType.id = 1 AND resource.class = Resource )

Notice that I added 'join fetch resource.workHistories as workHistory' to the FROM clause, and I selected on the 'workHistory' alias instead of the unsupported one-to-many property 'resource.workHistories'. The 'fetch' tells hibernate to return Resource objects instead of Object arrays (containing the Resource and the WorkHistory matched).

Note: The "AND resource.class = Resource" is only there because it was in the original problematic HQL listed earlier in this thread.

It seems to me like it would be easy for the developers of Hibernate to add support for implicit joins on one-to-many properties. Maybe they could fill in on why this support is not there.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.