Jdeveloper 12.1.2
Hi. I have a requirement to query a bunch of fields (basically create a query screen). Users select which fields they want. They may want to select the user field and dates between which this person entered data.
I have the code OK for the last name, but how would I handle the between startDateX and endDateX
vcr1.setAttribute("LastName","Hemant");
I need to do this in java.....no other way, thanks!
Thank you,
Stuart
EXAMPLE I found:
public class TestClientViewCriteria {
public static void main(String[] args) {
String amDef = "devguide.examples.readonlyvo.PersonService";
String config = "PersonServiceLocal";
ApplicationModule am =
Configuration.createRootApplicationModule(amDef, config);
// 1. Find the view object to filter
ViewObject vo = am.findViewObject("PersonList");
// Work with your appmodule and view object here
Configuration.releaseRootApplicationModule(am, true);
// 2. Create a view criteria row set for this view object
ViewCriteria vc = vo.createViewCriteria();
// 3. Use the view criteria to create one or more view criteria rows
ViewCriteriaRow vcr1 = vc.createViewCriteriaRow();
// 4. Set attribute values to filter on in appropriate view criteria rows
vcr1.setAttribute("PersonId","> 200");
vcr1.setAttribute("Email","d%");
vcr1.setAttribute("PersonTypeCode","STAFF");
vcr1setAttribute("PersonId","IN (204,206)");
vcr1.setAttribute("LastName","Hemant");
// 5. Add the view criteria rows to the view critera row set
vc.add(vcr1);
// 6. Apply the view criteria to the view object
vo.applyViewCriteria(vc);
// 7. Execute the query
vo.executeQuery();