Bugs item #800345, was opened at 2003-09-04 12:14
Message generated for change (Comment added) made by lqd
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=800345&group_id=22866
Category: JBossCMP
Group: v3.2
Status: Open
>Resolution: Duplicate
Priority: 7
Submitted By: Anders Engstr�m (andersengstrom)
Assigned to: Nobody/Anonymous (nobody)
Summary: isIdentical on entity bean does not check type of bean
Initial Comment:
When calling isIdentical on en EJBLocalObject
representing an entity bean the method returns "true"
if both EJBLocalObject have the same primary key - no
check is performed to verify that the EJBLocalObject
represents the same type of entity bean.
Pseudo Code:
==============
// Bean1 and Bean2 are entities with a primary key of
type java.lang.Long
// Locate the homes
Bean1LocalHome beanHome1 = getBean1Home();
Bean2LocalHome beanHome2 = getBean2Home();
// Find entities
Bean1Local bean1 = beanHome1.findByPrimaryKey(new Long(1));
Bean2Local bean2 = beanHome2.findByPrimaryKey(new Long(1));
if(bean1.isIdentical(bean1)){
//This evaulates to true as expected
}
if(bean1.isIdentical(bean2)){
// This is ALSO evaluated to true, event though bean1
and bean2 does not represent the same entity.
}
================
Looking at the source, the method Boolean
isIdentical(Object, Object) only checks if its
arguments are of type EJBLocalObject and proceeds by
checking the primaryKey of the objects.
This method should also verify that the two objects are
of the same bean class.
----------------------------------------------------------------------
>Comment By: Christian Riege (lqd)
Date: 2003-09-04 14:01
Message:
Logged In: YES
user_id=176671
see also bug #613214: equals is wrong on Local Interfaces
----------------------------------------------------------------------
Comment By: Anders Engstr�m (andersengstrom)
Date: 2003-09-04 13:58
Message:
Logged In: YES
user_id=345315
After a little digging around I found that this problem have
been reported previously - and there is even a patch
submited that would solve this issue:
Bug #613214, Patch #624402
This was a long time ago, and I'm really curious why that
issue is still open?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=800345&group_id=22866
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development