on 12-30-2004 7:59 AM
Hello,
i have a simple question:
How must a SQL-statement in persistent.xml look like, if i want to get all entries from a table in the WAS Java?
My own statements always return errors during deployment.
Thanks for help,
André
Hello Daniel,
my problem was that i tried to use SQL statements with my entity beans that where not conform with EJB QL, i wanted to get all the entries from a db table.
My Problem is solved and i forgot to close this thread, sorry about that.
Regards,
André
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Andre,
I just want to add the important note that declaring SQL statements in the persistent.xml is deprecated and EB QL should be used instead. In one of the next releases the SQL statements declarations in the persistent.xml will be no longer supported.
I know that the EJB QL syntax is limited, and what we (the EJB Container development) try to do is to enhance the standard EJB QL with additional features, required from our customers.
So if you want your application to be portable, then please use the EJB QL; and report us every feature you need that cannot be expressed by the EJB QL.
Best regards,
Svetoslav
Hi
I'm having problem with my finder method also...
I have a finder with name findByEmpName in which I pass string empname as parameter, for this I have put following in my ejb-jar.xml:
<query>
<query-method>
<method-name>findByEmpName</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql>select object(b) from TestEntityBean b where b.empName like ?1</ejb-ql>
</query>
and inside persistent.xml
<finder-descriptor>
<method-name>findByEmpName</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
<load-selected-objects/>
</finder-descriptor>
but when I use this finder method in my jsp, it return me null (no rows) but corresponding row is present in the database, findByPrimaryKey and create are working fine...
Is any other setting need to be done?? pls help!!
~Raj
Hi Andre,
pls provide some more details about your problem.
rgds
Daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.