[rules-users] declaring attributes for an existing class

Michael Anstis michael.anstis at gmail.com
Wed Aug 17 02:39:58 EDT 2011


What version of Drools are you using?

AFAIK what you have done should work.

2011/8/17 Neel <neeleshdev at yahoo.co.in>

> Hi,
> I've following class defined:
>
> public class User {
>
> private String id;
>
> //get,set, equals & hashCode method are defined
>
> }
>
>
> If I add more attributes using declare syntax as below:
>
> declare User
>
>     name : String
>
> end
>
>
> it gives error "Error creating field accessors for 'User' for type 'User'".
> Is there a way, more attributes can be added in existing class using declare
> syntax?
>
>
> Alternatively, if a class is created by using only declare syntax, can we
> add equals/hasCode methods dynamically?
>
>
> Thanks & Regards,
>
> Neel
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110817/7e800649/attachment.html 


More information about the rules-users mailing list