- This topic has 1 reply, 1 voice, and was last updated 17 years, 5 months ago by Lance Drake.
-
AuthorPosts
-
Lance DrakeMemberHi 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!
Lance DrakeMemberAs 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!
-
AuthorPosts