Variable One to One - difficult question

Hi
I am using a Variable One to One mapping but TL is not using the class indicator information to produce the correct SQL and I wonder what I am doing wrong.
I have the following simplified database design:
Users:
userId (pk)
Applications:
applicationId (pk)
ServiceProviders
serviceProviderId (pk)
applicationId (fk)
Services
serviceId (pk)
serviceProviderId (fk)
UserEntities
userId (pk, fk)
entityId (pk)
entityTypeId (pk)
The Id values for different entity types are mutually exclusive - there can be a serviceId #1 and a serviceProviderId #1.
I have several classes that implement an Entity interface (Application, ServiceProvider, Service), and a UserEntity class containing a reference to a User and an Entity.
In the descriptors for classes implementing Entity I have a one to many mapping to UserEntity, with a table reference constructed in MW, and a single source / target field pair of e.g. entityId - applicationId. In the UserEntity descriptor I have a one to one mapping to User and a variable one to one mapping to Entity. This contains a Class Indicator based on the entityTypeId field, and values for each class implementing Entity have been entered.
It seems that when I insert a new UserEntity instance, this class indicator value is used to supply a value for the entityTypeId field. When I access the userEntities collection from a User instance, the class indicator is used to instantiate the correct kind of Entity. But when I access the userEntities collection from an instance of the an Entity class like the Application class, the EntityTypeId is not specified in the SQL generated:
ServerSession(30932017)--Connection(24156236)--SELECT ENTITYID, ENTITYTYPEID, USERID FROM USERENTITIES WHERE (ENTITYID = ?)
bind => [1]
#### I would expect 'AND ENTITYTYPEID = ? ..... bind => [2]' here #####
I would expect the class indicator info to be used both ways, when determining what class to instantiate for the variable one to one, and also to make the query specific to that class when an instance is being used.
Many thanks if you can shed some light on this. Perhaps I have to use an API method as demonstrated in this post how can i map this?
James

James
Thanks for your reply.
I have a similar NullPointerException on the validateNode method. I slavishly followed your code example - hope it was right :), so will raise this with Oracle support.
public static void amendApplicationUserEntityResp(Descriptor descriptor) {
     OneToManyMapping mapping = (OneToManyMapping) descriptor.getMappingForAttributeName("responsibilitiesInherited");
     ExpressionBuilder builder = new ExpressionBuilder();
     mapping.setSelectionCriteria(
          builder.getField("USERENTITYRESPINHERITED.ENTITYID").equal(builder.getParameter("APPLICATIONS.APPLICATIONID")
          .and(builder.getField("USERENTITYRESPINHERITED.ENTITYTYPEID").equal(1)))

Similar Messages

  • Variable one to one mapping question

    I'm trying to create a variable one to one mapping using an interface with two implementing classes. The problem that I have is that I have two different values in the class indicator column that I wish to map to the same class. Mapping workbench doesn't let me do this. The MW documentation discusses using unique primary keys by leaving the class indicator blank. However, i'm using 9.0.4.8 and this doesn't appear to work as I get exceptions at runtime.
    Is there anything along the lines of the inheritance classextraction method for interfaces? Any suggestions for how to go about this?
    Thanks in advance,
    Jonathan

    Hi Jonathan,
    This use case is not supported in the Workbench. You will have to define an After Load Method in the workbench and add the indicator->class mappings in code. I am not positive on how this is handled in the runtime. Which indicator would be used when writing, maybe only supported for read-only mappings, or possibly not supported at all? Someone from the runtime team can respond about this.
    Karen

  • One to one mapping question -- can I just map a lookup field for queries?

    I have a table with a state code. I'd like to have a "virtual lookup" on the java class to a region table. I.e., this java class "studies" has a state code. I can map a one-to-one to the descriptor class that has the ref table, but I'd like to have a property in the java class pre-mapped to the "region" field in this lookup so for querying i can just use:
    ReadAllQuery q = new ReadAllQuery();
    q.setReferenceClass(study.class);
    q.setSelectionCriteria(new ExpressionBuilder().get("Region").equal(Region));
    to get all the studies for a particular region.
    am I going about this wrong? or do I have to get the reference table descriptor fromt he one to one map and do something different?

    well,on the way home last nite, I realized I'd had a complete brain fart. I've done this before. I just set up a 1-1 map between descriptors and then built the query like this:
    q.setSelectionCriteria(new ExpressionBuilder().get("refFPO").get("FPO_NO").equal(FPO));
    You can get the pointer to the "refFPO" which is the the descriptor mapped 1-1, then appended the column you wish to get.
    I still went ahead and amended my class to include a read-only, non-toplink mapped attribute "FPO" which just gets the reference variable pointing to "refFPO.getFPO_NO();
    I answered my own question just in case anyone wondered ....

  • How to use bind variable value of one VO as initial value for other VO row?

    JDeveloper 10.1.3.3, ADF Faces, ADF BC
    Hi,
    I have two View Objects: one read only with several bound variables and another editable entity based. Correspondingly there are two ADF Faces pages: first contains search form based on the read-only VO and second create form based on the editable VO. The search form has several hidden fields for some of bound variables because they aren't edited directly by user. These fields are updated with PPR when user selects other search criteria from LOV.
    There is a command button in the first page that navigates to the second form. Is there any way to transfer values of bound variables from the first VO to the second VO as initial values of the new row?
    I tried to set custom controller for the second page and retrieve search criteria values from request parameter map but values from hidden fields are missing. I think because that these fields are updated by PPR. Of course I can add custom action method to the navigation button and in the method put these values to request parameter map but I hope there is better solution.
    Thanks,
    Marius

    To summarize, given a bind variable value for one VO, on creating a row in a second VO, for 1 of the attributes of the second VO, you want to use the first VO's bind variable value. Correct?
    A potential solution ADF BC driven:
    1) Ensure you have an AppModuleImpl for your AM
    2) Ensure you have a ViewImpl for your 1st VO (where the bind variable will exist) - lets refer to that VO as "Alpha"
    3) Ensure you have a ViewRowImpl for your 2nd VO (the one you want to default the value in) - lets refer to that VO as "Beta"
    4) For your first VO "Alpha" create the bind variable (say pValue)
    5) In your second VO "Beta" ViewRomImpl add following code:
    @Override
    protected void create(AttributeList attributeList) {
      super.create(attributeList);
      AppModuleImpl am = (AppModuleImpl)this.getApplicationModule();
      String someValue = am.getAlphaView1().getpValue();
      setSecondVOAttr(someValue); // change this code to whatever your setter is for the field you want to initialize.
    }Hope this helps. Let us know how you go.
    Regards,
    CM.

  • I can't change the email on my iCloud account on my iPhone because I can't remember the password, and I can't remember one of the security questions. What do I do?

    I can't change the email on my iCloud account on my iPhone because I can't remember the password, and I can't remember one of the security questions. What do I do?

    Hi karen615,
    Welcome to the Apple Support Communities!
    If you cannot reset your Apple ID password via security questions, you can reset via email authentication. If you are not receiving the email, it may be necessary to contact Apple Support using the link in the Get help section toward the bottom of the article. 
    If you forgot your Apple ID password - Apple Support
    Best regards,
    Joe

  • Variable sharing from one class to another??

    Hi!!
    Suppose two classes, one class extend from JFrame and another
    from JDialog.I want to share the variable of Second one(extending JDialog) into firstone.How can I get this? please help me.

    For example:
    In JFrame class...
    JDialog theDialog = new JDialog ...
    someVariable = theDialog.getVariable();
    In the JDialog class, add the getVariable method.

  • I am on a shared computer with several profiles.  I had to delete my profile and create a new one.  Now, my question.  It transferred to Purchased Items to the new iTunes, so how do I get the rest of the songs to transfer to new iTunes?

    I  am on a shared computer with several profiles.  I had to delete my profile and create a new one.  Now, my question.  It transferred to Purchased Items to the new iTunes, so how do I get the rest of the songs to transfer to new iTunes?

    It sounds like you might have broken links to your content. Either repair these by putting the files you've recovered where iTunes expects to find them or delete the broken entries then go to iTunes Store > Purchased > Music > Not on This Computer, and click the download links.
    If you have an Apple device see also Recover your iTunes library from your iPod or iOS device.
    tt2

  • Why does apple make it so difficult to understand what is going on with my one to one?

    Does anyone have any answers for this? I don't even know where to list it here as a question.
    Just spent over 2 hours, off and on, trying to get someone at apple to help figure out what's going on with my one to one. They give a number for help but there's no one there - only more gibberish about go here go there go all over the place on their site.... So called 'customer service' doesn't understand my question? Another place it says call the store, well that was another waste of time....
    If I get a message saying my one to one is expired and then I pay for it via paypal, wait for the activation email. I sure don't want to pay for something I already have - that was my grocery money for 2 weeks.
    When I click on that link it says:
    Activation error
    This membership cannot be activated because this Apple ID is already associated with a One to One membership.

    zihsuan wrote:
    The Apple outlet is an authorised service provider that does AppleCare as well as far as I know
    Contacting Apple World Wide for Support and Service
    http://support.apple.com/kb/HE57

  • How to pass a variable more than one values?

    How to pass a variable more than one values?

    You can't.
    During 1 session, 1 ODI variable can have only 1 value at a time.
    If you need more than 1 value, you will have to do somethink like a loop inside your package, and refresh the variable value each time.

  • Variables -  Sap business one

    Hi I have a print layout design form designed by someone else.  I would like to modify it and have noticed that it uses a variable number for one of the fields.  How can i tell what the variable definition is for this variable? thankyou

    Judi - a suggestion as I got burnt on this area - be VERY VERY careful when using variables in the Print Layout Designer (PLD).  I walked into a customer's office and said the information she wanted could be included as part of the results with PLD by using the variables displayed in the system.  A bit embarassed when the results came out funky and certainly not what she was looking for.
    I did an extensive amount of research and submitted a ticket to SAP, and here is their reply (verbatim from the ticket):
    "The fields in the other report that are showing results 'Text Type Field'
    are harcoded or system fields and they only can be used by our
    development team...
    <u>Variables are generally not supported by us as they can be subject to
    change in patches or upgrades.  Please check Note 723783...
    We do not guarentee that the displayed Variable Numbers are valid
    and will print the correct information...</u>
    Adding Variables can as well corrupt your Layout in General. Therefore
    we do not encourage you to try to add your own Variables..."
    By "displayed variable numbers", SAP Support was referring to some numbers I had copied down from the forms themselves and passed on to SAP asking why they were not as documented.  But guess what - the variables did NOT print the same info in the PLD as what was displayed on the system!   It turned out to be a real mess.
    I am especially worried about the statement that variables can change in patches or upgrades and wonder if there will be some work to be done for when any PLD was modified?

  • How to query objects on variable one-to-one relationship

    Hi,
    I have a situation here:
    Application (APPLICATION table) has many payoffs (Payoff table); Primary key of application is the foreign key of payoff.
    Payoff has disbursement, such as check(check table), directDeposit(directDeposit table) or Wire(wire table), which is variable one-to-one relationship. They share the same primary key
    The query I need to run is to search application based on check number, How do I construct a query to perform this kind of search?
    Thanks
    Hao
    [email protected]

    Hi Doug,
    Thanks for all your help. But I guess I still need more details from you to help me understand the solution.
    First of all, I want to make sure I make my case clear
    Application (application table, pk: uniqueAppId) has many payoffs (Payoff table, pk: payoffId);
    Payoff object has variable one-to-one mapping to Disbursement object, which is a abstract super clss for following objects:
    Check(payoff-check table, pk: payoffId)
    DirectDeposit(payoff-deposit table, pk: payoffId)
    Wire(payoff-wire table, pk: payoffId),
    The query I want to run is to get me back an application for a particular check number
    From you email, first I thought "check" is a object, then your sample code showed it is a string. So I am kind of confused. The document you pointed seems not reflect my case. I wonder it is because I didn't present my case clear the first time.
    Looking forward to your further help
    Hao

  • After upgrading to the latest ios my imessage and facetime apps do not function.....any one having similar difficulties?

    After upgrading to the latest ios my imessage and facetime apps do not function.....any one having similar difficulties?

    Start your '''Computer''' in safe mode. Then start Firefox. Try '''Safe''' web sites.
    Starting The Computer In Safe Mode;
    If running, turn your computer off.
    Remove any disks and thumb drives that are in your hard drives or ports.
    Now start your computer but also;
    '''Windows; '''Press the <F8> key repeatedly.
    '''Mac: '''Hold down the Shift key.
    '''Linux; '''Using the command line, Linux/Unix computers can be booted
    into various run levels that determine which resources are loaded.
    For example, "runlevel 1" is typically the equivalent to Windows and
    Mac safe modes.
    * Source; '''[http://encyclopedia2.thefreedictionary.com/Linux+Safe+Mode Safe Mode; Free Online Encyclopedia]'''
    When the '''Boot''' menu is displayed, release the key you were pressing.
    You must now choose what mode to use. The most used are;
    * Safe Mode; The computer runs with only a minimum set of programs.
    * Safe Mode '''With '''Networking; Same as above, but with internet access.

  • One to One signup question

    So yesterday I went and spent $3,000 on a new computer. I am very happy with it. But we waited for over 45 minutes before we could get help. (this store is really busy) So we bought the computer we wanted and did not ask many questions because we were tired. I didn't know that the One to One could only be bought at the same time you bought the computer We even bought the extended warranty.
    I cannot understand why, after spending so much money, that I cannot purchase the one to the one to now My husband was so tired after the drive (an hour to get to the store) and then the wait.
    Can anyone from Apple please tell me why we cannot purchase the classes after we buy the computers?
    Thank you so much!
    Message was edited by: DFen911

    Welcome to the Apple forums
    When I bought a refurbished MacBook for my mother online last year, buying One-to-One was not one of the options as it is when ordering a new Mac from the online Apple Store. I called 1-800-MY-APPLE & had no problem ordering it. Have your receipt from the Apple Store handy so you can give them the receipt number or anything else from it they may ask for.
    Another option is to talk to the manage at the retail Apple Store you went to, but it would probably be best to do it in person, so I'd try the online number first.

  • Aggregate and variable one-to-one

    Hi,
    I would like to create a variable one-to-one mapping in my aggregate target descriptor, but when I want to set up the query key associations, the foreign key field is disabled. Is this not possible, or am I missing something?
    Regards,
    Katarina

    Hi,
    I would like to create a variable one-to-one mapping in my aggregate target descriptor, but when I want to set up the query key associations, the foreign key field is disabled. Is this not possible, or am I missing something?
    Regards,
    Katarina

  • Variable one to one

    Hi,
    1) Is it possible to have the class indicator in a variable one to one mapping set to a function call, or a pl/sql expression instead of a field?
    2) I am trying to use the workbench to create a variable one to one but the reference descriptor dropdown does not show anything.
    Thanks!
    Calin

    1 - You could use custom SQL or stored procedures in your queries to read the source object of the variable 1-1 and potentially provide the indicator value from a function, but this would be very complex. You would probably be better off having an indicator field, or not using an indicator (it is optional). Perhaps some more information on what you are trying to do?
    2 - A variable 1-1 mapping is a 1-1 relationship from the source descriptor to one of several different classes that share a common interface. You must have a common interface between the target classes and define an interface descriptor for the interface in the Mapping Workbench.

Maybe you are looking for

  • How to prevent inline bullets from falling at the end of a line?

    Okay, I am SURE the subject of my question is difficult to understand, so I will try to explain a little better below I am working on a catalog where the bullet points for items are all 'inline' and not each on their own line. Here is an example belo

  • Creating tabstrip in an infotype

    hi how do u create a tabstrip in an infotype? points will b suitably rewarded... thx gunjan

  • Navigating in list view.

    I have hundreds of clips in list view, all sorted by Reel Name. It's tedious enough to scroll right to the bottom of the list when FCPX insists on regularly springing open every Reel Group to display its contents (even when I're recently closed them

  • 10.3.5 sluggish on my iMac (and some other newbie questions)...

    I just purchased an iMac, and am brand-new to Macs. I can do anything on a PC, and actually do PC tech support for a living, so you can imagine that I feel completely ridiculous asking some of these questions, but here goes: 1. How do I copy and past

  • Blocked scheduling defect equipment

    Dear expert, I have a query regarding defective equipment. I used serial number management to track the history of equipment. I replace equipment with the new one. After i dismantle defective equipment the equipment status is become AVLB (available).