gorm - Use Grails fixture plugin with embedded domains -
given domain classes:
class person { string name address address static embedded = ['address'] } class address { string addressline1 string addressline2 string city string state string postalcode string phone } is there recommended why create fixtures when using embedded domains?
what have tried in fixture file:
address1(address) { addressline1 = '1444 palm ave' addressline2 = 'suite 07' city = 'kissiammee' state = 'fl' postalcode = '34741' phone = '615-555-1111' } person1(person) { name = 'fixture person' address = ref('address1') } in case person1 gets db address1 data embedded in table expected, row added in address table. when create person though personcontroller in running application address row not created, , have fixtures work similar if possible.
this tried on guess. didn't work...
person2(person) { name = 'test person' address = [ addressline1 : '222 boone ave', city : 'boone', state : 'ia', postalcode : '50210', phone : '515-555-1111', ] } my controller scaffolded small tweaks handle rest json. if pass
{ "name":"rest fixture person", "address":{ 'addressline1':'333 boone ave', 'city':'boone', ... } } i address embedded on person expected , no row in address table desired. wondering if can pull same data setup off fixture plugin.
Comments
Post a Comment