Return-Path: Delivered-To: apmail-db-ojb-dev-archive@www.apache.org Received: (qmail 54290 invoked from network); 23 Jul 2004 11:36:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 23 Jul 2004 11:36:03 -0000 Received: (qmail 63857 invoked by uid 500); 23 Jul 2004 11:36:02 -0000 Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 63700 invoked by uid 500); 23 Jul 2004 11:36:01 -0000 Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "OJB Developers List" Reply-To: "OJB Developers List" Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 63686 invoked by uid 500); 23 Jul 2004 11:36:01 -0000 Received: (qmail 63681 invoked by uid 99); 23 Jul 2004 11:36:00 -0000 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.27.1) with SMTP; Fri, 23 Jul 2004 04:36:00 -0700 Received: (qmail 54269 invoked by uid 1510); 23 Jul 2004 11:36:00 -0000 Date: 23 Jul 2004 11:36:00 -0000 Message-ID: <20040723113600.54268.qmail@minotaur.apache.org> From: arminw@apache.org To: db-ojb-cvs@apache.org Subject: cvs commit: db-ojb/src/java/org/apache/ojb/broker/metadata/fieldaccess AnonymousPersistentFieldForInheritance.java X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N arminw 2004/07/23 04:36:00 Modified: src/java/org/apache/ojb/broker/metadata/fieldaccess AnonymousPersistentFieldForInheritance.java Log: bug fix by Sergey Udovenko, AnonymousPersistentFieldForInheritance now use factory methods for pc objects too. I guess that I'm getting it because the base class supposed to be created by the factory as well (ctor is protected). The problem is in method AnonymousPersistentFieldForInheritance.get() that uses ClassHelper.newInstance(cld.getBaseClass()); to create that base class. Revision Changes Path 1.12 +6 -5 db-ojb/src/java/org/apache/ojb/broker/metadata/fieldaccess/AnonymousPersistentFieldForInheritance.java Index: AnonymousPersistentFieldForInheritance.java =================================================================== RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/metadata/fieldaccess/AnonymousPersistentFieldForInheritance.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- AnonymousPersistentFieldForInheritance.java 4 Apr 2004 23:53:35 -0000 1.11 +++ AnonymousPersistentFieldForInheritance.java 23 Jul 2004 11:36:00 -0000 1.12 @@ -15,12 +15,12 @@ * limitations under the License. */ +import java.util.Vector; + import org.apache.ojb.broker.metadata.ClassDescriptor; import org.apache.ojb.broker.metadata.MetadataException; import org.apache.ojb.broker.util.ClassHelper; -import java.util.Vector; - /** * @author Houar TINE * @version $Id$ @@ -75,11 +75,12 @@ { try { - value = ClassHelper.newInstance(cld.getBaseClass()); + ClassDescriptor baseCld = cld.getRepository().getDescriptorFor(cld.getBaseClass()); + value = ClassHelper.buildNewObjectInstance(baseCld); } catch (Exception e) { - throw new MetadataException(e); + throw new MetadataException("Can't create new base class object for '" + cld.getBaseClass()+"'", e); } putToFieldCache(obj, value); } --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org For additional commands, e-mail: ojb-dev-help@db.apache.org