Getting nullpointer exception while executing query

Description

Hi,

I'm trying to upgrade my application from OpenJPA implementation 1.0.1 which was using JPA 1.0 to Hibernate 5.1.2

I'm getting nullpointer exception when trying to to call geResultList on a Entity class.

My Sample classes are below: (I've changed the class names as I can not share my original source code. But the mapping are same.)

1) Class Charger (Representing a sort of mobile charger that has 2 Pin)

2)

3) every charger has 2 pins so I've declared a bi-directional one to many mapping between Charger and pin.

4) PIN Entity has 2 properties. CHARGER_ID and PIN_NUMBER. this 2 field defines one record in the PIN table uniquely. So I've declared a IDclass (ChargerPin) for representing the composite key

5) Now while I'm invoking the below query I'm getting a nullPointer exception with Empty satck trace.

Can you please look into this bug.
Earlier I was trying with Hibernate 5.1.1. version and then the code was throwing error as "Error accessing field by reflection for persistent property".
Then I changed the code base to use Hibernate version 5.1.2 and then without change of source code the exception got changed into Nullpointer exception.

Environment

Hibernate 5.1.2 running on Weblogic 12.1.2 with Java 1.6 SDK.

Assignee

Unassigned

Reporter

sagnik sarkar

Fix versions

None

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Blocker
Configure