facebook

Xdoclet:empty ejb-ql in ejb-jar.xml for @ejb.select

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #213105 Reply

    gzhuye
    Member

    I write finder and select tags in Bean class file(GoupBean.java) as following:

    * @ejb.finder
    * signature=”GroupBeanLocal findByGroupName(String name)”
    * query=”SELECT OBJECT(g) FROM GroupBean g WHERE g.name = ?1″
    *
    *
    * @ejb.select
    * signature=”java.util.Collection ejbSelectUserIDs(java.lang.String groupName)”
    * query=”SELECT user.email FROM GroupBean AS g, IN (g.users) AS user WHERE g.name = ?1″
    *

    The abstract select method and it’s calling method located in the same bean file:

    /**
    * @param groupName
    * @return
    * @throws FinderException
    */
    public abstract java.util.Collection ejbSelectUserIDs(java.lang.String groupName)
    throws FinderException;

    /**
    * @ejb.interface-method
    *
    * @return
    * @throws javax.ejb.FinderException
    */
    public String [] getUserIDs()throws javax.ejb.FinderException{
    Collection c = this.ejbSelectUserIDs(this.getName());
    return (String []) c.toArray(new String[c.size()]);
    }

    However, after I generate the files by XDoclet, EJB-QL statement with @ejb.select tag can’t be writen to <ejb-ql> tag in ejb-jar.xml file, the tag <ejb-ql> for select has no any content:

    <query>
    <query-method>
    <method-name>findByGroupName</method-name>
    <method-params>
    <method-param>String</method-param>
    </method-params>
    </query-method>
    <ejb-ql><![CDATA[SELECT OBJECT(g) FROM GroupBean g WHERE g.name = ?1]]></ejb-ql>
    </query>
    <query>
    <description><![CDATA[]]></description>
    <query-method>
    <method-name>ejbSelectUserIDs</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </query-method>
    <ejb-ql><![CDATA[]]></ejb-ql>

    As above, it’s ok with @ejb.finder tag, and this problem exists only with @ejb.select tag.

    The other issue: is it “.” or “:” for @ejb tag like: @ejb.bean or @ejb:bean? The files generated by MyEclipse is like @ejb.bean; in XDoclet document, it is @ejb:bean. same thing with them?

    Thanks in advance.

    Paul

    #213146 Reply

    Greg
    Member

    Paul,

    @ejb.finder tags are class level tags, so they go in the javadoc section for the class. You have this correct. However, @ejb.select tags are method-level tags, so you should put them in the javadoc of the ejbSelect method itself, like the following:

    
    /** @ejb.select 
     * query="SELECT a.street FROM Address AS a WHERE a.street = 'Cinnamon Street'" 
     */
     public abstract String ejbSelectMostCrowdedStreet() throws FinderException;
    #213237 Reply

    gzhuye
    Member

    You’re right, it works ! Thank you very very much ! — lovely MyEclipse Group!

    The other issue: is it “.” or “:” for @ejb tag like: @ejb.bean or @ejb:bean? The files generated by MyEclipse is like @ejb.bean; in XDoclet document, it is @ejb:bean. same thing with them?

    #213241 Reply

    Greg
    Member

    Oops, I meant to answer that question as well 🙂 I believe this syntax is interchangable as far as xdoclet is concerned. The code-assist will always place a ‘.’ no matter if a ‘:’ or ‘.’ is being used when the code-assist is invoked(Ctrl+space).

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Xdoclet:empty ejb-ql in ejb-jar.xml for @ejb.select

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