org.hibernate.QueryException: Unable to render boolean literal value [SELECT e FROM SampleEntity e WHERE e.booleanValue = true]

Hibernate JIRA | Piotr Ostrowski | 3 years ago
  1. 0

    Same as this https://hibernate.atlassian.net/browse/HHH-8866 but with boolean attribute and string-to-boolean converter. Example of exception: org.hibernate.QueryException: Unable to render boolean literal value [SELECT e FROM SampleEntity e WHERE e.booleanValue = true] at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1750) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1677) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1683) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:350) at pl.avd.sample.jpa.converters.CarService.findDieselsWithNamedQuery(CarService.java:94) at pl.avd.sample.jpa.multiselect.CarServiceTest.findDieselsWithNamedQueryTest(CarServiceTest.java:48) Caused by: org.hibernate.QueryException: Unable to render boolean literal value [SELECT e FROM SampleEntity e WHERE e.booleanValue = true] at org.hibernate.QueryException.generateQueryException(QueryException.java:137) at org.hibernate.QueryException.wrapWithQueryString(QueryException.java:120) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:234) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:158) at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:126) at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:88) at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:190) at org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:301) at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:236) at org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:1800) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:342) ... 36 more Caused by: org.hibernate.QueryException: Unable to render boolean literal value at org.hibernate.hql.internal.ast.tree.BooleanLiteralNode.getRenderText(BooleanLiteralNode.java:65) at org.hibernate.hql.internal.ast.SqlGenerator.out(SqlGenerator.java:128) at org.hibernate.hql.internal.antlr.SqlGeneratorBase.simpleExpr(SqlGeneratorBase.java:2942) at org.hibernate.hql.internal.antlr.SqlGeneratorBase.expr(SqlGeneratorBase.java:1585) at org.hibernate.hql.internal.antlr.SqlGeneratorBase.binaryComparisonExpression(SqlGeneratorBase.java:3236) at org.hibernate.hql.internal.antlr.SqlGeneratorBase.comparisonExpr(SqlGeneratorBase.java:1395) at org.hibernate.hql.internal.antlr.SqlGeneratorBase.booleanExpr(SqlGeneratorBase.java:921) at org.hibernate.hql.internal.antlr.SqlGeneratorBase.whereExpr(SqlGeneratorBase.java:768) at org.hibernate.hql.internal.antlr.SqlGeneratorBase.selectStatement(SqlGeneratorBase.java:202) at org.hibernate.hql.internal.antlr.SqlGeneratorBase.statement(SqlGeneratorBase.java:135) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.generate(QueryTranslatorImpl.java:260) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:226) ... 44 more Caused by: java.lang.ClassCastException: org.hibernate.type.descriptor.converter.AttributeConverterTypeAdapter cannot be cast to org.hibernate.type.LiteralType at org.hibernate.hql.internal.ast.tree.BooleanLiteralNode.typeAsLiteralType(BooleanLiteralNode.java:70) at org.hibernate.hql.internal.ast.tree.BooleanLiteralNode.getRenderText(BooleanLiteralNode.java:62) ... 55 more

    Hibernate JIRA | 3 years ago | Piotr Ostrowski
    org.hibernate.QueryException: Unable to render boolean literal value [SELECT e FROM SampleEntity e WHERE e.booleanValue = true]
  2. 0

    Same as this https://hibernate.atlassian.net/browse/HHH-8866 but with boolean attribute and string-to-boolean converter. Example of exception: org.hibernate.QueryException: Unable to render boolean literal value [SELECT e FROM SampleEntity e WHERE e.booleanValue = true] at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1750) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1677) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1683) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:350) at pl.avd.sample.jpa.converters.CarService.findDieselsWithNamedQuery(CarService.java:94) at pl.avd.sample.jpa.multiselect.CarServiceTest.findDieselsWithNamedQueryTest(CarServiceTest.java:48) Caused by: org.hibernate.QueryException: Unable to render boolean literal value [SELECT e FROM SampleEntity e WHERE e.booleanValue = true] at org.hibernate.QueryException.generateQueryException(QueryException.java:137) at org.hibernate.QueryException.wrapWithQueryString(QueryException.java:120) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:234) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:158) at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:126) at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:88) at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:190) at org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:301) at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:236) at org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:1800) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:342) ... 36 more Caused by: org.hibernate.QueryException: Unable to render boolean literal value at org.hibernate.hql.internal.ast.tree.BooleanLiteralNode.getRenderText(BooleanLiteralNode.java:65) at org.hibernate.hql.internal.ast.SqlGenerator.out(SqlGenerator.java:128) at org.hibernate.hql.internal.antlr.SqlGeneratorBase.simpleExpr(SqlGeneratorBase.java:2942) at org.hibernate.hql.internal.antlr.SqlGeneratorBase.expr(SqlGeneratorBase.java:1585) at org.hibernate.hql.internal.antlr.SqlGeneratorBase.binaryComparisonExpression(SqlGeneratorBase.java:3236) at org.hibernate.hql.internal.antlr.SqlGeneratorBase.comparisonExpr(SqlGeneratorBase.java:1395) at org.hibernate.hql.internal.antlr.SqlGeneratorBase.booleanExpr(SqlGeneratorBase.java:921) at org.hibernate.hql.internal.antlr.SqlGeneratorBase.whereExpr(SqlGeneratorBase.java:768) at org.hibernate.hql.internal.antlr.SqlGeneratorBase.selectStatement(SqlGeneratorBase.java:202) at org.hibernate.hql.internal.antlr.SqlGeneratorBase.statement(SqlGeneratorBase.java:135) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.generate(QueryTranslatorImpl.java:260) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:226) ... 44 more Caused by: java.lang.ClassCastException: org.hibernate.type.descriptor.converter.AttributeConverterTypeAdapter cannot be cast to org.hibernate.type.LiteralType at org.hibernate.hql.internal.ast.tree.BooleanLiteralNode.typeAsLiteralType(BooleanLiteralNode.java:70) at org.hibernate.hql.internal.ast.tree.BooleanLiteralNode.getRenderText(BooleanLiteralNode.java:62) ... 55 more

    Hibernate JIRA | 3 years ago | Piotr Ostrowski
    org.hibernate.QueryException: Unable to render boolean literal value [SELECT e FROM SampleEntity e WHERE e.booleanValue = true]
  3. 0

    how to use hibernate hql to select datas in two tables?

    Stack Overflow | 3 years ago | user1502241
    org.hibernate.QueryException: could not resolve property: d_id of: com.xunfang.em_mallServer.bean.DetailType [select new DetailVoMain(d.d_id,d.d_name,m.m_name)from com.xunfang.em_mallServer.bean.MainType m, com.xunfang.em_mallServer.bean.DetailType d where d.d_main_id = m.m_id]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Failed to load ApplicationContext: Spring and junit

    Stack Overflow | 2 years ago
    java.lang.IllegalStateException
  6. 0

    error with api/rescan/boxset/artwork/24

    GitHub | 1 year ago | jluc2808
    org.hibernate.QueryException: expecting ''', found '<EOF>' [select distinct f from org.yamj.core.database.model.StageFile f where lower(f.baseName) like 'set_l'age de glace_%' and lower(f.baseName) not like '%fanart' and lower(f.baseName) not like '%banner' and f.status != :deleted and f.fileType = :fileType ]

  1. MoYapro 4 times, last 1 week ago
  2. marcbouvierdav 6 times, last 2 months ago
5 unregistered visitors
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. java.lang.ClassCastException

    org.hibernate.type.descriptor.converter.AttributeConverterTypeAdapter cannot be cast to org.hibernate.type.LiteralType

    at org.hibernate.hql.internal.ast.tree.BooleanLiteralNode.typeAsLiteralType()
  2. Hibernate
    SessionImpl.createQuery
    1. org.hibernate.hql.internal.ast.tree.BooleanLiteralNode.typeAsLiteralType(BooleanLiteralNode.java:70)
    2. org.hibernate.hql.internal.ast.tree.BooleanLiteralNode.getRenderText(BooleanLiteralNode.java:62)
    3. org.hibernate.hql.internal.ast.tree.BooleanLiteralNode.getRenderText(BooleanLiteralNode.java:65)
    4. org.hibernate.hql.internal.ast.SqlGenerator.out(SqlGenerator.java:128)
    5. org.hibernate.hql.internal.antlr.SqlGeneratorBase.simpleExpr(SqlGeneratorBase.java:2942)
    6. org.hibernate.hql.internal.antlr.SqlGeneratorBase.expr(SqlGeneratorBase.java:1585)
    7. org.hibernate.hql.internal.antlr.SqlGeneratorBase.binaryComparisonExpression(SqlGeneratorBase.java:3236)
    8. org.hibernate.hql.internal.antlr.SqlGeneratorBase.comparisonExpr(SqlGeneratorBase.java:1395)
    9. org.hibernate.hql.internal.antlr.SqlGeneratorBase.booleanExpr(SqlGeneratorBase.java:921)
    10. org.hibernate.hql.internal.antlr.SqlGeneratorBase.whereExpr(SqlGeneratorBase.java:768)
    11. org.hibernate.hql.internal.antlr.SqlGeneratorBase.selectStatement(SqlGeneratorBase.java:202)
    12. org.hibernate.hql.internal.antlr.SqlGeneratorBase.statement(SqlGeneratorBase.java:135)
    13. org.hibernate.hql.internal.ast.QueryTranslatorImpl.generate(QueryTranslatorImpl.java:260)
    14. org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:226)
    15. org.hibernate.QueryException.generateQueryException(QueryException.java:137)
    16. org.hibernate.QueryException.wrapWithQueryString(QueryException.java:120)
    17. org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:234)
    18. org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:158)
    19. org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:126)
    20. org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:88)
    21. org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:190)
    22. org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:301)
    23. org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:236)
    24. org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:1800)
    24 frames
  3. org.hibernate.jpa
    AbstractEntityManagerImpl.createQuery
    1. org.hibernate.jpa.spi.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:342)
    2. org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1750)
    3. org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1677)
    4. org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1683)
    5. org.hibernate.jpa.spi.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:350)
    5 frames
  4. pl.avd.sample
    CarServiceTest.findDieselsWithNamedQueryTest
    1. pl.avd.sample.jpa.converters.CarService.findDieselsWithNamedQuery(CarService.java:94)
    2. pl.avd.sample.jpa.multiselect.CarServiceTest.findDieselsWithNamedQueryTest(CarServiceTest.java:48)
    2 frames