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
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  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]

    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