Query with literal parameter and fails with attribute converter

Description

When I declare a query with a literal parameter it thows an exception:
Caused by: org.hibernate.QueryException: AttributeConverter domain-model attribute type [org.hibernate.test.converter.literal.IntegerWrapper] did not match query literal type [java.lang.Integer]
at org.hibernate.hql.internal.ast.tree.LiteralNode.determineConvertedValue(LiteralNode.java:107)
at org.hibernate.hql.internal.ast.tree.LiteralNode.setExpectedType(LiteralNode.java:87)
at org.hibernate.hql.internal.ast.tree.BinaryLogicOperatorNode.initialize(BinaryLogicOperatorNode.java:62)
at org.hibernate.hql.internal.ast.HqlSqlWalker.prepareLogicOperator(HqlSqlWalker.java:1369)
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:4657)
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:2130)
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:2058)
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.whereClause(HqlSqlBaseWalker.java:813)
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:607)
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:311)
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:259)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:262)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:190)
... 21 more

As I see the literal parameter is the same type of the database type, so it doesn't need to be converted

Environment

None

Status

Assignee

Vlad Mihalcea

Reporter

Janario Oliveira

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

backportDecision

None

Components

Affects versions

5.1.0
5.1.1

Priority

Major