Re: svn commit: r677894 - /openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java

View: New views
2 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: svn commit: r677894 - /openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java

by Jacek Laskowski :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Jul 18, 2008 at 2:58 PM,  <rickmcguire@...> wrote:

> Author: rickmcguire
> Date: Fri Jul 18 05:58:30 2008
> New Revision: 677894
>
> URL: http://svn.apache.org/viewvc?rev=677894&view=rev
> Log:
> OPENEJB-860 CMP 1.x beans with complex keys can generate an incorrect JPA mapping.
>
>
> Modified:
>    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java
...

> +    private MappedSuperclass resolveIdClass(MappedSuperclass idclass, MappedSuperclass current, Class ejbClass)
> +    {
> +        // None identified yet?  Just use the one we just found
> +        if (idclass == null) {
> +            return current;
> +        }
> +
> +        String idClassName = idclass.getClazz();
> +        String currentClassName = idclass.getClazz();
> +
> +        // defined at the same level (common).  Just keep the same id class
> +        if (idClassName.equals(currentClassName)) {
> +            return idclass;
> +        }

Is this correct? I think currectClassName should be current.getClazz()
as equals in the if statement will always evaluate to true.

Jacek

--
Jacek Laskowski
Notatnik Projektanta Java EE - http://www.JacekLaskowski.pl

Re: svn commit: r677894 - /openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java

by Rick McGuire :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jacek Laskowski wrote:

> On Fri, Jul 18, 2008 at 2:58 PM,  <rickmcguire@...> wrote:
>  
>> Author: rickmcguire
>> Date: Fri Jul 18 05:58:30 2008
>> New Revision: 677894
>>
>> URL: http://svn.apache.org/viewvc?rev=677894&view=rev
>> Log:
>> OPENEJB-860 CMP 1.x beans with complex keys can generate an incorrect JPA mapping.
>>
>>
>> Modified:
>>    openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/CmpJpaConversion.java
>>    
> ...
>  
>> +    private MappedSuperclass resolveIdClass(MappedSuperclass idclass, MappedSuperclass current, Class ejbClass)
>> +    {
>> +        // None identified yet?  Just use the one we just found
>> +        if (idclass == null) {
>> +            return current;
>> +        }
>> +
>> +        String idClassName = idclass.getClazz();
>> +        String currentClassName = idclass.getClazz();
>> +
>> +        // defined at the same level (common).  Just keep the same id class
>> +        if (idClassName.equals(currentClassName)) {
>> +            return idclass;
>> +        }
>>    
>
> Is this correct? I think currectClassName should be current.getClazz()
> as equals in the if statement will always evaluate to true.
>  
D'oh!  Yes, you're correct.  Thanks for catching that.

> Jacek
>
>  

LightInTheBox - Buy quality products at wholesale price