database - how to exclude certain columns being returned in hibernate -
i referred below 1 adding specific columns returned in hibernate. how return entity chosen columns using criteria
however in mycase exclusion small see if can give list of columns excluded in result.
is there optimal way in hibernate?
note: there no way provide exclusions in hibernate criteria.
several other ways of inclusions below. totally choice.
- one way of doing creating light weight hibernate mapping object columns required.
- use hql columns need ' select c.col1,c.col2 columns c'
construct hql @ run time, have template prepared below
'select ' + userdefcolumns + ' columns c'; // pass userdefcolumns @ run time.
as mentioned here
Comments
Post a Comment