Create two one-to-one self-reference mappings

We need help on the following problem with Toplink:
We have a table massnahme with several attributes.
table massnahme
massnahmeID
prevMassnahme
nextMassnahme
prevMassnahme, nextMassnahme are self-references on massnahme. We take prevMassnahme and nextMassnahme as a one-to-one mapping to massnahme. The target reference on prevMassnahme and nextMassnahme is massnahmeID.
If we create a new Object massnahme_B and set prevMassnahme on this massnahme_B to an existing massnahme_A and set the nextMassnahme on the existing massnahme_A to the new massnahme_B, then it seems that toplink tries to make the update on the existing massnahme_A before the insert of the new massnahme_B. That causes an exception, because toplink tries to insert an empty massnahme into the database.
Any help on this topic would be appreciated.
The Toplink Mapping Workbench we use has the version 9.0.4.2.
Thomas

Here the Java-Code and Descriptor Snippets, where Anamnese and Aufnahmevorgang are both derived classes of Massnahme and cloneAufnahmevorgang is registered earlier in the code (same UnitOfWork).
<mapping>
<inherited>false</inherited>
<instance-variable-name>prevMassnahme</instance-variable-name>
<uses-method-accessing>false</uses-method-accessing>
<read-only>false</read-only>
<get-method-handle>
<method-handle empty-aggregate="true"/>
</get-method-handle>
<set-method-handle>
<method-handle empty-aggregate="true"/>
</set-method-handle>
<reference-descriptor>de.kvwl.masc.se.model.Massnahme.ClassDescriptor</reference-descriptor>
<private-owned>false</private-owned>
<uses-batch-reading>false</uses-batch-reading>
<table-reference-mapping-reference-handle>
<reference-handle>
<reference-table>MASSNAHME</reference-table>
<reference-name>MASSNAHME_C05</reference-name>
</reference-handle>
</table-reference-mapping-reference-handle>
<uses-joining>false</uses-joining>
<one-to-one-mapping-indirection-policy>
<indirection-policy>
<uses-indirection>true</uses-indirection>
</indirection-policy>
</one-to-one-mapping-indirection-policy>
<mapping-class>MWOneToOneMapping</mapping-class>
</mapping>
<mapping>
<inherited>false</inherited>
<instance-variable-name>nextMassnahme</instance-variable-name>
<uses-method-accessing>false</uses-method-accessing>
<read-only>false</read-only>
<get-method-handle>
<method-handle empty-aggregate="true"/>
</get-method-handle>
<set-method-handle>
<method-handle empty-aggregate="true"/>
</set-method-handle>
<reference-descriptor>de.kvwl.masc.se.model.Massnahme.ClassDescriptor</reference-descriptor>
<private-owned>false</private-owned>
<uses-batch-reading>false</uses-batch-reading>
<table-reference-mapping-reference-handle>
<reference-handle>
<reference-table>MASSNAHME</reference-table>
<reference-name>MASSNAHME_C07</reference-name>
</reference-handle>
</table-reference-mapping-reference-handle>
<uses-joining>false</uses-joining>
<one-to-one-mapping-indirection-policy>
<indirection-policy>
<uses-indirection>true</uses-indirection>
</indirection-policy>
</one-to-one-mapping-indirection-policy>
<mapping-class>MWOneToOneMapping</mapping-class>
</mapping>
Anamnese cloneAnamnese = (Anamnese) getUow().registerExistingObject(anamnese);
cloneAufnahmevorgang.setPrevMassnahme(cloneAnamnese);
cloneAnamnese.setNextMassnahme(cloneAufnahmevorgang);
getUow().commit();
Any further Information needed?
Thomas

Similar Messages

  • What is the prerequisite for creating two hierarchies from one fact table i

    Hi,
    what is the prerequisite for creating two hierarchies from one a single fact table.
    Rgds,
    Amit

    create global temporary table t1 as select * from trn_ordbase on commit preserve rows;You CANNOT use this syntax.
    http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/sqcmd.htm
    http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/glob_tab.gif
    http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/cre_tabl.gif

  • HT2204 I created two iTunes accounts:  one for business purchases and one for personal.  However, when I try to purchase an iBook on my personal account only the business account information appears, and my business password is requested.  How can I selec

    I created two iTunes accounts:  one for business purchases and one for personal.  However, when I try to purchase an iBook on my personal account only the business account information appears, and my business password is requested.  How can I select a different account depending on the type of purchase I am making?

    You would have to sign out of the store with that AppleID and sign in with the alternate AppleID.
    Settings -> iTunes & App Stores -> tap the Apple ID showing, logout, then login.
    Beware thought that you can only change a device's AppleID association once every 90 days.
    http://support.apple.com/kb/ht4627
    So if you do this, you will not be able to use the other AppleID on that device for 90 days.

  • How to create two respone for one request

    Hi
    is there any way for us to create two response for one request
    the scenario is as below
    1. user click on update button for particular record in the datatable (
    after its get updated and status get updated = 'UPDATED' it will remove the object from ObjectListDataProvider and clear the tablePhaseListener ).
    2. After it gets updated successfuly , i want to prompt the user with generateExcel function which using response.getOutputStream() using Apache POI.
    How can we combine 1 and 2 together
    Here what i have tried and didnt work
    1. i tried to put the generateExcel function in destroy() method after page is rendered but it gives me Exception
    2. i tried to put the generateExcel function in prerender() method
    but the page will only execute the generateExcel function
    - the data still get updated to the database but it doesnt refresh the page ( i meant the removing object and tablephaseListener.clear() doesnt work )
    3 . i tried to put generateExcel Function after it process the data
    public String updateData()
           //update data
           if(success){
                // prompt user to save excell sheet
            return null;
         }This one also doesnt work and gives the same behaviour as number 2
    The Prompt to save excel sheet still gets popped up
    but the page just doesnt get refreshed
    Thanks
    is anybody know the workaround?

    yea i did set some alert message and clear the table by calling
    provider.removeRow and commitChanges
    it just doesnt reflected in the page that we see
    by actually is already removing the row from the provider
    Thanks

  • Can we create two Filters for one cube

    Hi all,
    I created two filters for one cube (in 11v), I assigned this filters to one user in shared services , so which filter work,
    I think ,We have to assign only one filter for one user , please i need clarification....
    Thanks
    Edited by: user98631 on 12 mars 2010 05:13

    You can create many filters for one cube. I usually associate one group per filter and a user can have one or more groups assigned to them. Can't remember what happens when a user has access to conflicting filters (i.e. the order of preference). It is in the DBAG I am sure though.

  • Creating two users for one desktop Address Book

    I apologize for posting this more than once but I haven't received a response and I think perhaps the first post was not in the right place.
    Why is it not easier to create two Groups under the common AB rather than creating two users and exporting/importing files? I read an earlier question from someone who needed two ABs for two users but didn't want to do two Groups yet it seems so easy to do.
    I created a Group called 'Dedo'; highlighted, dragged and dropped, the entire All listing in AB. I then edited out the names I don't need by Remove From Group (under AB, Edit). The Group-edited names still remain in the ALL listing on the desktop AB. I then synced only the selected groups I wanted to my iPhone, including 'Dedo'. It created a new All Contacts and all the groups I selected.
    I can create a second group called 'Speedo' for the other user, drag & drop All from the desktop AB, and they can edit from 'Speedo' the names they don't want, and sync their groups to their iPhone. Again, the All Contacts are still intact on the desktop AB for reference to info we might want occasionally but don't need on our phones.
    So .............. what's the downside to what otherwise seems like an easy fix? What am I not seeing?
    Thanks for any insight I'm missing.

    No one responded. However, dividing the names of interest to each of us into two groups seems to be working well. We sync the particular group we want to our individual iPhone and don't bear the burden of having many, many names we don't want in our own personal contacts.

  • Create two Blogs in one web site

    I am planing to have two blogs in my website, because one is for me and another one for my baby.
    But, when I create two blogs in iWeb and use comment function in both blog, the first one will fail to link.
    If I close the comment function in second blog, the first one become normal.
    Did any one use iWeb in the same way with me but without this problem?
    Thanks a lot!

    I don't do blogs (or Windows ) but have you tried creating a separate site and just link the two with text based links. Each would be separate and might do the trick.
    OT

  • Create two partitions on one hard drive?

    Hi
    I have an external hard drive I want to use for both PC and Mac.
    Can somebody please help me on how to create two partitions on the hard drive, one with Mac extended format and one with NTFS format.
    Many thanks

    pbmarcano wrote:
    Alternatively (my usual approach): Format the Windows partition to FAT then when you bring it to a windows machine, format the partition to NTFS.
    No need to format to NTFS, you can convert to NTFS with no destruction of data.
    Just format to FAT in Disk Utility, then when accessing the FAT drive in WIndows:
    *To convert a volume to NTFS from the command prompt*
    http://technet.microsoft.com/en-us/library/bb456984.aspx
    Open Command Prompt. Click Start, point to All Programs, point to Accessories, and then click Command Prompt.
    *In the command prompt window, type: convert drive_letter: /fs:ntfs*
    For example, typing convert D: /fs:ntfs would format drive D: with the ntfs format. You can convert FAT or FAT32 volumes to NTFS with this command.

  • Create two clients on one BW server

    Hello,
    Is it possible to create 2 clients on one BW server? I remember that in 3.1 our basis told me that its impossible.... We are now on BW 3.5
    Please Advice,
    David

    David
    Have you checked these previous posts?
    Re: client creation
    Re: BW can have multiple client?
    Re: Is it posible to work with multiple clients in BW?
    Hope this helps
    Thnaks
    sat

  • How do I create two accounts on one computer?

    Hi - I just bought my son a new iPod and he gave me his old one (a mini). His iTunes account is on my computer and I want to create my own account on the same computer so that we're not paying off each other's credit cards. How do I do that? It doesn't matter if we share music or not; we do have a lot of likes in common and can ignore the dislikes. Thanks.

    Hi - I just bought my son a new iPod and he gave me his old one (a mini). His iTunes account is on my computer and I want to create my own account on the same computer so that we're not paying off each other's credit cards. How do I do that? It doesn't matter if we share music or not; we do have a lot of likes in common and can ignore the dislikes. Thanks.

  • I have mistakenly created two separate catalogs, one in 5.6 and one in Lightroom 5 original.  The latter is on my external drive, the former is on my hard drive. How do I merge them and upgrade the 5.0 main catalog?

    In trying to dump my Elements 10 catalog into my LR catalog, I can see I have mistakenly created a second catalog.  My main catalog is on the external drive and remains in the original 5.0 version, the "elements 10 upgraded" was imported into the 5.6 upgrade of LR and is on my hard drive.  Can you advise how I can fix this?
    Thanks in advance.
    Barb in Virginia

    OK Jim Hess, that step is done.  So on the hard drive, can I now delete:
    1. the "extra" LR catalog?
    2. the Elements 10 Catalog (which I had previously imported into one of the LR catalogs?
    That leaves me with a single catalog on an external drive.  The only question is: what about backup catalogs? how do I determine where my "new consolidated" catalog is backing up to?
    thanks in advance.

  • How do I create two quizzes in one project

    I have one project, which has 2 question pools of 10 & 12 questions.  Trainees have to answer 3 & 3 respectively.  Unfortunately, the quizzes are linked and mean that the whole project has to be completed before quiz results are published allowing trainees to 'loop' back if having failed.  I need the quizzes separate, to allow trainees to 'loop' back and complete only the part of the project that they have failed the confirmation for.  I hope there is an easy work around?
    Chris

    It is a SCORM rule that each file can have only one quiz, and can report only results of one quiz.
    If you want only to show intermediate score after the first sequence of questions, you can use the quizzing system variables to create a custom score slide. This post explains to do that, but not for random question slides; some quizzing system variables like cpQuizInfoPointsscored are updated after each question.
    Intermediate Score Slides - Captivate blog

  • Create two databases in one oracle home

    Hi All,
    I am new in oracle, using oracle standard edition 10g and some questions I want to ask.
    Is it possible to create 2 different databases under same oracle home? For example, one database for online transaction named orcl_online, one database for reporting services named orcl_report.
    If it is ok, that means 2 instance exist for each database, then how to use sqlplus to connect to orcl_online only ?
    Thanks.

    Not 2, you can create more number of databases in an Oracle Server but of course depend on the h/w configurations.
    Use dbca to create the database orcl_online and then again create orcl_online.
    If u trying to connect to particular DB through Command line, set the ORACLE_SID.
    In windows set ORACLE_SID= orcl_online then use sqlplus
    In unix/linux etc export ORACLE_SID=’ orcl_online’ then use sqlplus
    If using sqlplus GUI specify the host string which is the database name probably.

  • Can i create two transcation in one connection

    there are two sql need to excute.
    and them need to in two diffrence transcation
    but i have only one connection.
    how to do it.can you tell me?

    For one of the statements use an autonomous transaction.
    eg:
    declare
    pragma autonomous_transaction;
    begin
    --insert,update,delete, etc
    commit;
    end;
    David

  • How to convert from windows media into iTunes without creating two albums with one featured song by itself?

    I found out how to convert my windows media player music into my iTunes since I just joined the apple world. I was able to do one CD but I tried to convert Alicia Keys Element of Freedom and all of the songs converted except "Put It In a Love Song" featuring Beyonce. If it's going to do that, how do I keep it from doing all of my albums that have featured artists so it'll be in one album. I don't want the album and then the sole song sitting there. I've tried to find out if anyone's addressed that, but I'm not sure if people are addressing it because it's coming from Windows Media and not the store yet.

    Generally all you need to do is fill in an appropriate Album Artist. For more details see my article on Grouping Tracks Into Albums, in particular the topic One album, too many covers.
    tt2

Maybe you are looking for

  • Parallel Building of CONTEXT Index

    All, Any ideas to why my index is not building in parallel. The table is not set to parallel but it shouldn't have to be. My BITMAP indexes I have a running in parallel without problems. Is there something else that needs to be done? CREATE INDEX POR

  • Modules in SAP Netweaver 7.2 Trial.

    Hi everybody, Hope you are all fine. I m new in this forum and new in SAP technology and development. Recently, I install the SAP Netweaver 7.2 Trial in order to start to develop with ABAP. But, the problem is I donu2019t find the RH modules and some

  • Can't get coupons to print since downloading Mavericks.

    I have tried reinstalling the software (twice), but cannot get it to run on Safari, Firefox, or Chrome since installing OS 10.9 (Mavericks). It worked previously. Please help!

  • Why is my text super tiny in photoshop cs4?

    I will  have it set to 72 and it microscopic and you cant even see it. Any help? Also, I dont want to have to re-install.

  • Why is there a question mark

    There is a question mark on one of the pictures in my photobook creation.  What is it and how do I fix it?