Basic Hibernate question using and sql query
Posted
by Aerosteak
on Stack Overflow
See other posts from Stack Overflow
or by Aerosteak
Published on 2010-05-15T23:16:49Z
Indexed on
2010/05/15
23:20 UTC
Read the original article
Hit count: 201
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.
© Stack Overflow or respective owner