The Composite Primary Key - Entity Bean

Discussions

EJB programming & troubleshooting: The Composite Primary Key - Entity Bean

  1. The Composite Primary Key - Entity Bean (1 messages)

    hi all
    i have created a entity bean which has composite primary key .
    the composite primary key fields are

    name
    age
    std

    During jar file creation i gave the wlql In findall method
    as (&(> name ' ')(> age 0)(> std ' '))
    the jar got created and the bean also got deployed in weblogic .when i call the bean from jsp the bean fetches only the first row from the table. and it is not returning all the rows .

    if any body can give me solution to rectify this error mailme at

    ------------------------------------------------------------
    p dot gokulnath at chennai dot transys dot net
    ------------------------------------------------------------
  2. The Composite Primary Key - Entity Bean[ Go to top ]

    Hi Gokulnath,
       First of all, there is a very basic flaw in ur query.
    See '&' is a binary operator. but u've used it as if it is a terniary operator. Take for example '+'. It is a binary operator. If u write an expression using this, it will look like...
         Infix notaion ==> a + b
         Prefix notation ==> + a b

        If u r having an expression like this, a + b + c, then it's corresponding prefix nototion will look like, +(+ab)c.
        So, u consider ur query, it would've been,
      "select * from <table>
         where (name > '') and (age > 0) and (std > '').

    The equivalent WLQL statement will look like...
         ![CDATA[&(&(> name '')(> age 0))(> std '')]]

    But i don't think this will work, because what is the meaning of "''"????.

    Ur intention to find all entity beans from the table. why not use a simple query like this. For finding all elements this is the solution we follow for such finder methods.
         ![CDATA[(= 1 1)]]

    Try this out and let me know the results.

    thanks...hasan
    (ahamed at aztec dot soft dot net)