[rules-users] Meaning of the metadata 'key'

Edson Tirelli tirelli at post.com
Mon Aug 9 14:38:58 EDT 2010


   Tina,

   No problem. That is one of the items I think it is missing in the docs.
It just means that field will be considered on the generated equals() and
hashcode() methods of the bean. Example:

declare Person
    firstName : String @key
    lastName : String @key
    address : Address
end

   The above example will generate a Person bean class and will consider
first and last name as identifiers for the person. So, two instance with the
same first and last name will generate the same hashcode and the equals
method will return true when comparing them, even if the address is
different.

   Edson

2010/8/9 Tina Vießmann <tviessmann at stud.hs-bremen.de>

> Hi,
>
> I think I'm to stupid to google, but I can't find an explanation what
> '@key' means.
> Can anyone please explain it to me or just give me a link?
>
> Sorry for the simple and stupid request and thank you for your help!
>
> Greetings
> Tina
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100809/2206c497/attachment.html 


More information about the rules-users mailing list