<div dir="ltr">Hello,<br><br>Let&#39;s say we have a simple BeanA with one property that is part of equal/hashCode method e.g.:<br>----------------------------------------<br>public class BeanA {<br>&nbsp; int someProperty;<br>
<br>&nbsp; public int getSomeProperty() {<br>&nbsp;&nbsp;&nbsp; return someProperty;<br>&nbsp; }<br>&nbsp; public void setSomeProperty(int someProperty) {<br>&nbsp;&nbsp;&nbsp; this.someProperty = someProperty;<br>&nbsp; }<br><br>&nbsp; @Override<br>&nbsp; public boolean equals(final Object other) {<br>
&nbsp;&nbsp;&nbsp; if (this == other)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true;<br>&nbsp;&nbsp;&nbsp; if (!(other instanceof BeanA))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false;<br>&nbsp;&nbsp;&nbsp; BeanA castOther = (BeanA) other;<br>&nbsp;&nbsp;&nbsp; return new EqualsBuilder().append(someProperty,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; castOther.someProperty).isEquals();<br>
&nbsp; }<br><br>&nbsp; @Override<br>&nbsp; public int hashCode() {<br>&nbsp;&nbsp;&nbsp; return new HashCodeBuilder(228431015, 1383549405).append(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; someProperty).toHashCode();<br>&nbsp; }&nbsp; <br>}<br>------------------------------------<br>This bean is inserted into the working memory. Is it something wrong with doing?:<br>
wm.modifyRetract(beanA);<br>beanA.setSomeProperty(22); //this is changing the object equality key<br>wm.modifyInsert(beanAHandle, beanA);<br><br>I know that simple update is not allowed:<br>beanA.SetSomeProperty(22);<br>update(beanAHandle, beanA); //this is wrong<br>
<br>I guess there is no difference if this code is outside the rule engine or inside (e.g. in a rule consequence).<br><br>Thank you,<br>Best Regards,<br>Michal<br><br></div>