Dear All,
Regarding the post-query,(using for getting the description field
which is in another table such as viewing the name of department when
there is only department_id in the VO of employee) as you now we have
2 common ways to handle that first is to use two EO that there is an
association between them which one of them is updatable and the other
is just for reference and presenting the description field.
the other ways which of course is not very good is using a transient
field and override the get method for it in order to return the
description.
The way that I want to present is totally different from two mentioned
methods, I have not see this method any where in any
blog,forum,official or unofficial document;So I decided to present
this method and I would be appreciated if you, as a professional
developer, scrutinize this method to give me and others the cons and
pros.
In this method, for any description fields we would add a transient
field in the view ( it is not important that the VO is readonly or is
based on the EO)for example we would add the transient field
testDescription in the VO. next, in the query for the view we need to
change the query (if it is based on the EO we have to choose expert in
the sql mode) and add the blew to the select query
(select descritption form example_table where
example_table.id=
viewquerytable.id) as testDescription
it is obvious that in this way the description would come along with
the query itself so there is not any extra round-trip to DB for
querying the description and also there is no need to add any extra EO
and Association for getting the description field.
I have add a sample,to see it in action (pls use the application
module tester as I have not add any page.)the sample is using the hr
schema.
http://groups.google.com/group/adf-methodology/web/postquerysample.zip
Thanks and regards,
Amir Khanof