- This topic has 4 replies, 2 voices, and was last updated 20 years, 4 months ago by John.
-
AuthorPosts
-
JohnMemberI am trying to create Many different kinds of EJBs in the same package. In order to get the interfaces generated automatically I have to run XDoclet. My First EJB has a local and local home interface which I change the name of after it is generated. Then I want to create another EJB with a remote interface and then change the names as well.
When I run XDoclet it keeps adding the default named interfaces so I have to delete them after every run. I want to be able to fine tune the code generation to a specific EJB. Is this possible or do I have to have everything generated and then delete it everytime I want to add a new EJB to the project?
I haven’t even tried to add the other EJB because I think I will have to change the XDoclet properties and then get even more useless classes that I have to delete every time. This will get very confusing as I will have about 8 EJBs by the time I am done.
GregMemberYou can modify the name of classes generated by using the “Pattern” attribute in each of the corresponding SubTasks under the <ejbdoclet> task. I.E. you can click on localinterface and modify the Pattern attribute. Be sure and use the {0} variable in the pattern because that is where xdoclet inserts the EJB name. So you can customize it to anything you like except it has to have the {0} in the pattern which corresponds to the EJB name.
JohnMemberIf I wanted to call my bean ShoppingCartBean and my interfaces ShoppingCart and ShoppingCartHome how would I tell the Xdoclet {0} -“Bean” and {0} -“Bean” +”Home”?
GregMemberIf you create a new Entity bean using the Entity bean wizard, you will need to modify the @ejb.bean name=”” attribute. The wizard will generate the tag as
* @ejb.bean name = "ShoppingCartBean"
but you will need to change this to
* @ejb.bean name = "ShoppingCart"
to get the desired result you mentioned. Modify your ShoppingCartBean class with the above change, remove all of the generated classes and then rerun XDoclet. Make sure that the package suffix on the Entity bean is .ejb. The “Standard EJB” xdoclet configuration is expecting that.
JohnMemberThank You for your help. I appreciate it.
-
AuthorPosts