persistence@glassfish.java.net

Re: Strings duplications in TopLink code

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Tue, 14 Mar 2006 09:37:49 -0800

Hi Tom,

You can make the change. Will you rename the hints 'toplink...' at the
same time?

Should we split the issue in 2 or you would prefer to fix it all together
on your side?

While looking at the other strings listed in the issue, it seems to me that
there is no need to support both names - the current ones and the 'toplink....'
as all the strings are defined and used in EJB 3.0 related classes.

What do you think?

thanks,
-marina

Tom Ware wrote:
> Hi Marina,
>
> Thanks for pointing this issue out. If it is ok with you, we'll make
> the change here. The hint-related constants will now be on:
> oracle.toplink.essentials.ejb.cmp3.EJBQuery
>
> Thanks again,
> -Tom
>
>
> Marina Vatkina wrote:
>
>> Tom,
>>
>> While trying to fix the issue 327
>> (https://glassfish.dev.java.net/issues/show_bug.cgi?id=327)
>> I saw that some strings are defined in 2 classes, and used
>> directly in the 3rd. For example:
>>
>> - In EJBQueryImpl: as the string itself, e.g.
>> if (hintName.equals("cacheUsage"))
>>
>> - In EntityMappingsXMLWriter as
>> private static final String CACHE_USAGE = "cacheUsage";
>>
>> - In XMLConstants as
>> static final String CACHE_USAGE
>>
>> Do you see any problems with combining such cases into a single
>> place and making them public? Will XMLConstants be the right place?
>>
>> thanks,
>> -marina
>>
>>
>>
>