Quantcast

Name a Property "call"

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Name a Property "call"

raoulus
Hello,

I have a domain-class "Call" and now I want to reference it, e.g. Call call. What about the naming - is call a reserved word? As I know, call is also used for invoking closures.

Thanks,
Raoul
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Name a Property "call"

Antony Jones
Call is a method on a closure, it's not a reserved word per-se.

On 12 April 2012 21:51, raoulus <[hidden email]> wrote:

> Hello,
>
> I have a domain-class "Call" and now I want to reference it, e.g. Call call.
> What about the naming - is call a reserved word? As I know, call is also
> used for invoking closures.
>
> Thanks,
> Raoul
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/Name-a-Property-call-tp4553047p4553047.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>



--
________________________________
ꜽ . antony jones . http://www.enzy.org

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Name a Property "call"

raoulus
This post was updated on .
Well having a property named "call" will lead to some problems with the constraints, e.g.

Class XYZ {
Call call
....
static constraints = {
call(nullable: false)
}

So i renamed to property to get everything working.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Name a Property "call"

Ian Roberts
In reply to this post by raoulus
On 12/04/2012 21:51, raoulus wrote:
> Hello,
>
> I have a domain-class "Call" and now I want to reference it, e.g. Call call.
> What about the naming - is call a reserved word? As I know, call is also
> used for invoking closures.

You're probably safer using a different name for the property.  If this
is an association from one domain class to another and you need a
specific name for the database column you can always specify a custom
mapping.

Ian

--
Ian Roberts               | Department of Computer Science
[hidden email]  | University of Sheffield, UK

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

    http://xircles.codehaus.org/manage_email


Loading...