Message:

   The following issue has been re-assigned.

   Assignee: Matthias Germann (mailto:[EMAIL PROTECTED])
---------------------------------------------------------------------
View the issue:
  http://opensource.atlassian.com/projects/xdoclet/browse/XDT-256

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XDT-256
    Summary: problem with xxxBeanData generation
       Type: Bug

     Status: Open
   Priority: Major

 Original Estimate: 0 minutes
 Time Spent: Unknown
  Remaining: 0 minutes

    Project: XDoclet
 Components: 
             EJB Module
   Versions:
             1.2 Beta 3

   Assignee: Matthias Germann
   Reporter: Craig Hamilton

    Created: Mon, 20 Jan 2003 11:26 AM
    Updated: Sat, 12 Feb 2005 4:00 AM

Description:
When I run ejbdoclet on the following file i get following method in the 
ActivityBeanData.java file.

public java.lang.Integer getPrimaryKey() {
      Integer pk = new Integer(this.getRecordID());
      return pk;
    }

This causes an error because the constructor for an integer cannot accept 
another integer.




Here is my Java file

package test;

import javax.ejb.*;
import java.util.*;

/**
 * This is the Activity entity bean. It is an example of how to use the
 * EJBDoclet tags.
 *
 * @see 
 *
 * @ejb.bean
 *     name="ActivityBean"
 *     type="CMP"
 *    cmp-version="2.x"
 //*     jndi-name="Activity"
 //*     local-jndi-name="LocalActivity"
 //*      primkey-field="recordid"
 * 
 * @ejb.interface
 *     remote-class="test.ActivityRemote"
 *     local-class="test.ActivityLocal" 
  @ejb.pk 
 *      class="java.lang.Integer"
 *      generate="false"
 * @ejb.persistence 
 *     table-name="kcactivity" 
 * @jboss.create-table "false"
 * @jboss.remove-table "false"
 *
 //*  @ejb.finder
 //*     signature="java.util.Collection findAll()"
 //*     unchecked="true"
 *
 * @ejb.transaction
 *     type="Required"
 *
// @ejb.value-object
//     name="Account"
//     match="*"
 * 
 * @version 1.5
 */
public abstract class ActivityBean implements EntityBean
{

/**
   * This create method takes only mandatory (non-nullable) parameters. The pk 
columns must be provided. When the client invokes a create method, the EJB 
container invokes the ejbCreate method. Typically, an ejbCreate method in an 
entity bean performs the following tasks: <UL> <LI>Inserts the entity state 
into the database.</LI> <LI>Initializes the instance variables.</LI> 
<LI>Returns the primary key.</LI> </UL>
   * @return the primary key of the new instance
   * @ejb.create-method 
   */
        public Integer ejbCreate(Integer id) throws CreateException {
                System.out.println("ejbCreate(Integer id)");
                setRecordID(id);
                return null;
        }

        public void ejbPostCreate(Integer id)
        {
        }
        public void ejbActivate()
        {
        }
        public void ejbLoad()
        {
        }
        public void ejbPassivate()
        {
        }
        public void ejbRemove() throws RemoveException { 
System.out.println("ejbRemove()");}
        public void ejbStore()
        {
        }
        public void setEntityContext(EntityContext ctx)
        {//  mCtx = ctx; 
        }
        public void unsetEntityContext()
        {// mCtx = null;
        }
/**
  * Returns the ActivityID
  * 
  * @return the countryId
  * @ejb.persistent-field 
  * @ejb.persistence
  *    column-name="activityid"
  * @ejb.interface-method
  *    view-type="both"
  */
        public abstract String getActivityID();
        public abstract void setActivityID(String activityID);
        /**
          * Returns the Year
          * 
          * @return the year
          * @ejb.persistent-field 
          * @ejb.persistence
          *    column-name="year"
          * @ejb.interface-method
          *    view-type="both"
          */
        public abstract int getYear();
        public abstract void setYear(int year);

        /**
        * Returns the ID
        * 
        * @return the ID
        * @ejb.persistent-field 
        * @ejb.persistence
        *    column-name="recordid"
        * @ejb.interface-method
        *    view-type="local"
        * @ejb.pk-field
         * 
        */

        public abstract Integer getRecordID();
        public abstract void setRecordID(Integer id);
/**
        * Returns the Activity Description
        * 
        * @return the countryId
        * @ejb.persistent-field 
        * @ejb.persistence
        *    column-name="description"
        * @ejb.interface-method
        *    view-type="both"
        */
        public abstract String getDescription();
        public abstract void setDescription(String description);

/**
  * Returns the Work Comments
  * 
  * @return the work comments
  * @ejb.persistent-field 
  * @ejb.persistence
  *    column-name="workcomments"
  * @ejb.interface-method
  *    view-type="both"
  * 
  */
        public abstract String getWorkComments();
        public abstract void setWorkComments(String comments);

/**
  * Returns the Accomplishments in terms of number of accomplishments of the 
specified unit of measure
  * 
  * @return the Accomplishments
  * @ejb.persistent-field 
  * @ejb.persistence
  *    column-name="accomplishments"
  * @ejb.interface-method
  *    view-type="both"
  * 
  */
        public abstract Float getAccomplishments();
        public abstract void setAccomplishments(Float accomplishments);

/**
  * Returns the Unit of Measure
  * 
  * @return the unit of measure
  * @ejb.persistent-field 
  * @ejb.persistence
  *    column-name="unitofmeasure"
  * @ejb.interface-method
  *    view-type="both"
  * 
  */

        public abstract String getUnitOfMeasure();
        public abstract void setUnitOfMeasure(String uom);
}



Here is the ejbdoclet target from build.xml

<ejbdoclet
            destdir="${output.java.gen-src.dir}"
            mergedir="parent-fake-to-debug"
            excludedtags="@version,@author,@todo"
            addedtags="@xdoclet-generated at ${TODAY},@copyright The XDoclet 
Team,@author XDoclet,@version ${version}"
            ejbspec="2.0"
            force="${xdoclet.force}"
            verbose="false"
            >

            <fileset dir="${samples.java.dir}">
                <include name="*Bean.java" />
            </fileset>

            <packageSubstitution packages="ejb" substituteWith="interfaces"/>

            <remoteinterface/>
            <localinterface/>
            <homeinterface />
            <localhomeinterface/>

       <!--     <dataobject/>  -->
            <valueobject/>

            <entitypk/>

            <entitycmp/>
            <entitybmp/>

            <session/>
          <!--
            <dao>
               <packageSubstitution packages="ejb" substituteWith="dao"/>
            </dao>
            -->
            <utilobject includeGUID="true"/>

            <deploymentdescriptor
                destdir="${output.metainf.dir}"
                validatexml="true"
                MergeDir="fake-to-debug"
            />

            <jboss
                version="3.0"
                unauthenticatedPrincipal="nobody"
                xmlencoding="UTF-8"
                destdir="${output.metainf.dir}"
                validatexml="true"
                preferredrelationmapping="relation-table"
            />
            <!--
            <weblogic
                version="6.1"
                xmlencoding="UTF-8"
                destdir="${output.metainf.dir}"
                validatexml="true"
                datasource="xdoclet.samples.default"
                mergedir="${src.dir}"
                persistence="weblogic"
            />

            <jrun
                version="4.0"
                xmlencoding="UTF-8"
                destdir="${output.metainf.dir}"
                validatexml="true"
            />
            <webSphere destdir="${output.metainf.dir}" />
            
            <jonas
                version="2.5"
                xmlencoding="UTF-8"
                destdir="${output.metainf.dir}"
                validatexml="true"
                mergedir="${src.dir}"
            />

            <orion destdir="${output.metainf.dir}"/>
               -->
               
            <apachesoap destdir="${output.classes.dir}" />

            <strutsform />

            <castormapping destdir="${output.classes.dir}" validatexml="false" 
/>

        </ejbdoclet>




---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/xdoclet/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
xdoclet-devel mailing list
xdoclet-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to