Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.6-rc-1, 1.5.8
-
None
-
None
Description
ObjectGraphBuilder currently resolves references in a sequential way, referenced nodes must be defined prior to being referenced by other nodes.
Example:
def company = builder.company( name: 'ACME', employees: [] ) { address( line1: '123 Groovy Rd', zip: 12345, state: 'JV', id: 'a1' ) employee( name: 'Duke', employeeId: 1, id: 'e1' ) { address( a1 ) // or address( refId: 'a1' ) } }
This improvement will allow the following case
def company = builder.company( name: 'ACME', employees: [] ) { employee( name: 'Duke', employeeId: 1, id: 'e1' ) { address( refId: 'a1' ) // note that refId must be a String! } address( line1: '123 Groovy Rd', zip: 12345, state: 'JV', id: 'a1' ) }