[jBPM Users] - [jBPM 4.2]
by xalperte
I'm trying to locate a ProcessInstance inside a List container using the "contains" method but the instance is not found.
Looking in the equals method of the ExecutionImpl I saw that the EqualsUtils.equals static method is used for that purpose and it's using the object pointer instead the object hibernate key to compare objects.
I think the implementation of the EqualsUtils.equals method should compare objects using its hibernate key, doesn't it?
Idea:
| ClassMetadata entity1Metadata = sessionFactory.getClassMetadata(entity1.getClass());
| Object entity1Key = entity1Metadata.getIdentifier(entity1, EntityMode.POJO);
|
| ClassMetadata entity2Metadata = sessionFactory.getClassMetadata(entity2.getClass());
| Object entity2Key = entity2Metadata.getIdentifier(entity2, EntityMode.POJO);
|
| return entity1Key.equals(entity2Key)
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266872#4266872
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266872
14 years, 11 months