If you have a rule
rule "a Person" when
$p: Person()
then ... end
does it fire? What about the list if you insert just one Person?
-W
PS: Try to format your posts like everybody else, please.
On 07/01/2014, glambert27 <glambe2(a)hotmail.com> wrote:
Hi,I have an issue I'm trying to track down and won't to rule
out the data
being an issue. Running 5.5 ExpertI have a Fact; let's say "Person"Class
Person {private String fName;private String lName;private String
ssn;getters/setters@Overridepublic boolean equals(final Object obj) {
if ( obj == null ) return false; if(obj instanceof Person){
final Person other = (Person) obj; return Objects.equal(ssn,
other.ssn); } else{ return false; }}
@Override public int hashCode(){ return Objects.hashCode(ssn);
}}Now if I insert 2 person objects with the same ssn. Actually if my LHS is
$list : ArrayList() collect( Person() ), do I expect 2, 1, or 0 for my
arraylist. What is seeing is that the arraylist is 0 but that doesn't make
sense to me and I think there is another underline issue.
--
View this message in context:
http://drools.46999.n3.nabble.com/Duplicate-Facts-with-overriden-equals-h...
Sent from the Drools: User forum mailing list archive at
Nabble.com.