title: JasperReports - How to deal with nested object collection
body: <p>I'm Java developer for about 2 years but I'm new with Jasper so I need some help, I know how to deal with a simple report with fields coming from a class or entity but now I have to do something harder.</p>
  
  <p>I have these 3 entities:</p>
  
  <p>Group 
  Function
  Privilege</p>
  
  <p>The group may have a list of function, and a function has a list oc privileges, that is the simplest scenario but a group may have a list of other groups instead of a list of function.</p>
  
  <p>simple example: Group1 -> (Function1 [Privilege1, Privilege2], Function2 [Privilege3, Privilege4] - Group1 got a list with 2 functions each one with 2 privileges.</p>
  
  <p>complex example: Group2 -> (Group1 -> [Function1 {Privilege1, Privilege2}, Function2 {Privilege3, Privilege4}], Group3 -> [FunctionX {Privilege1, Privilege2}, FunctionY... - Group 2 got a list with 2 sub-groups, each sub-group got functions and so on.</p>
  
  <p>To build the report I'm used to send to Jasper just one object, in this case the parent group so I believe I need a way to iterate through its lists but I don't know what is the best approach. </p>
  
  <p>I made some research about groups and sub reports but I couldn't find any situation like that and I can't figure out what is the best for what I need to do.</p>
  
  <p>Some help would be appreciated!</p>