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.

  1. one way of doing creating light weight hibernate mapping object columns required.
  2. use hql columns need ' select c.col1,c.col2 columns c'
  3. construct hql @ run time, have template prepared below

    'select ' + userdefcolumns + ' columns c'; // pass userdefcolumns @ run time.

  4. as mentioned here


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -