NullPointerException when retrieving data for entity with InheritanceType.SINGLE_TABLE on Neo4j


A native query in Neo4jRemote returns the discrimnator type value as a Long instead of an Integer.
Because of this the equality doesn't work and the OgmLoader cannot find the sub class corresponding to the discriminator value.
This causes a NullPointerException.


Hibernate OGM 4.5.1, Wildfly 14.0.1, Zulu 8, Windows 10, Neo4j 3.5.1


Davide D'Alto
January 16, 2019, 12:44 PM

OK, sorry about that. I will double check. Maybe I tested with the patch applied

Mlondolozi Shandu
January 16, 2019, 12:37 PM

@Davide D'Alto, I tried the JPQL queries and they also had the same issue.

Davide D'Alto
January 8, 2019, 7:18 PM

I figure out the problem. I wil lsend a PR soon.
In the meanwhile, JPQL queries will work fine, for example:

Davide D'Alto
January 8, 2019, 4:02 PM

No, it shouldn't cause any problem.
There are some issues when it tries to load the entity due to the inheritance. But I still not sure what the problem is.

I'm pretty sure that's an OGM bug.

The only problem I've found in the test you provided is that you don't close the factory at the end.

Mlondolozi Shandu
January 8, 2019, 3:55 PM

Do you know why the data left behind would interfere with the test the second time, since it's just a simple select query?

I have tried this using Hibernate ORM and it works fine, all the queries return the correct data.


Davide D'Alto


Mlondolozi Shandu