Extending default ViewCriteriaAdapter behavior

hi
I am looking for an easy way to change the ViewCriteria behavior for one (type of) field and keep the default behavior for the other fields.
I would like this
vMyViewCriteriaRow.setAttribute("REG_DATE", "05-2005");to result in a where clause fragment like
(REG_DATE >= TO_DATE('01-05-2005', 'DD-MM-YYYY') AND REG_DATE < TO_DATE('01-06-2005', 'DD-MM-YYYY'))or like
(REG_DATE BETWEEN TO_DATE('01-05-2005', 'DD-MM-YYYY') AND (TO_DATE('01-06-2005', 'DD-MM-YYYY') - 1))or something else, for whatever reason
I've read
"Implementing a View Criteria Adapter to Customize Query By Example Functionality"
http://radio.weblogs.com/0118231/stories/2003/07/11/implementingAViewCriteriaAdapterToCustomizeQueryByExampleFunctionality.html
but it doesn't describe how to keep some of the default behavior.
My solution (for now) is based on this article though:
public class DateViewCriteriaAdapter extends OracleSQLBuilderImpl
     public String getViewCriteriaClause(ViewObject pViewObject,
          ViewCriteria pViewCriteria)
          if (pViewCriteria == null || pViewCriteria.size() == 0)
               return null;
          ViewCriteria vModifiedViewCriteria = pViewCriteria;
          StringBuffer vCustomFragment = new StringBuffer();
          if (pViewCriteria.size() == 1)
               vModifiedViewCriteria = pViewObject.createViewCriteria();
               ViewCriteriaRow vModifiedVCRow =
                    vModifiedViewCriteria.createViewCriteriaRow();
               vModifiedViewCriteria.add(vModifiedVCRow);
               ViewCriteriaRow vVCRow = (ViewCriteriaRow)pViewCriteria.first();
               StructureDef vStructureDef = vVCRow.getStructureDef();
               AttributeDef[] vAttributeDefs = vStructureDef.getAttributeDefs();
               for (int i = 0, vLength = vAttributeDefs.length; i < vLength; i++)
                    String vCriteriaAttVal = (String)vVCRow.getAttribute(i);
                    if (vCriteriaAttVal != null && !"".equals(vCriteriaAttVal))
                         String vAttributeFragment = getWhereClauseFragmentForAttribute(
                              vAttributeDefs, vCriteriaAttVal);
                         if (vAttributeFragment != null)
                              appendFragment(vCustomFragment, vAttributeFragment);
                         else
                              vModifiedVCRow.setAttribute(i, vCriteriaAttVal);
          String vDefaultFragment = super.getViewCriteriaClause(
               pViewObject, vModifiedViewCriteria);
          appendFragment(vCustomFragment, vDefaultFragment);
          return "( " + vCustomFragment.toString() + " )";
     private String getWhereClauseFragmentForAttribute(AttributeDef pAttributeDef,
          String pCriteriaAttVal)
          String vCriteriaAttVal = pCriteriaAttVal.trim();
          if (pAttributeDef.getJavaType() == oracle.jbo.domain.Date.class)
          return null;
I'm not really happy with this solution because:
(1) It extends OracleSQLBuilderImpl which extends BaseSQLBuilderImpl for which the API documentation states "Internal: Applications should not use this interface.", so I'm not sure if I'm supposed to extend OracleSQLBuilderImpl.
(2) It only works for ViewCriteria with one ViewCriteriaRow. As this solution depends on a call to super.getViewCriteriaClause(), there is no way to correctly "AND and OR" all (custom and default) fragments together.
my question:
Is this the way to go, or should I use another aproach?
thanks
Jan Vervecken

Thanks for your reply Steve.
It took me a while, but I've been able to get an enhancement request logged for this, see metalink.oracle.com (search bugs for this number):
4651343 : EXTENDING DEFAULT VIEWCRITERIAADAPTER BEHAVIOR
Although I don't know about the other values the "Desirability" attribute of this enhancement request can have, I don't agree with "Somewhat desirable feature".
Because it enables both "productivity" and "choice", I believe it deserves a stronger desirability-status.
greetings
Jan Vervecken

Similar Messages

  • Tab Bar Control and the Default "More" Behavior

    I've got a client who wants an app with 8 tabs. The only problem is that they don't like the default "more" behavior with the tableviewcontroller containing the extra tab content. What they want is to hit "more" to see the next four tabs replace the first four and then to toggle back if it's hit again.
    There are a few ways to do this, I guess. I could build a second viewcontroller/tabcontroller that comes on or leaves when "more" is touched. Is there a surer way of doing this? I'm sure I'm missing something basic, but I've googled my brains out on this one and just can't see it.

    You could use one TabbarController with 8 ViewControllers, and rotate them when the More tab is tapped:
    - (BOOL)tabBarController:(UITabBarController *)tbc shouldSelectViewController:(UIViewController *)vc {
    if (vc == tbc.moreNavigationController) {
    NSMutableArray *newVCs = [[NSMutableArray arrayWithCapacity:8] retain];
    for (int i = 0; i < 8; i++) {
    [newVCs addObject:[tbc.viewControllers objectAtIndex:(i + 4) % 8]];
    tbc.viewControllers = newVCs;
    [newVCs release];
    return NO;
    } else {
    return YES;

  • Default focus behavior in Swing

    I have a JTabbedPane wherein every tab has a variety of fields, including buttons, text areas, text fields, tables, and so on. I wanted to tweak the default focus behavior such that the first text field or the first text area has the focus.
    I used requestFocusInWindow() to set the focus on the first text field I get. This, however, was being overriden at a later stage (I am working on a vast code) and the first component inside a tab is getting the focus.
    Is there any means to override the default focus behavior? I tried writing my own FocusTraversalPolicy but found that that is never used. How does the default focus behavior work? Does it set the focus on the first field it gets or what? And where can I find the code for the same?

    I used requestFocusInWindow() to set the focus on the first text field I get. The requestFocusInWindow() method only works when the GUI is already visible. So I would suggest that you add a ChangeListener to the tabbed pane and add your code to set the focus every time the tab is changed.
    For a slightly different approach the code in this posting will remember the last field for each tab that had focus and reset focus to that field when the tab is changed. The code is not completely off topic since it shows how to use a ChangeListener:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=570369

  • Default button behavior not working with melting group

    Hi,
    I just realize that the default button behavior, i.e. fill out form and press enter without clicking on the actual button, does not work if one or more input form elements are in a melting group. This is a bug, right? I'm using CE7.1 SP5.
    Regards,
    Kevin

    Hi Dharmi,
    I define a button as default, fill out the inputfields  and press enter on the last one. As soon as I put this one in a melting group and press enter, the action of the default button is not triggered anymore. I can press enter in another field which is not in a melting group and the form is submitted correctly.
    I just noticed that if the button is in a melting group (with or without an input field) it doesn't work either.
    Can you reproduce this behavior?
    Best regards,
    Kevin

  • [svn:fx-trunk] 12963: Add IDebuggerCallbacks.terminateDebugTarget(), so that the debugger can override the default termination behavior.

    Revision: 12963
    Revision: 12963
    Author:   [email protected]
    Date:     2009-12-15 10:34:20 -0800 (Tue, 15 Dec 2009)
    Log Message:
    Add IDebuggerCallbacks.terminateDebugTarget(), so that the debugger can override the default termination behavior.
    Modified Paths:
        flex/sdk/trunk/modules/debugger/src/java/flash/tools/debugger/DefaultDebuggerCallbacks.ja va
        flex/sdk/trunk/modules/debugger/src/java/flash/tools/debugger/IDebuggerCallbacks.java
        flex/sdk/trunk/modules/debugger/src/java/flash/tools/debugger/concrete/PlayerSession.java
        flex/sdk/trunk/modules/debugger/src/java/flash/tools/debugger/concrete/PlayerSessionManag er.java

    Gordon, it looks like its been a while since you made this post.  Not sure how valid it is now...   I am particularly interested in the LigatureLevel.NONE value.  It seems that it is no longer supported.
    How do I turn of ligatures in the font rendering?
    My flex project involves trying to match the font rendering of Apache's Batik rendering of SVG and ligatures have been turned off in that codebase.  Is there any way (even roundabout) to turn ligatures off in flash?
    Thanks,
    Om

  • JList keystroke default search behavior - Part 2...

    So, i have a JList with some entries. The default search behavior only works if i first click in the JList. I want it to work by default after the window is created. This is a JList sitting inside a JScrollPane.
    Basically, when the JList comes up I want it to have focus and perform a search the first time i hit a key on the keyboard without having to click in the Component.
    thanks!

    So you want the JList to have focus when the window brings up.
    Have you had a look at the Java tutorial section on [Swing's focus management|http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html] ?
    You can request the focus on the JList in a ComponentListener, added on the JList.

  • Newbie - Default Button behavior

    I am trying to use HTML db to create a new application that will run on LYNX enabled scanners. When the user scans an item into a textbox there is a carriage return that is entered at the end.
    I would like to do one of two things -
    1) On the CR move to the next Text Item or
    2) On CR fire the only button on the page. Kind of like default button behavior in Forms or other PL's.
    Any hints that you could give me would be very helpful.

    Can I automatically go to another page within the application? If so how and where.
    I need to send an onchange from the text field then do I need to create a process to move to the next page?? I am a complete newbie to this so I have no clue. For an example lets say that I have Page1 and Page2 with Text1 on Page1 and Text2 on Page2. Here is the code that I am starting to put in the HTML Table Cell Attributes:
    onchange = 'javascript.dosubmit()'
    Now what do I need to do to change to page 2? Does it need to be a process? and if so what code do I need to put in it and where?
    This is for a Proof of Concept project, we are just trying to see if we can use HTML DB to create RF Scanner application.
    Thanks for your initial reply.

  • Where do I control default Auto behavior of Button.Width and .Height in Visual Basic 2013 designer?

    Why does a Button auto-size itself to completely fill a cell in a Grid if I write the code for it in the .xaml-file but fit to the Button.Content if I drag-and-drop the Button into the Grid from the Controls toolbox? Somehow, the software remembers where
    the Button came from, but I can't see where, and if I look in the Properties window I can see what dimensions it gets from the auto-sizing, but I can't see any options to change the behavior. Apparently I have to hardcode the dimensions of the Button to fix
    it, and that, obviously, is not desirable.
    Incidentally, it seems that if I cut-and-paste the code for a Button from one .xaml-file to another, it behaves as if the component was drag-and-dropped into place, i.e. even if the Button fills out the Grid cell in the source project it wil shrink to fit
    the Button.Content in the destination project.
    Why is this? And where is it that I haven't looked to make the Button behave?
    Thanks in advance

    Hi,
    This is the default behavior in VS. Seems there is no way can control it. May be you can create a custom button to solve your problem.
    Best Wishes!

  • How to get JTable's default TAB behavior and apply it to another key ?

    Is there any way to get Table's default behavior of one key say TAB & apply it to the another key say ENTER?
    Means I want to disable JTable's default behavior of ENTER key & I want ENTER key should act like TAB.

    Take a look at this.
    [http://java.sun.com/products/jfc/tsc/special_report/kestrel/keybindings.html]

  • Default interception behavior of TCP service 61 and 62?

    When using TCP service groups 61 and 62 in WAAS WCCP redirection, is the default behavior to redirect all traffic or only all TCP traffic? I'm using Cat6500 to do L2 redirection and considering using redirect-list to reduce WAE processing load. If all traffic is to be redirected, then I need to exclude VoIP media traffic (UDP) as well. If just TCP is to be redirected, then I don't need to deny UDP in the redirect-list.
    Another question: is it possible to use "ip wccp redirect" for trunk ports in L2 redirection if the switch is Layer 2 only?
    Thanks a lot

    WCCP 61/62 are TCP-promiscuous, this means that All TCP ports will be redirected to WAE. UDP traffic will not be redirected, however please check with your VOIP solution and make sure that phone registration is not on TCP port, if it do then a WCCP flap will cause all phones to re-register in your network.
    WCCP can only be enable on IPV4 / Layer 3 enable interface, so a Trunk port with dot1q truning with no ip on it will not redirect any packets.
    Hope this helps.
    Ahsan

  • Change in Default Workbook Behavior with NW04s

    We are upgrading from BW 3.x to BI.  We use BEx workbooks exclusively.  With 3.x, our query designers would create/edit a query through BEx Analyzer and the results would be shown in a workbook taken from the default workbook template.  If the query needed further editing, it could be edited and the new results shown in the same workbook.  This is what we are comfortable doing.
    With 04s, if I run Query designer from within BEx analyzer, the created/edited query is not automatically "inserted" in the default workbook.  I understand that I can add an analysis grid and define the query as a data provider, but this has to be done EVERY time the query is edited.  I've added an analysis grid to the default workbook, but still the query has to be defined as a data provider every time it is edited. 
    Is this a problem for any one else?  Do I just have to live with defining the data provider over and over again?  How is it that if I use the SAP Standard as the default workbook, when I open a query, I don't need to define the query as a data provider?

    Thank you for the reply.  However, if I have an analysis grid in the default workbook, and I select Open Query, it doesn't automatically set up the selected query as the data provider.  I have to go in and create a data provider.  At that point, I can pick any query.
    I can't set up a data provider in the default workbook, because each time I open a different query, the data provider will have to change.
    If I use the SAP default workbook and select Open Query, it associates the selected query with the data provider automatically.  I'd like the same kind of behavior, but with my default workbook.

  • Changing OS X's default "Find" behavior

    Is there a way to change the Finder's "Find" behavior so it DOES NOT automatically / immediately start searching your hard drive(s) and volumes as soon as you begin typing a term in the search field? I'd like to disable this feature if possible.

    3rd party tools and copying and pasting
    are not really that desirable.
    You can use Automator to do most of the work for you.
    Open Automator and drag the following Actions to the right-hand side workflow pane, in this order:
    1) Ask for Text -- The purpose of this action is to create a dialog box into which you'll enter your search term. In the upper field (pre-populated with the word "Question"), enter a text query appropriate to the task at hand, "Search for..." or "Search Spotlight..." for example. Leave the Default Answer field blank.
    2) Copy to Clipboard -- Copies the text you entered in the dialog box to the Clipboard.
    3) Spotlight -- Opens Spotlight automatically. Make sure to check "Show Action When Run" under Options. At this point you need only paste into the Spotlight search field and Spotlight will begin searching.
    Test the Automator workflow by selecting Workflow > Run; when you find it works properly, File > Save As an Application.
    While it would be ideal if in step 3 Spotlight would open with the search term already populated, thus making pasting unnecessary, I haven't found a way. However, there is a 3rd-party application called Laserlight 2.0.3 which will do just that. Good luck!
    Regards, Andrew99
    iMac 1 GHz Flat Panel 15" PPC 768 MB RAM   Mac OS X (10.4.10)  

  • Extending Default Tablespace in Production!

    Hi all,
    How would I extend a default tablespace in a production environment? Please advise.
    Thanks.

    sorry , forgot an OR :
    Hi,
    the tablespace is created automatically in either DB_CREATE_FILE_DEST
    OR where you have specified.
    If you have specified DB_CREATE_FILE_DEST then you use OMF (Oracle managed files)
    which will be created with an initial size of 100m and autoextend on with maxsize unlimited.
    Look at your datafiles:
    SQL> SELECT name FROM v$datafile;
    SHOW PARAMETER DB_CREATE_FILE_DEST
    Hope this helps.
    Regards,
    Lutz

  • Extending default UIX renderers

    Is there any way to extend a default UIX renderer?
    Note that I don't mean extend UIX by implementing my own renderer; I've read the docs regarding that but they don't address the extension of an existing "stock" renderer.
    For example, to derive subTabBar or inlineDatePicker etc... I know simple things like the colour and font can be changed via styles but I can't change the core rendering that way (even in a very small way).
    Thanks in advance!

    Thanks for the reply...
    How do I know what is part of the public API? I have taken a look at the new "Hosted JDeveloper Online Help" - 10g (9.0.5.1) to be exact - which was released this AM on Oracle JDeveloper News RSS thread ( http://helponline.oracle.com/jdeveloper/help/state?navSetId=jdeveloper&navId=0&destination= ) and most of the links in the reference section point to an API prefixed w/ oracle.bali; is this what is considered the public API or did I miss another reference?
    Thanks again for your time!

  • PS CS4 Extended: Default texture aspect ratio on standard shapes

    Hi,
    I want to design a cover for the default soft drink can 3D model. I create a 3D layer from a 2D standard layer. However I cannot find out the aspect ratio for the standard texture applied to the can's surface in order to be able to produce a cover without any distortions. Where can I find this information OR the default textures?
    Thanks. I am desperate finding an answer... :(

    The distortion information should come from whomever is in charge of printing the cans.

Maybe you are looking for

  • How can I match tempo & sync of old audio files to Garageband?

    HI all, Final question and it's a doozy. While I know the "general concepts" for trying to accomplish the following, acutally trying to get it to work is frustrating. At first thought that the new Garageband tempo/playing thing would work but I'm not

  • Error message while executing a SWF File

    Hi All, Iam trying to execute a SWF file which has its actionscript written in AS3. When i execute this, I am getting an error message which is as follows Verify Error 1030# Stack Depth unbalanced 1 != 0. Can anyone tell me what could be the root cau

  • Standard SAP reporting

    I have a requirement to find a report that shows a breakdown of 3rd party costs, I have created in a condition record. I have created a BOM. The BOM at header level is relevant for pricing and billing. The sub-boms are just relevant for statistical p

  • Pro's and con's of creating an entire web page with Edge?

    I was just curious if anyone else had thought about this? along this line of thinking, I noticed that in hte preview versions of Edge, you added the "text" of the animation directly into the web page your animation was in.  Now, it is all kept outsid

  • HT3924 How would this apply if you have a MacBook Pro Retina, 13-inch, Late 2012?

    How could I use my iMac 27" Mid 2010 as an external monitor for my MacBook Pro Retina, 13-inch, Late 2012? I have an HDMI to HDMI but nothing happens.