cancel
Showing results for 
Search instead for 
Did you mean: 

select * from <table>

Former Member
0 Kudos

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é

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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é

SvetoManolov
Employee
Employee
0 Kudos

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

Former Member
0 Kudos

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

Vlado
Advisor
Advisor
0 Kudos

Hi,

Please follow the discussion in

Best regards,

Vladimir

Former Member
0 Kudos

Hi Andre,

pls provide some more details about your problem.

rgds

Daniel