Is it possible to have an Entity extend two or more Interfaces?

3 posts / 0 new
Last post
Rick
Offline
Joined: 12/07/2011
Is it possible to have an Entity extend two or more Interfaces?

So.. I've got a play model like the following with these interfaces :

Interface('Address') {
string_64 'address' ,mandatory:true
string_32 'city' ,mandatory:true
string_2 'state' ,mandatory:true
string_12 'zipcode' ,mandatory:true
}
Interface('Phone') {
string_10 'phone' ,mandatory:true
}

Can I declare an Entity like this or is this not possible with the current setup?  I get compilation errors on something like this:

Entity('Supplier', extend: 'Address', 'Phone') {
string_32 'name' ,mandatory:true
string_64 'email' ,mandatory:true
}

I also tried using two extend: keywords and that wasn't happy either.. Is the extend limited to a single interface?  Seems like that might be the case but thought I'd ask.  Thanks!

 

Edited by Rick on 12/14/2011 - 00:08
maxime
Offline
Joined: 06/23/2008
Hi Rick Yes it is possible to

Hi Rick

Yes it is possible to extend muliple interfaces... In this case you should use the groovy syntax for lists : extend:['Address', 'Phone']

Regards

Maxime

Rick
Offline
Joined: 12/07/2011
Ok.. Thanks!  I figured I

Ok.. Thanks!  I figured I must have been missing something..