facebook

[Closed] getPrimaryKey function in DATA interface INTEGER

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #270841 Reply

    Lance Drake
    Member

    Hi MyEclipse Folks,

    My eyeballs are just not seeing what is the problem.

    MySQL has a table which has a PRIMARY KEY of type int.

    The EJB XDoclet header shows…

    
    import java.lang.Integer;
    /**
     * @ejb.bean name="TicketsPrint"
     *           display-name="Name for TicketsPrint"
     *           description="Description for TicketsPrint"
     *           jndi-name="ejb/TicketsPrint"
     *           local-jndi-name="ejb/TicketsPrintLocal"
     *           type="CMP"
     *           cmp-version="2.x"
     *           view-type="local"
     *              schema="TicketsPrint"
     *              cmp-field="recnum"             // int(11)     auto_increment
     *              cmp-field="tktRequestor"     // tinytext employee ID person requesting printing
     *              cmp-field="tktSubscriber"     // tinytext sub_sub 5 char identifier
     *                                  // more fields in here
     *           primkey-field="recnum"
     *           prim-key-class="Integer"
     *                      
     * @ejb.pk class="Integer"
     *      generate="false"
     *           
     * @ejb:util generate="physical"
     *           
     * @ejb.finder
     *         description="Find All"
     *         signature="java.util.Collection findAll()"
     *         query="SELECT OBJECT(a) FROM TicketsPrint AS a"
     */
    

    Everything else about the object is GREAT… except…

    in TicketsPrintData.java – an interface file there is an error indicated

    in the function getPrimaryKey

    THE CONSTRUCTOR INTEGER IS UNDEFINED

    
    package ejb.jcm.tickets.interfaces;
    /**
     * Data object for TicketsPrint.
     * @xdoclet-generated at ${TODAY}
     * @copyright The XDoclet Team
     * @author XDoclet
     * @version ${version}
     */
    public class TicketsPrintData
       extends java.lang.Object
       implements java.io.Serializable
    {
    private java.lang.Integer recnum;
    private java.lang.String tktRequestor;
    private java.lang.String tktSubscriber;
    
    public TicketsPrintData()
       {
       }
    
    public TicketsPrintData( 
       java.lang.Integer recnum,
       java.lang.String tktRequestor,
       java.lang.String tktSubscriber)
       {
       setRecnum(recnum);
       setTktRequestor(tktRequestor);
       setTktSubscriber(tktSubscriber);
       }
    
    public Integer getPrimaryKey() 
       {
       Integer pk = new Integer();
       return pk;
       }
    }
    

    Darned if I can find the secret incantation to rectify the situation.

    As best I know I am doing the exact same thing in other EJBs in the same project

    and do not have this problem. Having tried substituting java.lang.Integer for Integer I would add that if the Primary Key is type STRING (both in the EJB and MySQL table) – there is no problem. Whaaa?????

    Any clues?

    Thanks!

    #270847 Reply

    Lance Drake
    Member

    As I found out – the alleged comment on the cmp-field entries was the culprit. Evidently the parser hates the ‘//’ sequence. As I understand it /* … */ works just fine.

     
    *   cmp-field="recnum"    // int(11)    auto_increment 
    

    Removing the comment from the line allowed the XDoclet compile to proceed without incident.

    In the words of Emily Litella – “Neverminnnnnd…”

    Thanks!

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: [Closed] getPrimaryKey function in DATA interface INTEGER

You must be logged in to post in the forum log in