I have a pojo that is object A , of table TableA
TableA (int a1,int a2)
.
To fill the table I run a query that returns (int a1, int a2, boolean b3) (and runs multiple data checks)
b3 is not valid in TableA , but I still want to use the same pojo for both (it's a very big pojo , and it will be a major code duplication to have one just for the sake of the query)
I've declared in the pojo
@Transient
Boolean getB3() {..}
void setB3(Boolean b3) {..}
And in the query I declared that I expect to get the b3 value:
<return> ...
<return-property name="b3" column="b3"/>
...
</return>
But Hibernate just ignores the parameter and never use "setB3()".. When I remove the @Transient , it works (and then fail when inserting to the table , naturally) - so all the names are correct
How can I fix this?
Thanks!