CMP Custom Finder Method Problem

Hi everybody,
I have a problem about CMP Custom Finder Method.
I made CMP Entity Bean and deployed.
Then, I updated finder section in orion-ejb-jar.xml to add my custom finder query.
Here is updating finder section in my orion-ejb-jar.xml.
<finder-method query="(($schStartDate &lt;= TO_DATE($1,'MM-DD-YYYY a HH:MI') and $schEndDate &gt;= TO_DATE($1,'MM-DD-YYYY a HH:MI')) or ($schStartDate &lt;= TO_DATE($2,'MM-DD-YYYY a HH:MI') and $schEndDate &gt;= TO_DATE($2,'MM-DD-YYYY a HH:MI'))) and ($schRoom = $3)">
<!-- Generated SQL: "......" -->
<method>
<ejb-name>RoomSchedule</ejb-name>
<method-name>findBySchDateAndRoom</method-name>
<method-params>
<method-param>java.lang.String</method-param>
<method-param>java.lang.String</method-param>
<method-param>java.lang.String</method-param>
</method-params>
</method>
</finder-method>
<resource-ref-mapping name="jdbc/OracleDS" />
And, i restarted oc4j. so, oc4j redepoyed CMP bean.
But, when my client program called CMP Bean, lookup() was ok, but calling findBySchDateAndRoom() was bad.
I couldn't get any result collection.
Here is my client code.
Context ctx = new InitialContext();
Object ref = ctx.lookup("RoomSchedule");
roomScheduleHome = (RoomScheduleHome) PortableRemoteObject.narrow(ref, RoomScheduleHome.class);
String startDT = new String("07-30-2002 am 10:30");
String endDT = new String("07-30-2002 pm 05:20);
String roomID = "TEST";
Collection roomAllSch = roomScheduleHome.findBySchDateAndRoom(startDT, endDT, roomID1);
Iterator roomSchItr = roomAllSch.iterator();
int schQty = 0;
while (roomSchItr.hasNext()) {
roomSchedule = (RoomSchedule) roomSchItr.next();
if(roomSchedule.getStatus().equals("A"))
schQty++;
After excuting above code, schQty was still zero!!
Because Collection roomAllSch had not any items.
But, table ROOMSCHEDULE had 30 records which were same query condition in my database.
I traced SQL statement using P6Spy Class.
Here is spy.log.
1028006337814|10|0|statement|select * from RoomSchedule where ((RoomSchedule.schStartDate <= TO_DATE(?,'MM-DD-YYYY A.M. HH:MI') and RoomSchedule.schEndDate >= TO_DATE(?,'MM-DD-YYYY A.M. HH:MI')) or (RoomSchedule.schStartDate <= TO_DATE(?,'MM-DD-YYYY A.M. HH:MI') and RoomSchedule.schEndDate >= TO_DATE(?,'MM-DD-YYYY A.M. HH:MI'))) and (RoomSchedule.schRoom = ?)|select * from RoomSchedule where ((RoomSchedule.schStartDate <= TO_DATE('7-30-2002 ?@@| 01:00','MM-DD-YYYY A.M. HH:MI') and RoomSchedule.schEndDate >= TO_DATE('7-30-2002 ?@@| 01:00','MM-DD-YYYY A.M. HH:MI')) or (RoomSchedule.schStartDate <= TO_DATE('7-30-2002 ?@HD 12:00','MM-DD-YYYY A.M. HH:MI') and RoomSchedule.schEndDate >= TO_DATE('7-30-2002 ?@HD 12:00','MM-DD-YYYY A.M. HH:MI'))) and (RoomSchedule.schRoom = 'Earth')
1028006337824|10|0|statement|select RoomSchedule.schTitle, RoomSchedule.schStartDate, RoomSchedule.schEndDate, RoomSchedule.schDayAll, RoomSchedule.status, RoomSchedule.schRoom, RoomSchedule.reqUser, RoomSchedule.apprUser, RoomSchedule.purpose, RoomSchedule.relatoinID, RoomSchedule.schDesc, RoomSchedule.reqDate, RoomSchedule.apprDate from RoomSchedule where (RoomSchedule.schID = ?)|select RoomSchedule.schTitle, RoomSchedule.schStartDate, RoomSchedule.schEndDate, RoomSchedule.schDayAll, RoomSchedule.status, RoomSchedule.schRoom, RoomSchedule.reqUser, RoomSchedule.apprUser, RoomSchedule.purpose, RoomSchedule.relatoinID, RoomSchedule.schDesc, RoomSchedule.reqDate, RoomSchedule.apprDate from RoomSchedule where (RoomSchedule.schID = 0)
As you see it, two query statement were executed.
First query statement was ok and got some result records.
But, second query statement was bad so didn't get any result records.
I didn't understand why second query statement was executed.
When roomAllSch.iterator() was being excuted in my client program, second query statment was executed.
I couldn't believe....
What's wrong? Please help me....
OC4J : Version 9 Release 2
Database : Oracle 8i
OS : Windows 2000 Professional

I created CMP of EJB 1.1, I wanted to add a finder
there, but it didn't work.
the error message is:
"AccountEJB_vkbo0d_HomeImpl.java":
AccountEJB_vkbo0d_HomeImpl should be declared
abstract; it does not define findBySalary(float) in
AccountEJB_vkbo0d_HomeImpl at line 11, column 1I think I don't remember CMPs having finder methods anything other than abstract. The code goes in the deployment descriptor. I hope you atleast got that right.
Richard.

Similar Messages

  • Custom finder methods

    I'm tring to deploy an Entity bean (CMP) with custom finder method that gets a parameter.
    I encountered two problems :
    1) defining the query in the deployment descriptor coased the app server to generate the a query without the where cloase - this was fixed by changing manualy the orion-ejb-jar.xml in the application-deployments directory.
    2)the second, and yet unresolved problem, is that OC4J doesn't bind the parameter that the query uses during runtime. I'm recieving an ORA msg that claims that not all the parameters are binded.

    see sample code
    http://otn.oracle.com/sample_code/tech/java/oc4j/htdocs/oc4jsamplecode/oc4j-demo-ejb.html
    also there should be a section in our documentation about cmp custom finder methods. oc4j attempts to generate custome finder methods based on home interface
    <finder-method query="$empNo = $1">
    <method>
                             <ejb-name>EmployeeBean</ejb-name>
                             <method-name>findByEmpNo</method-name>
                             <method-params>
                                  <method-param>java.lang.Integer</method-param>
                             </method-params>
                        </method>
                   </finder-method>

  • Using wildcards in custom find methods with CMP beans

    Hi,
    I'd like to create a custom find method called findByName which accepts a string. I'd typically want to use the string in a '%<name>%' scenario, where the user needn't type in the whole name. Does anybody know what the partial query should look like? I'm not sure how to concatenate the '%' symbol to the string taken in.
    Thanks in advance
    Gillian

    Gillian-
    Bind variables are of the form $1, $2, etc., so try using a query stmt like this:
    select * from YOURTABLE where name like '%$1%'
    Regards,
    -Jon

  • Finder methods problem

    Hi
    I met a very funny problem. when I try to deploy a entity BMP.(compile was ok).
    The bean have a method called findSubElements(this is not a finder method). I
    got the a exception:
    weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ ejbFindXXX method
    for 'findSubElements(java.lang.String,jav
    a.lang.String,java.lang.String)' not found on class 'entity.XXXEntityBean_sgz73u_Impl'.
    what should I do to fix that ?
    Thanks for help.

    Hi
    It's working on WLS6.0 SP2 very well.
    Macsym
    PenFriend <[email protected]> wrote:
    Macsym,
    this isa known issue Cr06867. As a workaround chamge the name of the
    methods to not start with
    a find.
    macsym wrote:
    I've tried to re-run it. In my
    classpath=.;.\lib\weblogic_sp.jar;.\lib\weblogic.jar;
    but the problem still here. I'v just changed examples under WLS totest it.
    BTW I using WLS6.1 SP1.
    Thanks any way.
    Macsym
    Rob Woollen <rob@trebor_nelloow.moc> wrote:
    It looks like you need to re-run weblogic.ejbc. Also make sure that
    your classes are only
    in the ejb-jar file and not the server's classpath.
    Finally, what version of WLS are you using? It shouldn't be throwing
    an AssertionError for
    this.
    -- Rob
    macsym wrote:
    Hi
    I met a very funny problem. when I try to deploy a entity BMP.(compilewas ok).
    The bean have a method called findSubElements(this is not a findermethod). I
    got the a exception:
    weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ ejbFindXXXmethod
    for 'findSubElements(java.lang.String,jav
    a.lang.String,java.lang.String)' not found on class 'entity.XXXEntityBean_sgz73u_Impl'.
    what should I do to fix that ?
    Thanks for help.

  • Does CMP bean finder method supports "LIKE" sql?

    I put something like this in the orion-ejb-jar.xml file:
    <finder-method partial="false" query="select * from EMP where $ename like $1 AND $job like $2">
    </finder-method>
    If I put in exact value like 'ADAMS' or 'CLERK', it works fine. But if I put in 'A%' or 'CL%', it does not work. I know the record is there and the same sql does return a row in sql-plus.
    Appreciate any help.
    Adam

    I put something like this in the orion-ejb-jar.xml file:
    <finder-method partial="false" query="select * from EMP where $ename like $1 AND $job like $2">
    </finder-method>
    If I put in exact value like 'ADAMS' or 'CLERK', it works fine. But if I put in 'A%' or 'CL%', it does not work. I know the record is there and the same sql does return a row in sql-plus.
    Appreciate any help.
    Adam gday Adam -
    I don't think there is anything in the persistence manager that will prevent this from working as you want.
    Can I ask what version of OC4J you are using?
    I'm not sure from your email if you are you specifying the fields in the finder method by surrounding them with SQL style quotes as in 'A%'? You shouldn't need to do that if you are.
    I just tested it out with a simple client and entity bean based on the employee table, which I created in about 30 seconds with the new JDeveloper CMP Entity Bean Wizard, using the create from existing table option.
    I added a finder method that looks like the following:
    Collection findByEnameAndJob(String ename, String job) throws RemoteException, FinderException;
    And then changed the SQL in the finder dialog (or orion-ejb-jar.xml) for the finder to be
    <finder-method partial="False" query="select * from emp where $ename like $1 and $job like $2">
    <method>
    <ejb-name>Emp</ejb-name>
    <method-name>findByEnameAndJob</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    <method-param>java.lang.String</method-param>
    </method-params>
    </method>
    </finder-method>
    The client code then looked for employees with a name starting with the letter A and whose job started with the letters CL as follows:
    Collection coll = empHome.findByEnameAndJob("A%","CL%");
    System.out.println("*** There were : " + coll.size() + " records returned ***");
    Iterator iter = coll.iterator();
    while (iter.hasNext())
    emp = (Emp)iter.next();
    System.out.println("empno = " + emp.getEmpno());
    System.out.println("ename = " + emp.getEname());
    When the client was run, this was the resulting output:
    *** There were : 1 records returned ***
    empno = 7876
    ename = ADAMS
    job = CLERK
    mgr = 7788
    hiredate = 1987-05-23 00:00:00.0
    sal = 1100
    comm = 0
    deptno = 20
    If you want to find all the entries that have a job that starts with CL you can even use the same finder method like:
    Collection coll = empHome.findByEnameAndJob("%","CL%");
    This results in the output
    *** There were : 4 records returned ***
    empno = 7369
    ename = SMITH
    job = CLERK
    mgr = 7902
    hiredate = 1980-12-17 00:00:00.0
    sal = 800
    comm = 0
    deptno = 20
    empno = 7876
    ename = ADAMS
    job = CLERK
    mgr = 7788
    hiredate = 1987-05-23 00:00:00.0
    sal = 1100
    comm = 0
    deptno = 20
    empno = 7900
    ename = JAMES
    job = CLERK
    mgr = 7698
    hiredate = 1981-12-03 00:00:00.0
    sal = 950
    comm = 0
    deptno = 30
    empno = 7934
    ename = MILLER
    job = CLERK
    mgr = 7782
    hiredate = 1982-01-23 00:00:00.0
    sal = 1300
    comm = 0
    deptno = 10
    I can send you the packaged EAR file if you want to try this simple example for yourself - or you I would even encourage you to grab JDeveloper 9i and see how it easy it makes it to build and test the example I was just working with.
    cheers!
    -steve

  • CMP and Finder methods

    I've got a table:
    id number primary key,
    name varchar2(50),
    price number
    How can i make finderXXX for this sql query:
    select * from table where name like 'beer' and price > 10;
    Thank's

    gday Max -
    For this, you'll need to make some a slight modification to the generated finder methods.
    Say you create an entity called Drinks which has the same structure as the table you provide as an example (and can I just say, what a great example you chose ;)
    It should go something like this - note, I've not tried this but this is what you need to look at doing:
    In the Home interface (DrinksHome) create a findermethod that looks like:
    public Collection findByName(String name, Double Price) throws RemoteException, FinderException;
    * note we make the return type a collection since it's possible that you may get more than one entity returned.
    Go ahead and deploy your EJB.
    When you deploy your EJB, OC4J will generate a finder method for this method for you.
    Now what you need to do is to modify the generated XML deployment descriptor to tune the query if you will.
    OC4J generates the deployment descriptor info it needs for an application in $OC4J/application-deployments.
    Go to to $OC4J/application-deployments/<app-name>/<ejb-name> where app-name and ejb-name are specific your deployed EJB.
    Open the orion-ejb-jar.xml file. This is the file OC4J uses to describe the deployed beans.
    Search through the file until you find the <finder-method> tag.
    Amend the query attribute of the finder-method tag to reflect the where clause of the query you want to execute:
    query="$name = $1 AND $price > $2"
    Now go to the generated SQL string and add the corresponding SQL where condition, using a ? in place of the actual value of the query string above
    It would become something like ...
    < !-- Generated SQL: "select drinks.id, drinks.name, drinks.price from drinks where drinks.name = ? AND drinks.price > ?" -->
    Note that in this query, the where clause matches the query you specified, but you omit the actual values.
    Check the method-params defined for the find below and ensure that the order of them lines up with the values you've specified in the finder query.
    Stop OC4J and restart it and the new finderMethod should come into effect.
    Give that a try and see how you go.
    cheers!
    -steve-
    null

  • Problem when creating CAF Entity Service finder Methods

    Guys,
    Can any one please suggest me appropriatly to the below problem.
    I am using NWDS 7.06. I have no problem when creating CAF project, Application Service and Entity Service even.
    But in the Entity Service:
    1. Add a string or longtext attribute.
    2. try to create a custom finder method in operations tab, during that operation i am  not finding the attribute which i have created in step1.
    That means i am not able to create the my own finder methods with parameters.
    I was able to do that in some version long ago but i have forgotten that NWDS version.
    summary of Problem Is: " Cannot create custom methods with custom parameters in Entity Service"
    Can you please suggest me the right version or a solution to this problem on urgent basis please.
    I promise you that i will give you full points to you who ever gives me the right solution.
    Please mail your suggestions to [email protected]

    Guys,
    I have solved the problem successfully. Thanks for your attention.

  • Finder methods for CMP beans

    We do not implement finder method in Bean class for CMP. As such, where do we implement finder methods such as findInRange() method? How does the container implement my custom "find" methods.
    Thanks

    Using CMP 2.x, your custom finder and select methods are implemented by the container based on the EJB QL query you provide in the ejb-jar.xml. In CMP 1.1, there was no portable way to express the semantics of the query, so most vendors had a vendor-specific syntax for describing the query.
    See chapter 27 of the J2EE 1.4 Tutorial for some examples of using EJB QL :
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html
    --ken
    Kenneth Saks
    J2EE SDK Team
    SUN Microsystems

  • CMP Finder Method

    Could you supply a couple of examples of setting up a custom CMP Finder Method using both SQLJ and JDBC?
    In particular how is the SQL coded in the "SQL Query" textbox on the "Method" tab? How are the parameters and the result set referenced and returned? What is the return type?
    Simple Select / Where clause multirow and single row examples should suffice.
    I using JDeveloper 9.0.2.8.2.
    Thanks.

    You can create custom CMP Finder Methods which takes appropriate sql but not SQLJ and JDBC.
    i.e if you are adding a custom finder method in orion-ejb-jar.xml it takes only SQL not java code
    In JDeveloper select orion-ejb-jar.xml in the project and right-click on it and choose Settings option
    Select the Entity bean in the navigator and choose Finder methods
    Click on Add. The dialog box will allow to add a new finder method with SQL query
    Click on Help for specific information
    Couple of hints are
    Partial
    Whether or not the specified query is a partial one. A partial query is the 'where' clause or the 'order' (if it starts with order) clause of the SQL query.
    Queries are partial by default. If partial="false" is specified then the full query is to be entered as value for the query attribute and you need to make sure that the query produces a result-set containing all of the CMP fields. This is useful when doing advances queries involving table joins and similar.
    Query
    The query part of an SQL statement. This is the section following the WHERE keyword in the statement. Special tokens are $number which denotes an method argument number and $name which denotes a cmp-field name. For instance the query for "findByAge(int age)" would be (assuming the cmp-field is named 'age'): "$1 = $age".
    Return type can be collection if the query is returning more than one row of data or it could be the entity bean type itself (if it is only one row)
    raghu
    JDev Team

  • EJB CMP finder methods

    The Oracle documents suggests that the following definition in the EJBHome is enough to create a finder method
    public Enumeration findByWhere(String where) throws RemoteException, FinderException;
    I get a java.lang.AbstractMethodError on the client when I try to call this - suggesting the the container is not implementing the method for me.
    I see no place in the oracle descriptor to define these finder methods.
    What is the deal with these ? How does one use CMP and Finder methods other than the standard "findByPrimaryKey(....)
    thanks
    null

    Hello,
    Let say you don't want to uyse the defualt finder methods, then you can write your own like:
    (in client servlet/JSP file etc..)
    emps = home.findByLast_name(request.getParameter("searchText")); //find by last name
    where:
    step 1) go to EJB class editor (under your main EJB directory)
    step 2) click on finder tab and click add, to add new finder methods
    step 3) (you can click help now to get more info on this..anyways) findBy<CMB field>
    would automatically check the "Managed by OC4j" check box, this means that you have matched a signature tag for finders (kind of like setXX and getXX if you are doing JavaBean...automatically done for you)
    step 4) else you can make one that is not up like findWildCard(String wildCard):
    i)by specifying the Method name to be: findWildCard
    ii)parameter (String type: wildCard)
    step 5) rebuild the EJB directory after you add this method
    step 6) use it in any of you client servlet/JSP as you would with the defualt findAll() methods etc..
    cheers,
    -Long
    [email protected]

  • IN expression in finder method

    is it possible to define a CMP bean to include a custom finder method to retrieve records that satisfy an IN expression, like in:
    SELECT * FROM CUSTOMERS WHERE IDCUST IN( $1 )
    If so? How should I code the finder method in orion-ejb-jar.xml?
    I am using EJB 1.1 under OC4J 9.0.2.1 and JDev 9.0.2
    Thanks,
    Fedro

    You have a solution replacing LIKE with LOCATE function
    LOCATE return the current position into string of ocurrence or substring
    For
    locate('AN','BANDERA')
    Return 1
    Example:
    ...where (?1, e.description) > 0
    Good luck!!

  • Binary Data Type in finder methods for CMP beans

    How to write an equivalent ejb-ql query in ejb-jar.xml for a finder method accepting
    a byte array as a parameter. The finder method is for a cmp-field mapped to a
    database field with binary data type

    Using CMP 2.x, your custom finder and select methods are implemented by the container based on the EJB QL query you provide in the ejb-jar.xml. In CMP 1.1, there was no portable way to express the semantics of the query, so most vendors had a vendor-specific syntax for describing the query.
    See chapter 27 of the J2EE 1.4 Tutorial for some examples of using EJB QL :
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html
    --ken
    Kenneth Saks
    J2EE SDK Team
    SUN Microsystems

  • CMP finder method error

    I'm now using Jbuilder7+weblogic7 to do some EJB develop.
    Weblogic server is configured to run inside the Jbuilder IDE, and my CMP entity bean has been deployed successfully.
    I new a "EJB test client" within Jbuilder to test my CMP bean, I could create entity bean via create method, but when I using finder method to find a bean, the client report that "java.sql.SQLException: No data found"!
    My EJB-QL is:"SELECT OBJECT(o) FROM Account o WHERE o.ownername = ?1"
    And below is the exception report:
    javax.ejb.FinderException: Problem in findByOwnername while preparing or executing statement: 'weblogic.jdbc.rmi.SerialPreparedStatement@1d2384':
    java.sql.SQLException: No data found
    java.sql.SQLException: No data found
         at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6212)
         at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(JdbcOdbc.java:3266)
         at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(JdbcOdbcResultSet.java:5398)
         at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:326)
         at weblogic.jdbc.jts.ResultSet.getString(ResultSet.java:84)
         at weblogic.jdbc.rmi.internal.ResultSetImpl.getString(ResultSetImpl.java:178)
         at weblogic.jdbc.rmi.internal.ResultSetStraightReader.getString(ResultSetStraightReader.java:37)
         at weblogic.jdbc.rmi.SerialResultSet.getString(SerialResultSet.java:128)
         at cmptest.AccountBean_8259n1__WebLogic_CMP_RDBMS.__WL_loadGroup0FromRS(AccountBean_8259n1__WebLogic_CMP_RDBMS.java:945
    Can anybody help me out? Thanks.

    The Exception is pretty clear there are no Records found for the Owner Name u give. Try Creating the Suitable record from ur Entity Bean(create method of course) then check in the DB for the Record and then try to retrieve it....I don't think there should be any problem....
    Cheers,
    manja

  • Deployment problem with finder method

    I have a problem deploying an application that was working prior to my adding a finder method to one of the entity beans. Here is the Descriptor from the EJB Module that i created (which appears to be ok):
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <display-name>RFXModule</display-name>
    <enterprise-beans>
    <session>
    <display-name>RFXManager</display-name>
    <ejb-name>RFXManager</ejb-name>
    <home>au.com.alphawest.trader.rfx.business.management.RFXManagerHome</home>
    <remote>au.com.alphawest.trader.rfx.business.management.RFXManagerRemote</remote>
    <ejb-class>au.com.alphawest.trader.rfx.business.management.RFXManagerBean</ejb-class>
    <session-type>Stateful</session-type>
    <transaction-type>Container</transaction-type>
    <ejb-local-ref>
    <ejb-ref-name>ejb/rfx/RFXDocument</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>au.com.alphawest.trader.rfx.business.data.RFXDocumentLocalHome</local-home>
    <local>au.com.alphawest.trader.rfx.business.data.RFXDocumentLocal</local>
    <ejb-link>RFXDocument</ejb-link>
    </ejb-local-ref>
    </session>
    <entity>
    <display-name>RFXAttachment</display-name>
    <ejb-name>RFXAttachment</ejb-name>
    <local-home>au.com.alphawest.trader.rfx.business.data.RFXAttachmentLocalHome</local-home>
    <local>au.com.alphawest.trader.rfx.business.data.RFXAttachmentLocal</local>
    <ejb-class>au.com.alphawest.trader.rfx.business.data.RFXDocumentAttachment</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>False</reentrant>
    <abstract-schema-name>RFXAttachment</abstract-schema-name>
    <cmp-field>
    <field-name>name</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>type</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>attachmentContents</field-name>
    </cmp-field>
    <primkey-field>name</primkey-field>
    </entity>
    <entity>
    <display-name>RFXDocument</display-name>
    <ejb-name>RFXDocument</ejb-name>
    <local-home>au.com.alphawest.trader.rfx.business.data.RFXDocumentLocalHome</local-home>
    <local>au.com.alphawest.trader.rfx.business.data.RFXDocumentLocal</local>
    <ejb-class>au.com.alphawest.trader.rfx.business.data.RFXDocumentBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>au.com.alphawest.trader.rfx.business.data.RFXDocumentPK</prim-key-class>
    <reentrant>False</reentrant>
    <abstract-schema-name>RFXDocument</abstract-schema-name>
    <cmp-field>
    <field-name>documentGUID</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>creationDate</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>creatorGUID</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>description</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>dueDate</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>emailAddress</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>faxNo</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>locked</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>notes</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>organisationName</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>ownerGUID</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>requestId</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>subject</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>telephoneNo</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>unitGUID</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>buyer</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>organisationGUID</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>sourceId</field-name>
    </cmp-field>
    <ejb-local-ref>
    <ejb-ref-name>ejb/rfx/RFXDocumentAttachment</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>au.com.alphawest.trader.rfx.business.data.RFXAttachmentLocalHome</local-home>
    <local>au.com.alphawest.trader.rfx.business.data.RFXAttachmentLocal</local>
    <ejb-link>RFXAttachment</ejb-link>
    </ejb-local-ref>
    <ejb-local-ref>
    <description>A line item attached to this document</description>
    <ejb-ref-name>ejb/rfx/RFXLineItem</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>au.com.alphawest.trader.rfx.business.data.RFXLineItemLocalHome</local-home>
    <local>au.com.alphawest.trader.rfx.business.data.RFXLineItemLocal</local>
    <ejb-link>RFXLineItemBean</ejb-link>
    </ejb-local-ref>
    <query>
    <description>Find the rfx documents related to the given supplier through it's line items</description>
    <query-method>
    <method-name>findBySupplierId</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </query-method>
    <ejb-ql>SELECT OBJECT(d) FROM RFXDocument AS d, IN(d.lineItems) l WHERE l.supplierGuid = 'DummySupplierGuid'</ejb-ql>
    </query>
    </entity>
    <entity>
    <display-name>RFXLineItem</display-name>
    <ejb-name>RFXLineItem</ejb-name>
    <local-home>au.com.alphawest.trader.rfx.business.data.RFXLineItemLocalHome</local-home>
    <local>au.com.alphawest.trader.rfx.business.data.RFXLineItemLocal</local>
    <ejb-class>au.com.alphawest.trader.rfx.business.data.RFXLineItemBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.math.BigDecimal</prim-key-class>
    <reentrant>False</reentrant>
    <abstract-schema-name>RFXLineItem</abstract-schema-name>
    <cmp-field>
    <field-name>itemId</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>rfxGuid</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>contractCode</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>supplierGuid</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>productCode</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>description</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>quantity</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>units</field-name>
    </cmp-field>
    <primkey-field>itemId</primkey-field>
    </entity>
    </enterprise-beans>
    <relationships>
    <ejb-relation>
    <ejb-relation-name>RFXDocument-RFXAttachment</ejb-relation-name>
    <ejb-relationship-role>
    <ejb-relationship-role-name>RFXDocument</ejb-relationship-role-name>
    <multiplicity>One</multiplicity>
    <relationship-role-source>
    <ejb-name>RFXDocument</ejb-name>
    </relationship-role-source>
    <cmr-field>
    <cmr-field-name>attachments</cmr-field-name>
    <cmr-field-type>java.util.Collection</cmr-field-type>
    </cmr-field>
    </ejb-relationship-role>
    <ejb-relationship-role>
    <ejb-relationship-role-name>RFXAttachment</ejb-relationship-role-name>
    <multiplicity>Many</multiplicity>
    <cascade-delete/>
    <relationship-role-source>
    <ejb-name>RFXAttachment</ejb-name>
    </relationship-role-source>
    </ejb-relationship-role>
    </ejb-relation>
    <ejb-relation>
    <ejb-relation-name>RFXDocument-RFXLineItem</ejb-relation-name>
    <ejb-relationship-role>
    <ejb-relationship-role-name>RFXDocument</ejb-relationship-role-name>
    <multiplicity>One</multiplicity>
    <relationship-role-source>
    <ejb-name>RFXDocument</ejb-name>
    </relationship-role-source>
    <cmr-field>
    <cmr-field-name>lineItems</cmr-field-name>
    <cmr-field-type>java.util.Set</cmr-field-type>
    </cmr-field>
    </ejb-relationship-role>
    <ejb-relationship-role>
    <ejb-relationship-role-name>RFXLineItem</ejb-relationship-role-name>
    <multiplicity>Many</multiplicity>
    <cascade-delete/>
    <relationship-role-source>
    <ejb-name>RFXLineItem</ejb-name>
    </relationship-role-source>
    </ejb-relationship-role>
    </ejb-relation>
    </relationships>
    <assembly-descriptor>
    <container-transaction>
    <description>This value was set as a default by Sun ONE Studio.</description>
    <method>
    <ejb-name>RFXAttachment</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
    <description>This value was set as a default by Sun ONE Studio.</description>
    <method>
    <ejb-name>RFXDocument</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
    <description>This value was set as a default by Sun ONE Studio.</description>
    <method>
    <ejb-name>RFXLineItem</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
    <description>This value was set as a default by Sun ONE Studio.</description>
    <method>
    <ejb-name>RFXManager</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    I get the following error message when i try to run the EJB Module through the Sun One Verifier Tool:
    Error: ** Error trying to process file: java.lang.RuntimeException: No method found for XML query element: Ambiguous or invalid <query-method>
    java.lang.RuntimeException: No method found for XML query element: Ambiguous or invalid <query-method>
    at com.sun.enterprise.deployment.xml.EjbNode.parseQueries(EjbNode.java:700)
    at com.sun.enterprise.deployment.xml.EjbNode.completeLoadingDescriptor(EjbNode.java:671)
    at com.sun.enterprise.deployment.xml.EjbBundleNode.completeLoadingDescriptor(EjbBundleNode.java:524)
    at com.iplanet.ias.deployment.EjbBundleXmlReader.load(EjbBundleXmlReader.java:249)
    at com.iplanet.ias.deployment.EjbBundleXmlReader.loadStdAloneModule(EjbBundleXmlReader.java:162)
    at com.sun.enterprise.tools.verifier.Verifier.openEjbJar(Verifier.java:2421)
    at com.sun.enterprise.tools.verifier.Verifier.loadEjbJar(Verifier.java:1318)
    at com.sun.enterprise.tools.verifier.Verifier.loadJar(Verifier.java:866)
    at com.sun.enterprise.tools.verifier.gui.MainPanel.run(MainPanel.java:187)
    at java.lang.Thread.run(Thread.java:536)
    Look in file "RFXModule.jar_verified.xml" for detailed results on test assertions.
    Any help would be greatly appreciated.
    Mark Hesketh

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    The title of the Console window should be All Messages. If it isn't, select
              SYSTEM LOG QUERIES ▹ All Messages
    from the log list on the left. If you don't see that list, select
              View ▹ Show Log List
    from the menu bar at the top of the screen.Click the Clear Display icon in the toolbar. Then try the action that you're having trouble with again. Select any messages that appear in the Console window. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
    The log contains a vast amount of information, almost all of which is irrelevant to solving any particular problem. When posting a log extract, be selective. A few dozen lines are almost always more than enough.
    Please don't indiscriminately dump thousands of lines from the log into this discussion.
    Please don't post screenshots of log messages—post the text.
    Some private information, such as your name, may appear in the log. Anonymize before posting.

  • CMP Entity Bean with ejb-ql finder methods and INFORMIX database

    Hi,
    I have some CMP Entity Beans with finder methods defined in ejb-ql. In my ejb-jar, within <entity> definitions I have something like:
        <entity>
          <abstract-schema-name>BeanName</abstract-schema-name>
          <cmp-field><field-name>fieldOne</field-name></cmp-field>
          <cmp-field><field-name>fieldTwo</field-name></cmp-field>
          <query>
            <query-method>
              <method-name>findAll</method-name>
              <method-params></method-params>
            </query-method>
            <ejb-ql>SELECT OBJECT(o) FROM BeanName o</ejb-ql>
          </query>
        <entity>
    And in persistent.xml:
    <db-properties>
         <data-source-name>datasource_name</data-source-name>
    </db-properties>
    <entity-bean>
         <ejb-name>BeanName</ejb-name>
         <table-name>table_name</table-name>
         <field-map key-type="NoKey">
         <field-name>fieldOne</field-name>
         <column><column-name>column_one</column-name></column>
          </field-map>
         <field-map key-type="NoKey">
         <field-name>fieldTwo</field-name>
         <column><column-name>column_two</column-name></column>
          </field-map>
          <finder-descriptor>
              <method-name>findAll</method-name>
              <method-params/>
         </finder-descriptor>
    Once deployed, on server side, I can found a java source file (with corresponding compiled class file) in path:
    j2ee/cluster/server0/apps/companyName/MyEARApp/EJBContainer/temp/temp38837373733/route/to/package/
    with names:
    BeanName0_0pm.java
    BeanName0_0PM.class
    and the generated java file contains this code:
      public java.util.Enumeration ejbFindAll() throws javax.ejb.FinderException, javax.ejb.EJBException  {
        TransactionContext tc = pm.getTransactionContext();
        Connection conn = null;
        PreparedStatement pSt = null;
        ResultSet ejb_rs = null;
        int status = javax.transaction.xa.XAResource.TMSUCCESS;
        try {
          conn = pm.getConnectionForFindMethod();
          pSt = conn.prepareStatement("SELECT \"O\".\"COLUMN_ONE\",\"O\".\"COLUMN_TWO\", FROM \"TABLE_NAME\" \"O\"");
          ejb_rs = pSt.executeQuery();
    I'm trying to call this method but it throws a SQLException when preparing the statement.
    It seems that Informix does not like this SQL syntax because of upper case names, doble quotes on table alias, or something else.
    When editing persistent.xml in netweaver, I can define the element <datasource-vendor> as ORACLE, SAPDB, MS_SQL_SERVER, DB2_UDB_AS400 or DB2_UDB_OS390 but INFORMIX is not an accepted value.
    Is there any way to define how this SQL query is build?
    Thanks in advance.

    The return type of the finder method defined in the remote home interface is either the entity bean's remote interface or a collection of objects implementing the entity bean's remote interface. The return type of the finder method defined in the local home interface is either the entity bean's local interface or a collection of objects implementing the entity bean's local interface

Maybe you are looking for

  • Question Mark on Thumbnail images in galleries

    When I post my photo gallery from iPhoto through iWeb onto my mac site, all the thumbnail images appear with a question mark over it. This just happened with my last posting and has affected all my past galleries as well. Does anyone know what causes

  • How to Create a Clean oraInventory in Release 12 [ID 834894.1]

    Hi hussein/helios, I tried the above procedure, but the oracle_homes can not be added to the inventory.xml hence my opatch -lsinventory still fails: Result: LsInventory: OPatch Exception while accessing O2O OPATCH_JAVA_ERROR  : An exception of type "

  • Can i run struts in Jrun ?

    Hi, i am a newbe in java and currently running in Jrun.My question is, can i run struts in Jrun ? thanks saumya

  • Converting 16 Bit Integer to Individual Bits

    I have a 16 bit Binary Integer and I need to convert this into Individual bits so we can perform some data manipulation.  I know there is a easy solution, but I just cant figure it out.  I attached what I was trying to do, remove the 16 bits and make

  • Does iMessages work with original iPad?

    Learn more screen under settings shows Apple iOS 6 messages with iMessages.  Will it work with ios 5.1.1?