Joined: Fri Apr 28, 2006 11:26 am Posts: 8 Location: Vancouver, WA
|
Does anyone have any thoughts on this? Basically, I want to do something like this:
session.createSQLQuery("select id, sub_type from my_table").setResultTransformer(Transformers.aliasToBean(MyTableBean.class));
...except I need a way to map the "sub_type" column in the result set to a field named "subType" in the bean class. Putting the alias directly in the sql ("select ... sub_type as subType") does not work-- I get an error saying that there is no "setsubtype()" method (the aliasing does not preserve the camel-case).
This seems like it should be as common and easy with non-managed entities as it is with managed entities, but I can't seem to figure it out!
Any suggestions would be very much appreciated; this has really got me hung up right now!
Thanks,
Tim
|
|