Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

createNativeQuery Not Working

okmich-JavaNetJan 16 2008 — edited Jan 16 2008
Good day all,

I have a native query generated for my entitymanager to execute like this
SELECT substr(q.POLICY_NUMBER, 8, 5) AS
quote_payment_id,
  q.policy_number,
  SUM(q.amount) AS
amount,
  q.processed
FROM quote_payment q
WHERE q.processed = 'N'
GROUP BY q.policy_number,
  q.processed
the resultSet returns 2 identical row instead of 2 summary rows.
When I refactored the same application using JDBC in the same method, everything worked fine.

So, the question is what other parameters could make createNativeQuery not work fine? I have tried adding
<property name="toplink.jdbc.native-sql" value="true"/>
to the persistence.xml file but nothing has worked so far.

please, need little enlightenment on this. I am using Toplinks against an Oracle Database

Regards,
Michael
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 13 2008
Added on Jan 16 2008
1 comment
321 views