I need to assign the result of a jpql result to a simple class java object
I have something like this
class myObject() {
@id
private Long id;
private String Name;
private String description;
...
//getters and setters
}
I need to somehow to store the result of this SQL query, example
// could be anytable SELECT DISTINCT c.table_id, c.name, NULL AS description FROM anyTable
How do I do this in JPQL and then assign the result to my object?