Bookmark Topic Watch Topic
  • New Topic

Create Criteria in Hibernate

 
purushotham podaralla
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Report post to moderator
i have a DO class and having properties like int, long and Set.
i want to access all these properties using projections. i can able to get only for int, long and not for Set. when i exceuted this one getting NullPointerException for Set. please give me suggession to resolve this problem.
List clientAccountIter = (List) session.createCriteria
(ClientAccount.class)
.setProjection(Projections.projectionList()
.add(Projections.property("clientAccount.clientAcctId"))
.add(Projections.property("clientAccount.clientAcctNum"))
.add(Projections.property("clientAccount.clientAccounts")))
.add(Restrictions.eq("registrationReference.regRefId", regRefId))
.list();
here i can get the values for clientAcctId, clientAcctNum and not for clientAccounts. clientAccounts is a Collection property
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post duplicate threads. You already asked this question and there is already a reply to it.

I am closing this thread.

Mark
 
    Bookmark Topic Watch Topic
  • New Topic