- This topic has 6 replies, 2 voices, and was last updated 21 years, 3 months ago by Markus Härnvi.
-
AuthorPosts
-
Markus HärnviMemberThe Entity bean template creates an implementation class with XDoclet tags.
The name of the bean is set to the same name as the implementation class. Is that correct?
Example: @ejb.bean name = “MyEntityBean”
Shouldn’t it be @ejb.bean name = “MyEntity” ?
Scott AndersonParticipantThe name of the bean is set to the same name as the implementation class. Is that correct?
It’s not really a matter of being “correct”, it’s more a matter of preference. The name is simply what it will be called in ejb-jar.xml. you can set it to whatever you would prefer. The generated name is just a default value.
–Scott
MyEclipse Support
Markus HärnviMemberIf I generate an entity bean called MyEntityBean (implementation class) and use the default generated code I will get:
-
ejb.MyEntityBean – Implementation CMP bean
ejb.MyEntityBeanBean – Implementation CMP bean (from XDoclet)
interfaces.MyEntityBean – Remote
interfaces.MyEntityBeanHome – HomeMaybe there could be a setting where I can tell MyEclipse that I use *Bean or *EJB for my implementation class. The template could check the setting and generate according to that?
Or am I missing something?
Scott AndersonParticipantMaybe there could be a setting where I can tell MyEclipse that I use *Bean och *EJB for my implementation class. The template could check the setting and generate according to that?
The settings you want are already provided in the XDoclet configuration. Be sure to check the XDoclet reference manual in the MyEclipse User Guide for a full list of settings and how to configure them. You’re looking for the ejbDoclet field called classNameSuffix.
–Scott
MyEclipse Support
Markus HärnviMemberI already have “Bean” in classNameSuffix, but that default setting is overridden when the template give the explicit “wrong” @ejb.name-tag.
My suggestion was to have the right XDoclet tags inserted in the implementation file when MyEclipse generates the file. If I select to generate MyEntityBean as the implementation class, the template engine could strip “Bean” from the @ejb.name-tag.
Not that it’s that hard to change it for every entity I create, but it was a bit confusing at first. 🙂
Scott AndersonParticipantOK, I see what you’re getting at. You’re right that it can be a bit confusing. You’re also correct that the template is generated without regard for your XDoclet settings. It’s really intended to be an example that will work with the default settings. Tighter integration between these two systems is an open feature request.
Thanks for the input.
–Scott
MyEclipse Support
Markus HärnviMemberOk. Can’t wait to see what lies ahead…
-
AuthorPosts