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

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -