facebook

Entity Bean template [Closed]

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #197952 Reply

    The 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” ?

    #197953 Reply

    Scott Anderson
    Participant

    The 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

    #197974 Reply

    If 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 – Home

    Maybe 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?

    #197979 Reply

    Scott Anderson
    Participant

    Maybe 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

    #197985 Reply

    I 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. 🙂

    #197986 Reply

    Scott Anderson
    Participant

    OK, 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

    #198002 Reply

    Ok. Can’t wait to see what lies ahead…

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: Entity Bean template [Closed]

You must be logged in to post in the forum log in