openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: [jira] Commented: (OPENJPA-313) list of objects returned by query partially correct
Date Tue, 14 Aug 2007 02:50:49 GMT
Hi Catalina,

On Aug 13, 2007, at 6:20 PM, catalina wei wrote:

> The method I am changing is a private method, so no javadoc is  
> required.

I'm not sure what this statement means. Javadoc is not solely for the  
purpose of documenting public methods. It's a way of helping  
developers who in future will have to look at the code and try to  
figure out if the behavior they're seeing is correct or not in context.

I'd really like to see the comments below incorporated into the code.  
Whether it's in javadoc or comments contained in the body of the  
method is a matter of style, but let's make it easier for future  


> subs flag indicates whether a relation  is non-polymorphic relation  
> or not.
> In this test scenario, we are dealing with a  polymorphic relation,  
> so the
> type should be determined by the discriminator value.
> The discriminator value can be null in the database because this  
> column is
> nullable (our mapping tool does not enforce it as 'not null'  
> column, so it
> is possible that other non-jpa application insert  a row with null
> discriminator value ). We do not want a null discriminator value  
> end up with
> an Exception. So the empty catch block is simply ignore
> potential data related error in fetching the discriminator value.
> Essentially, if the discriminator is not present, we want the type  
> initially
> set in oid to be used
> (which is the ClassMapping cls passed in to the getObjectId method).
> Otherwise set the correct type in the oid based on the  
> discriminator value.
> Catalina

Craig Russell
Architect, Sun Java Enterprise System
408 276-5638
P.S. A good JDO? O, Gasp!

View raw message