Skip to Main Content

Java Development Tools

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!

How to query the database in an Entity Object (EO)

user10660669Oct 18 2012 — edited Dec 19 2012
I am using JDeveloper 11.1.2.2.0

I am Forms developer working in a new ADF project and need some help from the ADF gurus, I am just a ADF beginner.
Maybe hits question has a easy solution, but I don't know how to implement this:

I have simplified my scenario, but this is what I Need to do:
One database table DBTABLE with 3 columns (C1,N1,D1) C1-varchar2; N1-Numeric; D1-Date.
In the DBTABLE I have the following data:
ONE; 10; 01/10/2012
ONE; 20; 02/10/2012
TWO; 15; 02/10/2012
ONE; 15; 03/10/2012

I have created an ADF EO for the DBTABLE with all 3 attributes, then I have created another transient numeric attribute T1.
My requirement is when I create a new record and set attribute C1=ONE the transient attribute T1 should show sum(N1) from DBTABLE where D1>= 01/10/2012 and D1 < 03/10/2012.

In this case when I create a new record should the shown in T1 a total of 10+20 = 30.

I know how to use the EOImpl getters and setters, and how to set the T1 attribute when C1 is set. My problem is how to calculate the total T1.

How can I implement this in ADF? It is possible to implement this in the EO? It is possible to make the query select sum(N1) from DBTABLE where D1>= 01/10/2012 and D1 < 03/10/2012 and return the value to the EO attribute?

Thank you in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 16 2013
Added on Oct 18 2012
5 comments
648 views