Basic Hibernate question using and sql query
- by Aerosteak
Hello
Sorry if this is basic but I cannot find the solution anywhere.
I have an java Object ‘Person’ with 3 properties firstname,lastname and username.
I have an Oracle Store procedure returning a Resultset with the 3 column.
All works fine for that.
Now I have another StoreProcedure that will only return firstname and lastname but not username.
I get the following error : « could not read column value from result set username. »
Hibernate tries to fetch the username property from the resultset.
If I remove the property username, then it works.
Do I have to Create a Special Pojo for Each type of resultset or can I tell Hibernate what to map for each result set?
Please help.