Problem with outer joins and the class indicator/discriminator

Hello,
I am having a problem defining a query in toplink (10.1.3.3).
In the workbench, I have created a parent and 2 child descriptors. The parent is "AbstractValue", the children are "DefaultValue", classified by the discriminator 'DEF', and "OverrideValue", classified by 'OVR', both located in the same table.
Another descriptor (containing a one-on-one mapping to both a "DefaultValue", and a "OverrideValue") needs to be queried for its 'value'.
The way the query should act is: If an override value (row) exists, this one applies for that object. If an override doesn't exist, return the default value.
The query then comes down to (as I have it now):
builder.getAllowingNull("OverrideValue").getAllowingNull("value").ifNull(builder.get("DefaultValue").get("value")).equal(builder.getParameter(VALUE_PARAM));
The problem is that toplink adds the distinction for the different kind of "values" in the where clause WITHOUT checking for null values e.g. it performs an outer join, but then still checks for the discriminator value thus
....t1.ovr_id = t2.id(+) AND t2.discriminator = 'OVR' AND ...
instead of
... LEFT JOIN values t2 ON (t1.ovr_id = t2.id AND t2.discriminator = 'OVR') ...
This leads to the behaviour that the query returns ONLY the objects that have override and default values.
An overview of the queries (simplified)
Toplink, at the moment, returns only results if both override and default values exists:
SELECT t1.id
t1.def_id,
t1.ovr_id
FROM values t2,
parameter t1,
values t0
WHERE nvl(t2.value, t0.value) = 15 AND
t1.ovr_id = t2.id(+) AND t2.discriminator = 'OVR' AND
t1.def_id = t0.id AND t0.discriminator = 'DEF'
Situation Wanted:
SELECT t1.id
t1.def_id,
t1.ovr_id
FROM parameter t1
LEFT JOIN values t2 ON (t1.ovr_id = t2.id AND t2.discriminator = 'OVR')
JOIN values t0 ON (t1.def_id = t0.id AND t0.discriminator = 'DEF')
WHERE nvl(t2.value, t0.value) = 15
Anyone know if there is some statement I am missing to allow an actual outer join on descriptors containing class indicators/discriminators? A possible rewrite?
Thanks in advance,
Rudy

This is a bug in TopLink's outer join support for Oracle. Currently the outer join is put in the where clause, instead of the from clause, as we do on other platforms. You might be able to fix it by changing your OraclePlatform to return false for shouldPrintOuterJoinInWhereClause().
Please log this bug on EclipseLink, or through Oracle technial support.
There is a workaround using,
descriptor.getInhertiancePolicy().setAlwaysUseOuterJoinForClassType(true);
James : http://www.eclipselink.org

Similar Messages

  • Hi i have i problem with my iphone and the problem is the security question i have forgot the answers

    Hi i have i problem with my iphone and the problem is the security question i have forgot the answers
    I understand German and Italian i littlebit English

    You need to ask Apple to reset your security questions; this can be done by phoning AppleCare and asking for the Account Security team, or clicking here and picking a method, or if your country isn't listed in either article, filling out and submitting this form.
    They wouldn't be security questions if they could be bypassed without Apple verifying your identity.
    (106626)

  • Had a problem with newest update and the advice from turingtest2 resolved my problem just to say thanks! Had never used this route before so was less painful than thought it would be again thanks.

    Had a problem with newest update and the advice from turingtest2 resolved my problem just to say thanks! Had never used this route before so was less painful than thought it would be again thanks.

    how can i find out what the fix is that works..please

  • The email address connected to an old itunes account is no longer active. Can't access music i bought many years ago with out it and the old password.

    the email address connected to an old itunes account is no longer active. Can't access music i bought many years ago with out it and the old password.

    neilfromvancouver wrote:
    the email address connected to an old itunes account
    Old iTunes account?
    You created a new iTunes account instead of updating the old account with new info?'
    Contact iTunes support.

  • Problem with outer join with filter on join column

    Hi,
    In physical layer I have one dimension and two facts, and there's an outer join between the facts.
    dim_DATE ,
    fact_1 ,
    fact_2
    Joins:
    dim_DATE inner join fact_1 on dim_DATE.DATE = fact_1.DATE
    fact_1 left outer join fact_2 on fact_1.DATE = fact_2.DATE and fact_1.SOME_ID = fact_2.SOME_ID
    When I run a report with a date as a filter, OBIEE executes "optimized" physical SQL:
    select fact1.X, fact2.Y
    from
    Fact_1 left outer join on fact_1.DATE = fact_2.DATE and fact_1.SOME_ID = fact_2.SOME_ID
    where Fact_1.DATE = TO_DATE('2009-05-28' , 'YYYY-MM-DD' )
    and  Fact_2.DATE = TO_DATE('2009-05-28' , 'YYYY-MM-DD')
    The filter on Fact_2.DATE effectively replaces outer join with inner.
    Is there a way to disable this "optimization", which is actually very good for inner joins, but doesn't allow outer joins?
    Thanks in advance,
    Alex
    Edited by: AM_1 on Aug 11, 2009 8:20 AM

    If you want to perform a Fact-based partitioning with OBIEE (two fact with the same dimension), you have to :
    * create in your physical layer for each fact table the joins with the dimension
    * create in the Business Model layer ONE star schema with ONE logical fact table containing the columns of your two physical fact table
    In this way when you choose minimal one column of your fact1 and one column of your fact2, OBIEE will perform two query against each fact table/dimension, join them with an OUTER JOIN and your problem will disappear.
    Cheers
    Nico

  • Problem with iTunes Match and the song "This will be (an everlasting love)" from Natalie Cole

    Hello,
    I'd like to report a problem with iTunes Match and Natalie Cole's song "This will be (an everlasting love)".
    When I stream it or download it on another device I don't get Natalie Cole's song but another one from Maxine Nightingale (Right back where we started from).
    Please tell me if you have the same problem or how I can report this problem to apple.
    Thank you.

    Hi,
    This is a user to user forum - not Apple. Contact them http://www.apple.com/support/itunes/contact/
    Alternatively if the song was purchased from iTunes, you may be able to report the problem by signing into you iTunes account on your computer. Report an problem with an item you bought from the iTunes Store, App Store, Mac App Store, or iBooks Store
    JIm

  • Problems with tethered capture and the 4.2 update

    I'm having problems with tethered capture and my canon 1ds mark III since I updated to 4.2. Is anybody else having issues with tethered capture that was working fine before the update?

    http://forums.adobe.com/community/search.jspa?peopleEnabled=true&userID=&spotlight=false&c ontainerType=14&container=3316&rankBy=date&q=4.2+tethering

  • Rewrite the query with out joins and group by

    Hi,
    This was an interview question.
    Table Names: bookshelf_checkout
    bookshelf
    And the join condition between these two tables is title
    We need to rewrite below query without using join condition and group by clause ?
    SELECT b.title,max(bc.returned_date - bc.checkout_date) "Most Days Out"
               FROM bookshelf_checkout bc,bookshelf b
               WHERE bc.title(+)=b.title
               GROUP BY b.title;When I was in college, I read that most of the SELECT statements can be replaced by basic SQL operations (SET OPERATORS). Now I am trying to rewrite the query with SET operators but not able to get the exact result.
    Kindly help me on this.
    Thanks,
    Suri

    Something like this?
      1  WITH books AS (
      2  SELECT 'title 1' title FROM dual UNION ALL
      3  SELECT 'title 2' FROM dual UNION ALL
      4  SELECT 'title 3' FROM dual ),
      5  bookshelf AS (
      6  SELECT 'title 1' title, DATE '2012-05-01' checkout_date, DATE '2012-05-15' returned_date FROM dual UNION ALL
      7  SELECT 'title 1' title, DATE '2012-05-16' checkout_date, DATE '2012-05-20' returned_date FROM dual UNION ALL
      8  SELECT 'title 2' title, DATE '2012-04-01' checkout_date, DATE '2012-05-15' returned_date FROM dual )
      9  SELECT bs.title, MAX(bs.returned_date - bs.checkout_date) OVER (PARTITION BY title) FROM bookshelf bs
    10  UNION
    11  (SELECT b.title, NULL FROM books b
    12  MINUS
    13* SELECT bs.title, NULL FROM bookshelf bs)
    SQL> /
    TITLE   MAX(BS.RETURNED_DATE-BS.CHECKOUT_DATE)OVER(PARTITIONBYTITLE)
    title 1                                                           14
    title 2                                                           44
    title 3Lukasz

  • Problem with outer join/insert

    I created a test case in scott schema that describes my problem. I use emp table, and I want to have one more table - emp_info - that will store some additional info about employees. Not every employee will have additional info. I can't add a field to emp table - this has to be in an additional table.
    I want to display all the emp's in a swing table, and an info if it exists - of course, using outer join. Further more, I want users to be able to enter info in this same table. If info already exists in the emp_info it will be updated, if not a new record is created.
    I hope you get the picture.
    So, emp_info table is:
    create table emp_info(empno number(4), info varchar2(10))
    ALTER TABLE "SCOTT"."EMP_INFO"
    ADD (CONSTRAINT "PK_EMP_INFO" PRIMARY KEY("EMPNO"))
    ALTER TABLE "SCOTT"."EMP_INFO"
    ADD (CONSTRAINT "FK_EMP_INFO_EMP" FOREIGN KEY("EMPNO")
    REFERENCES "SCOTT"."EMP"("EMPNO"))
    In Jdev I create entitiy objects for emp and emp_info, and create View object 'ViewOuter' using these two entities. emp is updatable and empinfo is updatable and reference.
    SQL query for the view object is:
    SELECT Emp.EMPNO, Emp.ENAME, Emp.JOB, Emp.MGR, Emp.HIREDATE,
    Emp.SAL, Emp.COMM, Emp.DEPTNO, EmpInfo.EMPNO AS EMPNO1,
    EmpInfo.INFO
    FROM EMP Emp, EMP_INFO EmpInfo
    WHERE Emp.EMPNO = EmpInfo.EMPNO(+)
    I changed View row class of the ViewOuter view:
    public void setInfo(String value) {
    if (getEmpno1()==null) {
    setEmpno1(getEmpno());
    setAttributeInternal(INFO, value);
    Now I create the table in swing. It works fine - if a user changes info, new record is created or existing updated etc. There is only one problem:
    If I change info on an employee, and then requery the view without commiting to the database, I don't see this info. If I try to change it, I get error
    (oracle.jbo.TooManyObjectsException) JBO-25013: Too many objects match the primary key oracle.jbo.Key[7499 ].
    It seams that the new info is cached, but requerying the view didn't pick it up. And when it creates new row for info PK is violated.
    How can I avoid this?

    I set up the primari key for emp_info like this:
    public void setInfo(String value) {
    if (getEmpno1()==null) {
    setEmpno1(getEmpno());
    setAttributeInternal(INFO, value);
    It's set when the user enters info.
    What is the difference between transaction.commit and transaction.postChanges?
    Posting changes looks like good temp solution. How can I change view object, so it calls postchanges before executing query? Since I can do requery on multiple places in application, this should be handled by the view itself.
    Is there any better way?

  • Problem with final variables and inner classes (JDK1.1.8)

    When using JDK1.1.8, I came up with following:
    public class Outer
        protected final int i;
        protected Inner inner = null;
        public Outer(int value)
            i = value;
            inner = new Inner();
            inner.foo();
        protected class Inner
            public void foo()
                System.out.println(i);
    }causing this:
    Outer.java:6: Blank final variable 'i' may not have been initialized. It must be assigned a value in an initializer, or in every constructor.
    public Outer(int value)
    ^
    1 error
    With JDK 1.3 this works just fine, as it does with 1.1.8 if
    1) I don't use inner class, or
    2) I assign the value in initializer, or
    3) I leave the keyword final away.
    and none of these is actually an option for me, neither using a newer JDK, if only there is another way to solve this.
    Reasons why I am trying to do this:
    1) I can't use a newer JDK
    2) I want to be able to assign the variables value in constructor
    3) I want to prevent anyone (including myself ;)) from changing the value in other parts of the class (yes, the code above is just to give you the idea, not the whole code)
    4) I must be able to use inner classes
    So, does anyone have a suggestion how to solve this problem of mine? Or can someone say that this is a JDK 1.1.8 feature, and that I just have to live with it? In that case, sticking to solution 3 is probably the best alternative here, at least for me (and hope that no-one will change the variables value). Or is it crappy planning..?

    You cannot use a final field if you do not
    initialize it at the time of declaration. So yes,
    your design is invalid.Sorry if I am being a bit too stubborn or something. :) I am just honestly a bit puzzled, since... If I cannot use a final field in an aforementioned situation, why does following work? (JDK 1.3.1 on Linux)
    public class Outer {
            protected final String str;
            public Outer(String paramStr) {
                    str = paramStr;
                    Inner in = new Inner();
                    in.foo();
            public void foo() {
                    System.out.println("Outer.foo(): " + str);
            public static void main( String args[] ) {
                    String param = new String("This is test.");
                    Outer outer = new Outer(param);
                    outer.foo();
            protected class Inner {
                    public void foo() {
                            System.out.println("Inner.foo(): " + str);
    } producing the following:
    [1:39] % javac Outer.java
    [1:39] % java Outer
    Inner.foo(): This is test.
    Outer.foo(): This is test.
    Is this then an "undocumented feature", working even though it shouldn't work?
    However, I assume you could
    get by with eliminating the final field and simply
    passing the value directly to the Inner class's
    constructor. if not, you'll have to rethink larger
    aspects of your design.I guess this is the way it must be done.
    Jussi

  • Tabular form from query with outer join destroys the universe!

    Well, maybe just my app...
    At any rate, what I have is a query that pulls RISKS for a project and does a reasonable outer join which joins the latest value from a RISK_HISTORY table. Values for RISK are updated and the value for RISK_HISTORY is changed and a new entry added to the RISK_HISTORY table.
    At least that's how it's supposed to be.
    I was able to do this with a report-with-a-form region by adding an extra update process to do a new insert into RISK_HISTORY but it seems that the tabular form is a bit more work.
    Here's the query I'm using:
    select * from(
    select
    r.RISK_SEQ RISK_SEQ_DISPLAY,
    r.RISK_PRIORITY,
    r.RISK_INFO,
    r.RISK_MITIGATION,
    r.ONGOING_FLAG,
    r.RISK_DATE,
    r.WEEK_GROUP_SEQ,
    r.CREATED_ON,
    r.CREATED_BY,
    r.LAST_MODIFIED_ON,
    r.LAST_MODIFIED_BY,
    rh.STATUS,
    row_number() over (partition by rh.risk_seq order by rh.last_modified_on desc) rn
    from RISK r, WEEK_GROUP w, RISK_HISTORY rh
    where w.PROJECT_SEQ=43
    and r.week_group_seq= w.week_group_seq
    and w.week_index=0
    and rh.RISK_SEQ = r.RISK_SEQ
    ) where rn = 1
    Clicking "Add Row" gets me this:
    Error in mru internal routine: ORA-20001: no data found in tabular form
    Running debug doesn't seem to expose much for me either. Is there a better tact for me to take here?
    Thanks,
    Jon

    Hi Prazy,
    using nvl also didn't solve my problem.Actually my problem is I am having a table a in which I have a column called satus, status has the values like A or I .I have one lookup called MTH_BUYSINESS_FUNCTION in which for lookup_code A I have menaing as Active and for lookup_code I meaning is Inactive.Now in table a for sttaus I have two values one A and one null Now I want to write sql which displayes the meaning for column staus.Result should be Active and null .If I am uisng 1 query which I gave u I am not able to get the 2nd row in my output.If I use 2nd query then I get duplicate rows.
    Thanks ,
    Amrit

  • Performance problems with external sounds and Sound class

    I'm using Sound & SoundChannel classes to load and play external MP3s and I'm seeing terrible playback performance on my 3G phone. Audio starts out ok, but will gradually get more and more choppy and eventually crashes the app. The MP3s themselves are typical sizes, 2 - 6 MB and of various types (VBR, CBR).
    On top of that, when the phone gets locked (with the app still running), the audio sputters and stops completely. When I unlock, it begins where it left off. Anyone else seeing this?
    My code is pretty standard:
    private var soundPlayer:Sound;
    private var soundChannel:SoundChannel;
    public function load(url:String, playNow:Boolean = true):void {
      if (soundChannel) {
        soundChannel.stop();
      soundPlayer = new Sound();
      soundPlayer.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
      soundPlayer.addEventListener(ProgressEvent.PROGRESS, onProgress);
      soundPlayer.addEventListener(Event.ID3, onID3);
      trace('Loading new stream: '+url);
      var request:URLRequest = new URLRequest(url);
      soundPlayer.load(request);
      if (playNow) {
        this.isPlaying = true;
        soundChannel = soundPlayer.play();
        soundChannel.addEventListener(Event.SOUND_COMPLETE, onSoundComplete);

    this is from another forum (http://discussions.info.apple.com/thread.jspa?threadID=2542931&tstart=0&messageID=12106188 ):
    "I've spoken to the developers of of couple of these apps, and they've all said it's a memory fragmentation/low memory condition.
    Restart the phone. Don't just turn it off and on, but restart it.
    Hold the on/off button and the home button down like you were going to turn it off. When you see the swipe to turn off message, keep holding the buttons down.
    In a few seconds the screen will flash, and then go dark.
    Now it's really off.
    Turn it back on (restarting it). All should be well.
    The iPhone is really a computer. Performing a restart like this every  once in a while (weekly, bi-weekly) is a good idea, esp if you use  memory intensive apps."
    coop

  • Problem with lenovo t60 and the vga output

    I have a problem with the vga output and the lenovo t60
    When i put the videoprojector connector in to the lenovo t 60, the projector reponde is:
    Not supported
    H: 48.20khz   v: 143,10 hz
     On my desktop pc the projector function on 1024x768 resolution and the 60 hz to refresh.
    The same configurations are on my laptop and the projector doesn't function
    Please help me.

    I too have this problem. My T61 worked fine for about a year, and then suddenly would no longer project. I had made no changes to the settings for the external display, though since the problem started I've tried many combinations without success. Typically the projector reports that the frequency settings the laptop is sending are unsupported. In my case the vertical rate is usually correct (60 Hz) but the horizontal rate varies wildly.
    I suspect a hardware problem, as this post suggests: http://www.edugeek.net/forums/av-multimedia-relate​d/32128-laptop-wont-display-projector.html. (Note the message claiming that 6 out of 40 Lenovo laptops exhibited this problem.)
    Since my system is still under warranty I guess I'll have to get it repaired, but I'd rather hear of a software fix...

  • Wee Problem with Parallels Desktop and the Westmere Mac Pros

    Just got my new Westmere 8-Core Mac Pro last Friday, and spent the last four days in agony.
    I used Migration Assistant to transfer over my accounts from my old Mac Pro, but it crashed hard -- so hard that I had to reformat the hard drive and do a clean install of the system. So I decided to do a clean install of all of my programs as well, and the Westmere crashed on the Parallels Desktop installation. And, again, it crashed so hard that I had to reformat the hard drive and do a clean install of everything all over again.
    Today, I read a review of the Westmere Mac Pros in Macworld (http://www.macworld.com/article/153704/2010/08/quad8_core_macpro_2010.html?lsrc=top2), and learned:
    We ran into a problem running Parallels on the Westmere-based Mac Pros, so we could not complete the Speedmark 6 suite of tests. When booted into 64-bit mode (as the new Mac Pros do by default) the systems would crash with Parallels installed. Booting into 32-bit mode would allow the systems to start up, but we still couldn’t use Parallels. We eventually tried a complete wipe and reinstall from the Mac Pro’s systems disc and downloaded the very latest version of Parallels to eliminate any other potential problems, and had the same issue. Apple and Parallels are aware of the problem and assure me that Parallels is working diligently on a fix. The application worked just fine on the new quad-core Mac Pro with the Nehalem processor.
    Hoped I saved somebody some time.

    Hi akapod,
    Looks like they may have the fix out.
    Mac Pro (Mid 2010): Kernel panic when installing or restarting Parallels Desktop 5 for Mac
    Please let me know if it's available and fixes it.
    Thanks,
    ivan

  • Problem with tab bar and the method viewDidLoad

    Hi,
    I created a new project from the templates (tab bar application). then I created two views, for the two itens on the bar. The second view controller has a method viewDidLoad, but the method is loaded when the program launches. I tried the loadView method, but it´s never called.
    How can i know when the view is loaded through a tab bar item?
    thanks

    I have an application based on the Tab Bar template as well, yet mine works. I also have views created via IB for each tab, but there are a series of connections which need to be made for the viewDidLoad method to be called. I made some notes along the way, perhaps they are helpful.
    In these notes, what I did was create the Tab Bar project, but I didn't like the way the views were set up, so I created a series of new views, added them the way I preferred (all from files, all the same view, including the first view), and then deleted the two default views.
    - Create a Tab Bar project.
    - With XCode, create a new UIViewController for the new first view, save it, add it to the project.
    - In IB, create a new view, save it, and add it to the project.
    - In the new view's File's Owner, set the class to the new view controller.
    - Connect the view outlet to the new view created.
    - Go to the tab bar control in the MainWindow.xib and create a new view controller.
    - Select the new tab button, and type in tab name and xib filename (without the extension).
    - Compile and run. With a label in the new view, it is easy to see if it works.
    Let me know if you find the problem.

Maybe you are looking for

  • Windows Vista and Winhelp

    Hi, Yesterday a client contacted us saying that our online help doesn't work with Windows Vista [ http://support.microsoft.com/kb/917607/en-us ]. For the moment, we don't support Windows Vista yet, but a developer and I have been working on a solutio

  • Cannot Print PDF's

    Before today I could print anything just fine to my HP CP1025NW. Today, however, I can no longer print PDF's at all from either Adobe Acrobat Pro or Preview. Sometime's it says connecting to printer for a while and then just says error and sometime I

  • Clean install to 10.6 OEM from 10.5.8

    I just ordered snow leopard. I did not realize, however, that I was ordering an OEM version. (didn't research it until after purchase either) I am currently running 10.5.8 and want to do a clean install with 10.6 OEM. Am I going to run into any probl

  • Thunderbolt and DVI splitter

    I have two DVI/VGA monitors I use for work and looking to see if there is a splitter from a thunderbolt port that would let me use these with my Macbook Air.  My Air does support thunderbolt displays just been trying to google such an item and not su

  • Going from NOARCHIVELOG to ARCHIVELOG mode

    I am running an Oracle 10g Release 2 10.2.0.2 database on AIX. Can any body tell me the exacts steps for going from noarchivelog mode to archivelog mode. Thanks and Regards, Asim Naveed.