How can you add a where clause using "OR" with applied ViewCriteria?

[JDeveloper 10.1.3 SU4]
[JHeadstart 10.1.3 build 78]
I am using JHeadstart, but have a question probably more in the ADF area. On the JHeadstart forum I asked:
"I am overriding JhsApplicationModule's advancedSearch in order to be able to search in childtables. I created transient attributes, display those in advanced search and in the overridden method I check if any of these are filled by the user and create a where clause like 'EXISTS (SELECT 1 FROM <childtable> WHERE <column in childtable> = <column in EO's table> AND <another column in childtable> LIKE '<value supplied by user>)'. I add this whereclause using ViewObject.setWhereClause.
So far so good and it works. However, if the user selects 'Result matches any criteria', combining setWhereClause and the normal advancedSearch QueryByExample implementation using ViewCriteriaRow do not provide the desired result, since the ViewCriteria and the setWhereClause are AND-ed together, which is fine if the user selects the (default) "Results match all criteria" (everything is AND-ed) but not the "Result matches any criteria", since then every criterium is OR-ed together, except for the setwhereclause criteria and the set of ViewCriteriaRows, they are AND-ed.
I looked if I could specify that a WhereClause will be OR-ed to existing applied ViewCriteria, but no luck. Do I have to rewrite also advancedSearch's ViewCriteria implementation and write an entire setWhereClause implementation to be able to "OR" every criterium? Or any other suggestions? Can I look at the entire Where clause and rewrite it (after applyCriteria and setWhereClause are called on the VO)?
Toine"
Sandra Muller (JHeadstart Team) told me today: "This sounds like a JDeveloper/ADF issue that is not related to JHeadstart. The question is: how can you add a where clause using "OR" if there are already one or more ViewCriteria applied?
To simplify the test case, you could create a simple ADF BC test client class in a test Model project without JHeadstart (in the test class, use bc4jclient + Ctrl-Enter), in which you first apply a few ViewCriteriaRows to a View Object and also add a where clause.
Can you please log a TAR at MetaLink ( http://metalink.oracle.com/ ), or ask this question at the JDeveloper forum at http://otn.oracle.com/discussionforums/jdev.html ? (This what I am doing now ;-))
Thanks,
Sandra Muller
JHeadstart Team
Oracle Consulting"
Anyone knowing the answer or am I asking for an enhancement?
Toine

Hi,
Can you SET your whereclause as follows ?
('Y' = <isAnd>
and EXISTS (SELECT 1 FROM <childtable> WHERE <column in childtable> = <column in EO's table> AND <another column in childtable> LIKE '<value supplied by user>))
OR ('N' = <isAnd>
AND EXISTS (SELECT 1 FROM <childtable> WHERE <column in childtable> = <column in EO's table> OR <another column in childtable> LIKE '<value supplied by user>))
)

Similar Messages

  • How can you add a 2nd i Tunes account on the same computer?

    How can you add a 2nd i Tunes account to the same computer?

    I had an application where I spawned (= ran with Start Asynchronous Call) multiple (reentrant) copies of VIs, and would occasionally "lose control" of them.  I needed a way to find all VIs that were running "Top Level" and stop them (so I didn't have to log off from Windows).
    I used the Application Property "All VIs in Memory" to get an array of (wait for it ...) All VIs in Memory.  I took each name, opened a VI reference to it (simply wire the name string in, as the VI is, by definition, "in memory"), looked at its VI Execution State, and if it was Run Top Level, Invoked the FP.Close and Abort VI Methods.  [To prevent the VI that did all this from "committing Suicide", I compared the name string with the current Call Chain, and did nothing if there was a match].
    I think you could adopt this idea to do what you need.
    BS

  • How can I add a hyperlink to a PDF with OSX 10.9? The "Help" article says to use the "add link" feature under "edit." It's not there.

    How can I add a hyperlink to a PDF with OSX 10.9? The "Help" article says to use the "add link" feature under "edit." It's not there. I could add links w/ the previous OS. Time sensitive project.

    Which application are you using?
    Clinton

  • HT5649 how can you add a previous playlist from a different apple Id  both belong to the same person

    how can you add a previous playlist form a different apple ID, both belong to the same person

    It's ok to share the same AppleID for iTunes.  Use Separate ID's for iCloud, iMessage, and Facetime. 

  • How can you keep your iPhone 4 (using it as my car's iPod) staying on the Audible app?  When I leave the car and return to continue hearing a book, it has switched to iTunes.

    How can you keep your iPhone 4 (using it as my car's iPod) staying on the Audible app?  When I leave the car and return to continue hearing a book, it has switched to iTunes.

    The first time an iPhone is connected to iTunes that is used to sync with another iPhone or iOS device, you are prompted to transfer the backup for the other iPhone or iOS device or to set up the iPhone as a new iPhone.
    The former does as provided - it transfers the backup for the other iPhone or iOS device to the iPhone replacing all data on the iPhone that is included with the backup being transferred. The latter does nothing allowing you to make your various selections for the iPhone sync preferences with iTunes.
    This is designed to be done right away with a new iPhone.
    If you don't have a backup for the iPhone with iTunes on your computer and don't have an iCloud backup that hasn't been updated since choosing to transfer the backup for your iPod Touch to the iPhone, the data that was on the iPhone is gone.

  • I have an ipod touch and the contacts icon is missing.  How can you add it to the home screen?

    I can't find the contacts icon... How can you add this to the home screen

    Every iPod touch has a contacts icon. It might be hiding. You can try Settings > General > Reset > Reset Home Screen Layout.

  • How can you add an image in Mail without being an attachment?

    How can you add an image in Mail without being an attachment?
    In otherwords I'd like to put my logo in the email not as an attachment but as an image.
    Is there a simpel solution to this problem?

    PBN1 wrote:
    How can you add an image in Mail without being an attachment?
    You don't.
    It's not possible. The e-mail protocol is designed for text; anything else has to go as an attachment.
    Different mail clients (such as Mail.app, the mail client bundled with Mac OS X) may have different ways of handling such attachments, but they are still attachments. Each mail client has its own rules and methods, so one may display a picture as if it were in the body of the message, but another client may do something completely different.
    A way of faking it is to format your message in HTML (which is a kind of text). The image is hosted on a remote server, not added to the message; instead, you include a link to it in the body of the message, as you would when building a web page. (This is also what the two tips helpfully provided by X423424X do, except that the link to the image is added in the signature, rather than the body of the message.) What exactly happens to it is, again, at the discretion of the mail client. In my case, for instance, displaying images in HTML messages is turned off, and will stay resolutely off.

  • HT5622 how can you add a group to contacts to email or message?

    How can you add a group to your contacts to email or message a group?

    There are example OMB commands in the MDL referenced in the post below;
    http://blogs.oracle.com/warehousebuilder/newsItems/viewFullItem$198
    Look at the body of the expert you will see examples of creating joiners, filters, aggregators, constants etc all via OMB.
    Cheers
    David

  • HT201320 How can you add an email address in your email box in an ipad

    How can you add your e-mail address in you iPad mail box?
    Rita

    Go to settings.app -> mail, contacts, calendars-> click "add account"
    Hope this helped

  • How can you get your facebook pictures to sync with your contacts?, HOW Can you get your facebook pictures to syncwith your contacts?

    How can you get your facebook pictures to sync with your contacts?

    take a look at the link
    http://www.iphonestuffs4u.com/how-to-sync-facebook-contacts-to-iphone/

  • Once made a selection in photoshop how do you export in Illustrator and use it with a cutting plotte

    once made a selection in photoshop how do you export in Illustrator and use it with a cutting plotter?

    Plotters require continuous paths. Convert the selection to a path and clean it up suitably. Copy&paste it to Illustrator and use it as a clipping mask on your artwork or whatever. You may also need to create a duplicate layer/ separate PDF file file. Talk to the people doing the plotting.
    Mylenium

  • How can you keep music in iTunes in sync with 2 Mac's?

    How can you keep music in iTunes in sync with 2 Mac's?

    There are some third party applications designed to do this. Have a look at this one for instance and see what you think: syncOtunes

  • HT5012 How can you add a self signed CA Certificate to iOS 8?

    How Can I add a self signed CA Certificate to an iPad with iOS 8.1?

    I don’t think that I can help you but I am very interested in your question. Perhaps you have seen information about a related problem…
    https://discussions.apple.com/thread/6590335
    One way to install the self-signed CA certificate is to export it to a .CER file, email it to the iOS 8 device, open the attachment and process it. My guess is that the certificate will be installed (check the resulting profile) but due to an iOS 8 bug it will be ineffective.
    Or, you could send a signed email from the email account for the CA. Open the email on the iOS 8 device and process it.
    I assume your goal is for certificates issued by the CA to be automatically trusted on the iOS 8 device. Good luck with that.
    The method I used was to send a .CER file. The CA certificate showed up as a profile. However, I do not get automatic trusting of certificates issued by the CA.

  • How can you add images and text to UIScrollBar Component

    I can only add the text, can't add images. Also how can you make paragraphs out of long text in a UIScrollBar?
    Thanks.

    Hi,
    UIScrollBar Component can be attached to a dynamic text filed and the text field can be set to Render Text as HTML option which in turn can display both text & images(using <img> tags).
    Refer http://www.flashvalley.com/fv_tutorials/loading_HTML_in_a_dynamic_text_field/page2.php that may help you getting what do you want
    Thanks!

  • How can you determine what imports to use

    In the examples in the UIX Developers guide, a number of pieces of Java code are given but without the necessary import statements. When I copy them into JDeveloper and try and compile, a number of compilation errors are given becuase some of the classes can not be found. I presume I need some import statements in the Java code. How can I find out where the class is located to know what import statement to use ?
    eg...MyClass.handleStoreNameEvent - cannot find class StateManager; cannot find class MutableState
    Thanks
    Brent

    Brent -
    I'm not sure whether this is the most convenient solution, but I usually look up classes in the JavaDoc reference to find their packages. In JDev 9.0.3, you can find the JavaDoc documentation for the UIX classes in the help system under the Reference -> UIX Reference. Click on the "FRAMES" link to see a list of all classes - and from there you should be able to find the JavaDoc for each class, which includes the package name.
    Andy

Maybe you are looking for