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!

ADF BC: How to refer to EO attribute in sql query for transient attr 10.1.3

John StegemanSep 28 2006 — edited Sep 28 2006
Hi All,

I have an ADF Entity Object that is based on an Oracle database table. I have a transient attribute that is based on a SQL query expression as well. Let me describe the business case:

This EO shows how the user distributes a check amount over multiple lines in a purchase order. In the user interface, when the end user adds a new check, I create a new Check record in the EO and then add Payment Distribution records for each line of the purchase order. I then display a page that lets the user specify how much of the total check amount is applied to each purchase order line. No problems here at all. My calculated attribute is used to show how much of each purchase order line has been paid for by other checks (not the one currently editted). If this is not a new check (i.e., the record is already in the database), my query works fine. It is not working if the record is new, as my SQL query is trying to join on a record which is not there yet.

What I need to do is to be able to refer to an EO attribute in my query (as opposed to the database column that corresponds to the attribute).

For example, instead of this as my expression:
(select sum(amount) from distributions d2 where d2.po_line_id = distributions.po_line_id and d2.check_id != distributions.check_id)
I want to do something like:
(select sum(amount) from distributions d2 where d2.po_line_id = :myEO.PoLineId and d2.check_id != :myEO.PoLineId)
Is something like this possible, or do I need to write a custom getter for this attribute and do it in code?

Kind regards,

John
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 26 2006
Added on Sep 28 2006
2 comments
542 views