PrimaryKey generation with public field
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   David_Ekholm
Posted On:   Friday, April 26, 2002 01:29 PM

I try to have XDoclet generate a primary key class containing a public field. In the old days with EJBDoclet I wrote: * @ejb:pk-field java.lang.String gameId in the class section of the javadoc comment. Now I can't get it to work at all. How is the equivalent syntax? The migration sheet didn't help. Actually I get ArrayIndexOutOfBounds exceptions when I try to have XDoclet generate the PK class: [ejbdoclet] Generating PK class for 'casino.backend.ActivityEntityBean'. [ejbdoclet] (TemplateEngine.invokeMethod 776 ) Invoking method failed: packageOf, line=4 of template file: jar:file:C:javalibxdoclet.jar!/xdoclet/ejb/entitypk.j [ejbdoclet] java.lang.StringIndexOutOfBo   More>>

I try to have XDoclet generate a primary key class containing a public field. In the old days with EJBDoclet I wrote:

* @ejb:pk-field java.lang.String gameId


in the class section of the javadoc comment. Now I can't get it to work at all. How is the equivalent syntax? The migration sheet didn't help.
Actually I get ArrayIndexOutOfBounds exceptions when I try to have XDoclet generate the PK class:




[ejbdoclet] Generating PK class for 'casino.backend.ActivityEntityBean'.
[ejbdoclet] (TemplateEngine.invokeMethod 776 ) Invoking method failed: packageOf, line=4 of template file: jar:file:C:javalibxdoclet.jar!/xdoclet/ejb/entitypk.j
[ejbdoclet] java.lang.StringIndexOutOfBoundsException: String index out of range
: -1
[ejbdoclet] javadoc: In doclet class xdoclet.DocletTask$DocletMain, method start has thrown an exception java.lang.reflect.InvocationTargetException
[ejbdoclet] at java.lang.String.substring(String.java:1525)
[ejbdoclet] at xdoclet.tags.PackageTagsHandler.packageOf(PackageTagsHandler.
java:141)

   <<Less

Re: PrimaryKey generation with public field

Posted By:   Ara_Abrahamian  
Posted On:   Saturday, April 27, 2002 12:38 PM

Use @ejb:bean primkey-field="gameId" in the class header. The class should have getGameId/setGameId methods.


Ara.

About | Sitemap | Contact