- This topic has 3 replies, 3 voices, and was last updated 21 years ago by Scott Anderson.
-
AuthorPosts
-
mdichiMemberSome questions in using MyEclipse to build EJBs.
1) When building an EJB as explained in the docs, there are a number of additional files that MyEclipse automatically generates. Some of these are obvious, but others are not. What’s the purpose of the XBean.java, XBeanData.java, and XBeanUtil.java files/classes. Note all of these are in the “interfaces” package that MyEclipse generates.
2) Can a different primary key class be used, other than the one generated by MyEclipse? Normally, if my bean is name XBean, MyEclipse creates a class called XBeakPK. Most of my beans could be handled by a primary key class of Integer.
3) What is an exceptable way to have my EJBs automatically put into the appropriate directory of a corresponding Web project? There is not much about this in the docs.
Thanks,
Mike
Marcus BeyerMemberXBean sounds like the remote interface.
XBeanData sounds like “data object”, which is deprecated (XDoclet docs) in favor of “value object” (Value Object pattern).
XBeanUtil contains some utilities. see e.g.: http://xdoclet.sourceforge.net/bp.html
XBeanPK is also kind of deprecated, I think. I wonder why this stuff is generated by default. See tags @ejb.bean @ejb.pk @ejb-pk-field nad @ejb.persistence for some infos about primary keys: http://xdoclet.sourceforge.net/tags/ejb-tags.htm
Hope this helps a little bit. I am just a beginner to these things myself …
mdichiMemberYes, that seems to make sense. Now that I’ve played with a little more, things seem to becoming clearer.
I think the interfaces.XBean is the remote interface. It is derived from EJBObject. We name our beans a little differently, but this still seems fine.
It seems like a lot of these classes are optional, including the generation of and name of the primary key class. All of this stuff seems easily controllable using XDoclet. I just needed to find the list of EJBDoclet tags and attributes, which you mentioned.
The one question that still remains for me is how do I deploy my EJBs (in an EJB project) into a Web project? Do I manually have to copy the class files?
Mike
Scott AndersonParticipantMike,
XDoclet settings are available in the reference manual in the MyEclipse User Guide in the Help system and also here:
http://myeclipseide.com/enterpriseworkbench/help/topic/com.genuitec.myeclipse.doc/html/reference/xdoclet-doc/index.htmlThe one question that still remains for me is how do I deploy my EJBs (in an EJB project) into a Web project? Do I manually have to copy the class files?
Your EJB’s go in an EJB project, not a web project. To ease using them from your web module, both projects should be part of an enterprise (EAR) project. Check out the Concepts section of the user guide. Here’s a quick link to the EAR project section: http://myeclipseide.com/enterpriseworkbench/help/topic/com.genuitec.myeclipse.doc/html/tasks/EAR/creatingEARProject.htm
–Scott
MyEclipse Support -
AuthorPosts