db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Renaers <Fra...@minervasoftcare.com>
Subject small bug in PersistenceBrokerImpl - method isPKValid
Date Fri, 06 Dec 2002 13:09:02 GMT
Hi,

We decided to use in our ojb's, not primitive variables, but the
corresponding wrappers (Integer, Double, ...)
The usage of wrappers allows us to check for null-values in our business
code.
But some of our junit-tests fail for the ojb's that use composite primary
keys.
The reason is that the isPkValid() method returns false for a null - value
(wrapper), but not for a 0 - value (primitive). 

ex.
 <<RoleBean.java>> 
   // scenario  
   Role role3 = new RoleBean();
   role3.setRoleName("projectleader");
   role3.setProject(project2);
   role3.setPerson(person1);
   broker.insert(role3);

--> The insert will not work, because isPkValid() returns false because the
persistent fields person_id and project_id equal null.  


Greetings,

Frank Renaers





Mime
View raw message