net.sf.hibernate.QueryException: path expression ends in a composite value: umssendhis1_.sendEntry [select max(history.id.tryCount) from net.cynet.voice.ums.message.UmsSendHistory history where history.sendEntry = :entryId and history.sendEntry.id.umsId = :umsId]

Hibernate JIRA | Jeon,Jiwon | 1 decade ago
  1. 0

    As i know, It is possible to compare object instance in query like below. select max(send.age) from Sender send where send.receiver = ? but I have some exception like below: net.sf.hibernate.QueryException: path expression ends in a composite value: umssendhis1_.sendEntry [select max(history.id.tryCount) from net.cynet.voice.ums.message.UmsSendHistory history where history.sendEntry = :entryId and history.sendEntry.id.umsId = :umsId] at net.sf.hibernate.hql.PathExpressionParser.getWhereColumn(PathExpressionParser.java:375) at net.sf.hibernate.hql.WhereParser.doPathExpression(WhereParser.java:352) at net.sf.hibernate.hql.WhereParser.doToken(WhereParser.java:366) at net.sf.hibernate.hql.WhereParser.token(WhereParser.java:251) at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87) at net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:123) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:149) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:138) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery What I know is incorrectly or hibernate's bug? My configrue is below: <hibernate-mapping> <class name="net.cynet.voice.ums.message.UmsSendEntry" table="UMS_SEND_RESULT" dynamic-update="false" dynamic-insert="false" > <composite-id name="id" class="net.cynet.voice.ums.message.UmsSendEntryKey" unsaved-value="none" > <key-property name="umsId" type="long" column="MSG_ID" /> <key-property name="entryId" type="long" column="SEND_ID" /> </composite-id> <property name="msgStatus" type="int" update="true" insert="true" access="property" column="MSG_STATUS" not-null="false" unique="false" /> </hibernate-mapping> <hibernate-mapping> <class name="net.cynet.voice.ums.message.UmsSendHistory" table="UMS_SEND_HISTORY" dynamic-update="false" dynamic-insert="false" > <composite-id name="id" class="net.cynet.voice.ums.message.UmsSendHistoryKey" > <key-property name="tryCount" type="int" column="TRY_COUNT" /> <key-property name="entryId" type="long" column="SEND_ID" /> <key-property name="umsId" type="long" column="MSG_ID" /> </composite-id> <property name="result" type="int" update="true" insert="true" access="property" column="TRY_RESULT" not-null="false" unique="false" /> </hibernate-mapping>

    Hibernate JIRA | 1 decade ago | Jeon,Jiwon
    net.sf.hibernate.QueryException: path expression ends in a composite value: umssendhis1_.sendEntry [select max(history.id.tryCount) from net.cynet.voice.ums.message.UmsSendHistory history where history.sendEntry = :entryId and history.sendEntry.id.umsId = :umsId]
  2. 0

    As i know, It is possible to compare object instance in query like below. select max(send.age) from Sender send where send.receiver = ? but I have some exception like below: net.sf.hibernate.QueryException: path expression ends in a composite value: umssendhis1_.sendEntry [select max(history.id.tryCount) from net.cynet.voice.ums.message.UmsSendHistory history where history.sendEntry = :entryId and history.sendEntry.id.umsId = :umsId] at net.sf.hibernate.hql.PathExpressionParser.getWhereColumn(PathExpressionParser.java:375) at net.sf.hibernate.hql.WhereParser.doPathExpression(WhereParser.java:352) at net.sf.hibernate.hql.WhereParser.doToken(WhereParser.java:366) at net.sf.hibernate.hql.WhereParser.token(WhereParser.java:251) at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87) at net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:123) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:149) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:138) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery What I know is incorrectly or hibernate's bug? My configrue is below: <hibernate-mapping> <class name="net.cynet.voice.ums.message.UmsSendEntry" table="UMS_SEND_RESULT" dynamic-update="false" dynamic-insert="false" > <composite-id name="id" class="net.cynet.voice.ums.message.UmsSendEntryKey" unsaved-value="none" > <key-property name="umsId" type="long" column="MSG_ID" /> <key-property name="entryId" type="long" column="SEND_ID" /> </composite-id> <property name="msgStatus" type="int" update="true" insert="true" access="property" column="MSG_STATUS" not-null="false" unique="false" /> </hibernate-mapping> <hibernate-mapping> <class name="net.cynet.voice.ums.message.UmsSendHistory" table="UMS_SEND_HISTORY" dynamic-update="false" dynamic-insert="false" > <composite-id name="id" class="net.cynet.voice.ums.message.UmsSendHistoryKey" > <key-property name="tryCount" type="int" column="TRY_COUNT" /> <key-property name="entryId" type="long" column="SEND_ID" /> <key-property name="umsId" type="long" column="MSG_ID" /> </composite-id> <property name="result" type="int" update="true" insert="true" access="property" column="TRY_RESULT" not-null="false" unique="false" /> </hibernate-mapping>

    Hibernate JIRA | 1 decade ago | Jeon,Jiwon
    net.sf.hibernate.QueryException: path expression ends in a composite value: umssendhis1_.sendEntry [select max(history.id.tryCount) from net.cynet.voice.ums.message.UmsSendHistory history where history.sendEntry = :entryId and history.sendEntry.id.umsId = :umsId]
  3. 0

    http://sourceforge.net/forum/message.php?msg_id=2073580 I'm switching to 2.0.1 from 1.2.3. I received the following error trying to do a query on a collection that's within a component. Obviously, this used to work in 1.2.3. I've included part of my mapping below. Any advice on how to get this to work would be appreciated. net.sf.hibernate.QueryException: could not resolve property type: cast.cast.null [SELECT mov.id FROM mov in class com.fetchaflick.videotest.movie.Movie WHERE :findTarget in mov.cast.cast.list.elements AND mov.status >= :status ORDER BY mov.nakedTitle desc] at net.sf.hibernate.hql.PathExpressionParser.getPropertyType(PathExpressionParser.java:223) at net.sf.hibernate.hql.PathExpressionParser.end(PathExpressionParser.java:270) at net.sf.hibernate.hql.WhereParser.preprocess(WhereParser.java:347) at net.sf.hibernate.hql.WhereParser.doPathExpression(WhereParser.java:355) at net.sf.hibernate.hql.WhereParser.doToken(WhereParser.java:389) at net.sf.hibernate.hql.WhereParser.token(WhereParser.java:275) at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:73) at net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:120) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:145) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:132) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:373) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:351) at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1381) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1345) at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:76) at com.fetchaflick.videotest.ojb.FetchaQuery.list(FetchaQuery.java:45) at com.fetchaflick.videotest.movie.BaseMovieFinder.findPageBy(BaseMovieFinder.java:62) at com.fetchaflick.videotest.movie.BaseMovieFinder.findPageByActor(BaseMovieFinder.java:45) at com.fetchaflick.videotest.movie.MovieFinderTest.testFindByActor(MovieFinderTest.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) <class name="com.fetchaflick.videotest.movie.Product" table="PRODUCT"> <jcs-cache usage="read-write"/> <id name="id" column="id" type="long" unsaved-value="0"> <generator class="assigned"/> </id> <discriminator column="TYPE"/> <version column="version" name="version" type="integer"/> <property name="status" column="STATUS" type="com.fetchaflick.videotest.ojb.ProductStatusFieldConversion"/> <many-to-one name="priceLevel" column="PRICE_LEVEL_ID" class="com.fetchaflick.videotest.movie.PriceLevel" cascade="none" outer-join="auto"/> <subclass name="com.fetchaflick.videotest.movie.BaseMovie" discriminator-value="basemovie"> <property name="releaseDate" column="RELEASE_DATE"/> <property name="nakedTitle" column="NAKED_TITLE"/> <many-to-one name="releaseType" column="RELEASE_TYPE_ID" class="com.fetchaflick.videotest.movie.ReleaseType" cascade="none" /> <component name="cast" class="com.fetchaflick.videotest.movie.Cast"> <component name="cast" class="com.fetchaflick.videotest.movie.SafeList"> <list name="list" table="MOVIE_CAST" cascade="all"> <jcs-cache usage="read-write"/> <key column="MOVIE_ID"/> <index column="POS"/> <element type="string" column="NAME"/> </list> </component> </component> <subclass name="com.fetchaflick.videotest.movie.AdultMovie" discriminator-value="adult"> <property name="studio" column="STUDIO"/> </subclass> <subclass name="com.fetchaflick.videotest.movie.Movie" discriminator-value="movie"> <component name="criticReviews" class="com.fetchaflick.videotest.movie.CriticReviewList"> <component name="reviews" class="com.fetchaflick.videotest.movie.SafeList"> <list name="list" table="MOVIE_CRITIC_REVIEWS" cascade="all"> <jcs-cache usage="read-write"/> <key column="MOVIE_ID"/> <index column="POS"/> <composite-element class="com.fetchaflick.videotest.movie.CriticReview"> <property name="author" column="AUTHOR"/> <property name="link" column="LINK"/> <property name="publication" column="PUBLICATION"/> <property name="rating" type="com.fetchaflick.videotest.ojb.CriticReviewRatingFieldConversion"> <column name="RATING"/> <column name="RATING_MAX"/> </property> <property name="synopsis" column="SYNOPSIS"/> </composite-element> </list> </component> </component> </subclass> </subclass> </class>

    Hibernate JIRA | 1 decade ago | Gavin King
    net.sf.hibernate.QueryException: could not resolve property type: cast.cast.null [SELECT mov.id FROM mov in class com.fetchaflick.videotest.movie.Movie WHERE :findTarget in mov.cast.cast.list.elements AND mov.status >= :status ORDER BY mov.nakedTitle desc]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    I'm switching to 2.0.1 from 1.2.3. I received the following error trying to do a query on a collection that's within a component. Obviously, this used to work in 1.2.3. I've included part of my mapping below. Using elements(mov.cast.cast.list) did not help. net.sf.hibernate.QueryException: could not resolve property type: cast.cast.null [SELECT mov.id FROM mov in class Movie WHERE :findTarget in mov.component.list.elements] at net.sf.hibernate.hql.PathExpressionParser.getPropertyType(PathExpressionParser.java:223) at net.sf.hibernate.hql.PathExpressionParser.end(PathExpressionParser.java:270) at net.sf.hibernate.hql.WhereParser.preprocess(WhereParser.java:347) at net.sf.hibernate.hql.WhereParser.doPathExpression(WhereParser.java:355) at net.sf.hibernate.hql.WhereParser.doToken(WhereParser.java:389) at net.sf.hibernate.hql.WhereParser.token(WhereParser.java:275) at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:73) at net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:120) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:145) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:132) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:373) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:351) at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1381) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1345) at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:76) at com.fetchaflick.videotest.ojb.FetchaQuery.list(FetchaQuery.java:45) at com.fetchaflick.videotest.movie.BaseMovieFinder.findPageBy(BaseMovieFinder.java:62) at com.fetchaflick.videotest.movie.BaseMovieFinder.findPageByActor(BaseMovieFinder.java:45) at com.fetchaflick.videotest.movie.MovieFinderTest.testFindByActor(MovieFinderTest.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) <class name="Movie" table="PRODUCT"> <component name="component" class="com.fetchaflick.videotest.movie.Cast"> <list name="list" table="MOVIE_CAST" cascade="all"> <jcs-cache usage="read-write"/> <key column="MOVIE_ID"/> <index column="POS"/> <element type="string" column="NAME"/> </list> </component> </class> Original thread on the forum http://sourceforge.net/forum/forum.php?thread_id=889001&forum_id=128638 I put this in JIRA a while ago, but I guess it lost it (and my account)?

    Hibernate JIRA | 1 decade ago | Rex Madden
    net.sf.hibernate.QueryException: could not resolve property type: cast.cast.null [SELECT mov.id FROM mov in class Movie WHERE :findTarget in mov.component.list.elements]
  6. 0

    hi! i got one exception like that ******************************************** net.sf.hibernate.QueryException: could not resolve property type: userId [SELECT groupHBM FROM com.liferay.portal.ejb.UserHBM userHBM JOIN userHBM.groups AS groupHBM WHERE userHBM.userId = ? AND userHBM.portalId = ? ORDER BY name ASC] at net.sf.hibernate.hql.PathExpressionParser.getPropertyType(PathExpressionParser.java:235) at net.sf.hibernate.hql.PathExpressionParser.end(PathExpressionParser.java:281) at net.sf.hibernate.hql.WhereParser.doPathExpression(WhereParser.java:366) at net.sf.hibernate.hql.WhereParser.doToken(WhereParser.java:393) at net.sf.hibernate.hql.WhereParser.token(WhereParser.java:279) at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87) at net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:120) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:146) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:133) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:352) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:330) at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1368) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1332) at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:76) at com.liferay.portal.ejb.UserUtil.getGroups(UserUtil.java:452) at com.liferay.portal.ejb.UserManagerEJB.getGroups(UserManagerEJB.java:448) at com.liferay.portal.ejb.UserManagerEJB.getAllLayouts(UserManagerEJB.java:402) at com.liferay.portal.ejb.UserManagerEJB_i298xj_EOImpl.getAllLayouts(UserManagerEJB_i298xj_EOIm pl.java:2389) at com.liferay.portal.ejb.UserManagerUtil.getAllLayouts(UserManagerUtil.java:102) at com.liferay.portal.model.User.getAllLayouts(User.java:315) at com.liferay.portal.c.a.InitAction.run(InitAction.java:89) at com.liferay.portal.c.ServiceAction.run(ServiceAction.java:89) at com.liferay.portal.c.MainServlet.service(MainServlet.java:511) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1 053) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27) at com.liferay.filters.compression.CompressionFilter.doFilter(CompressionFilter.java:94) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletCont ext.java:6316) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170) ******************************************************** in the above exception, previous query is like that "SELECT groupHBM FROM com.liferay.portal.ejb.UserHBM userHBM JOIN userHBM.groups AS groupHBM WHERE userHBM.userId = ? ORDER BY name ASC." that is, we don't appended "userhbm.portalId = ?" in the query. Now we appended the portalId constrain in the query. Then we get the exception. Actually it is joining the table user_ and group_. The mapping table is users_groups table. That we defined in the xml mapping file. foreign key (userId, portalId )in users_groups table refer user_ foreign key (groupId )in users_groups table refer group_. These r the fields in the userHbm and groupHbm persistor class. My prediction is Type mapping is mismatched between UserHBM persistor class's "userId" string type with jdbc type conversion. whether there is any solution for solving this problem

    Hibernate JIRA | 1 decade ago | suresh
    net.sf.hibernate.QueryException: could not resolve property type: userId [SELECT groupHBM FROM com.liferay.portal.ejb.UserHBM userHBM JOIN userHBM.groups AS groupHBM WHERE userHBM.userId = ? AND userHBM.portalId = ? ORDER BY name ASC]

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. net.sf.hibernate.QueryException

      path expression ends in a composite value: umssendhis1_.sendEntry [select max(history.id.tryCount) from net.cynet.voice.ums.message.UmsSendHistory history where history.sendEntry = :entryId and history.sendEntry.id.umsId = :umsId]

      at net.sf.hibernate.hql.PathExpressionParser.getWhereColumn()
    2. net.sf.hibernate
      QueryTranslator.compile
      1. net.sf.hibernate.hql.PathExpressionParser.getWhereColumn(PathExpressionParser.java:375)
      2. net.sf.hibernate.hql.WhereParser.doPathExpression(WhereParser.java:352)
      3. net.sf.hibernate.hql.WhereParser.doToken(WhereParser.java:366)
      4. net.sf.hibernate.hql.WhereParser.token(WhereParser.java:251)
      5. net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87)
      6. net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:123)
      7. net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29)
      8. net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:149)
      9. net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:138)
      9 frames