Skip to content
Advertisement

Can’t instantiate class using Hibernate createQuery

I’m trying to use hibernate to create objects, which are not domain models, but I get a incomprehensible error message.

My Java code:

JavaScript

The class:

JavaScript

Stacktrace:

JavaScript

The schema for the table:

JavaScript

Versions:

JavaScript

Frankly, i’m clueless about why it cannot instantiate this class.

Advertisement

Answer

You get a NullPointerException in the constructor, so the time argument that your query retrieves from the database is probably NULL. Try to change the constructor to cope with NULL values:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement