0

I have entity say Entity1 which has 1 to many relationship with Entity 2 & Entity 3.

Can I use criteria API so that conditionally when i fetch Entity 1 I fetch on Entity 2 but dont fetch Entity 3

user1228785
  • 512
  • 2
  • 6
  • 19

1 Answers1

0

If it's happening while you convert to JSON — I would use SELECT NEW queries with approrpiate DTO constructor. This way you'll get as much flexibility as you need.

asm0dey
  • 2,841
  • 2
  • 20
  • 33