Gary Albers@TIMEWEB
03/15/2000 09:04 AM

I am using the cmp-field-mapping feature in the orion-ejb-jar.xml file for
one of my entitybeans.
It results in the following compiler error:

Auto-deploying ./... EntityBeanWrapper6.java:623: Method intValue() not
found in class com.ddi.tophat.pk.DefaultPK.
                                        else statement.setInt(7,
object.pk.intValue());

        ^
The class CategoryEJB has a primary key field of type DefaultPK  called
'pk'.
The class DefaultPK has a public field of type Integer also called 'pk'.

In the orion-ejb-jar.xml file I have:

      <entity-deployment
            data-source="jdbc/xa/DefaultXADS"
            exclusive-write-access="true"
            location="Category"
            name="Category"
            table="Category" >
         <primkey-mapping>
            <cmp-field-mapping name="pk">
               <fields>
                  <cmp-field-mapping
                      name="pk"
                      persistence-name="categoryPK"
                      persistence-type="integer" />
               </fields>
            </cmp-field-mapping>
         </primkey-mapping>
      </entity-deployment>

The offending line of code in the wrapper is:
    if(object.pk == null) statement.setNull(7, java.sql.Types.BIGINT);
    else statement.setInt(7, object.pk.intValue());

I believe that it should be coded like this instead:
    if(object.pk == null) statement.setNull(7, java.sql.Types.BIGINT);
    else statement.setInt(7, object.pk.pk.intValue());
                                    ------

I appears that either I did not specify the cmp-field-mapping
stuff correctly or Orion does not understand the nesting of fields.

Does anybody have any suggestions on this error?

Thanks,
Gary


Reply via email to