I’ve got a simple pojo which is filled thanks to hibernate. I would like to see a variable from this pojo being mapped to a very specific SQL query and I wonder if this is possible to create such a mapping in the hibernate.xml file ?
Thanks a lot
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There’s no easy way in pure JPA to do that. The best would be to use Hibernate’s @Formula annotation, on which you can specify a “SQL Fragment” that should be used to get the field’s data.