JPA Constructor Expressions fails with nullLiteral passed to constructor

Description

CriteriaQuery fails with

when use nullLiteral in query.
So if we have constructor like:

The query like:

Will fail with no appropriate constructor in class exception.
Test case attached

Environment

None

Activity

Show:
Nikita Metzger
June 16, 2016, 2:51 PM

It looks like NullLiteralExpression doesn't do any magic and returns plain null:

It should make cast to appropriate type based on provided javaType.

We can manually cast to needed type, but ExpressionImpl provides as function with type check.

So to get proper null literal we should do something like:

For string null.

Gail Badner
June 29, 2016, 1:37 AM

I've backported to 5.1 and 5.0. Can this issue be resolved now?

WilliamB
August 12, 2016, 4:46 PM

When are the fixed version gonna be released ?

Because this is blocking me =/

WilliamB
August 12, 2016, 4:48 PM

I mean 5.1.1

Assignee

Andrea Boriero

Reporter

Nikita Metzger

Fix versions

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure