Monday, September 13, 2010

Hibernate Named Native SQL Queries mapping to POJO in xml

Spent sometime looking for a way to create named in the orm.xml. I would have ranted about why every single example I had related to annotations, but that's already been covered sufficiently here or even why they all related to returning entity results when all you need sometimes is a simple POJO. This had me yearning back to the good old days of iBatis.

That goes into the orm.xml.

FYI, I was using hibernate 3.2.x, with the orm_1_0.xsd. ResultTransformers to do the quick POJO thing are only available when using Hibernate raw i.e. not using JPA. A good example is available here.

No comments: