does mockDomain() support bidirectional relationships? should it?

View: New views
2 Messages — Rating Filter:   Alert me  

does mockDomain() support bidirectional relationships? should it?

by Sergey Bondarenko :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Grails developers!

Is anyone of you using mockDomain() a lot?

It looks like it does not handle bidirectional relationships properly. Backreferences in children are not set.
I looked into MockUtils sources. This functionality is not implemented. Should it be implemented? 
Why MockUtils does not reuse DomainClassGrailsPlugin (addRelationshipManagementMethods and so on...) ?


Thanks!


Regards,
Sergey

Re: does mockDomain() support bidirectional relationships? should it?

by Peter Ledbrook :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> It looks like it does not handle bidirectional relationships properly.
> Backreferences in children are not set.
> I looked into MockUtils sources. This functionality is not
> implemented. Should it be implemented?

Yes.

> Why MockUtils does not reuse DomainClassGrailsPlugin
> (addRelationshipManagementMethods and so on...) ?

Because a plugin class isn't really designed for re-use. I haven't
looked at the code recently, but if the domain class plugin methods
aren't tied to database functionality, then we could factor them out
and re-use them from within MockUtils.

Cheers,

Peter

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email