Mapping inheritance

We're converting an existing system to JDO. Obviously, we're going to
be mapping the domain classes to the existing schema. There's very
little inheritance in the current data model to worry about, but there's
one area where we want to remodel several classes to inherit from X
rather than own an X. X has rather a lot of data members, as do the
candidate subclasses.
We understand that Kodo only supports the single-table approach to
mapping inheritance structures, but that's going to make us pay quite
the space penalty. I'm intrigued by the field-level 'table' and
'ref-column' extensions. The docs say they're for Collection, array,
and Map fields, but is it possible to use these extensions to map
non-collection inherited fields to a secondary (superclass) table? I
don't need to make the superclass itself persistent.
Jerry Pulley
Sr. Developer
Commerce Technologies, Inc.
21 Corporate Drive
Clifton Park, NY 12065
518.886.0700 x3876
518.886.0701 Fax

Sorry; this isn't possible yet.

Similar Messages

  • XML mapping inheritance problem; missing class indicator field

    Hi!
    I am currently working on a project which involves mapping a large domain model on a XSD schema. For this we use Toplink 10.1.3.1 which is mostly great. But now I have a problem while wanting to use class inheritance.
    In my XSD I have the following defined
    <xs:complexType name="Traject">
         <xs:sequence>
              <xs:element name="SoortTraject" type="SoortTraject"/>
         </xs:sequence>
    </xs:complexType>
    <xs:complexType name="SpecialTraject">
         <xs:complexContent>
              <xs:extension base="Traject">
                   <xs:sequence>
                                 [some elements] 
                   </xs:sequence>
              </xs:extension>
         </xs:complexContent>
    </xs:complexType>My XML is an implementation of this XSD and looks like this
    <Trajecten>
            <Traject xsi:type="SpecialTraject">
                     [implementation of the elements]
             </Traject>
    </Trajecten>My domain model corresponts to the XSD, so there is a Traject object and an inherited SpecialTraject object.
    In the mapping I used the Advanced properties->inheritance on both descriptors telling the Traject descriptor that it was the 'Root Parent Descriptor' ('Use class indicator field' -> 'use XML Schema Type attribute', 'Use class indicator dictionary') and the SpecialTraject what it Child Descriptor was ('Traject').
    When I test my mapping it always results in the same error (no matter how I configure this inheritance mapping). It says :
    [TOPLINK-44] missing class indicator field
    Descriptor: XMLDescriptor(Traject --> [])What am I doing wrong? Does anybody know a sollution?
    Best regards,
    Jouke Stoel
    Developer

    This is the changed XML descriptor file. When I deploy the file it automaticly overrides the old file so it ain't possible that I was still using the wrong file
    <toplink:class-indicator-mappings>
        <toplink:class-indicator-mapping>
            <toplink:class>Traject</toplink:class>
            <toplink:class-indicator xsi:type="xsd:string">Traject</toplink:class-indicator>
        </toplink:class-indicator-mapping>
        <toplink:class-indicator-mapping>
            <toplink:class>SpecialTraject</toplink:class>
            <toplink:class-indicator xsi:type="xsd:string">SpecialTraject</toplink:class-indicator>
        </toplink:class-indicator-mapping>
    </toplink:class-indicator-mappings>I have posted the stacktrace but I had to translate a bit because my exception was in Dutch :)
    Locale is a great invention
    Exception [TOPLINK-44] (Oracle TopLink - 10g Release 3 (10.1.3.1.0) (Build 061004)): oracle.toplink.exceptions.DescriptorException
    Exception description: Missing class indicator field of database row [UnmarshalRecord()].
    Descriptor: XMLDescriptor(Traject --> [])
         at oracle.toplink.exceptions.DescriptorException.missingClassIndicatorField(DescriptorException.java:887)
         at oracle.toplink.internal.ox.QNameInheritancePolicy.classFromRow(QNameInheritancePolicy.java:84)
         at oracle.toplink.internal.ox.XMLRelationshipMappingNodeValue.processChild(XMLRelationshipMappingNodeValue.java:13)
         at oracle.toplink.internal.ox.XMLCompositeCollectionMappingNodeValue.startElement(XMLCompositeCollectionMappingNodeValue.java:62)
         at oracle.toplink.ox.record.UnmarshalRecord.startElement(UnmarshalRecord.java:352)
         at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1288)
         at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:336)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:303)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:205)
         at oracle.toplink.internal.ox.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:189)
         at oracle.toplink.internal.ox.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:147)
         at oracle.toplink.ox.XMLUnmarshaller.unmarshal(XMLUnmarshaller.java:228)
    .

  • Inheritance error while mapping in WorkBench

    Hi all,
    I have a simple application where i have to map inheritance with 3 subclasess.
    I have followed the document and able to map. But while i am calling in my program i am getting an error.
    I am mapping a superclass A to three subclasses B,C,D
    Using the primary Key.
    Can any one help me on this.
    The error is
    [12/22/05 17:51:33:299 IST] 3b4afde4 SystemErr R com.ford.it.persistence.PersistenceRuntimeException: TopLink internal error occured while executing query.
    [12/22/05 17:51:33:299 IST] 3b4afde4 AbstractQuery E com.ford.it.persistence.impl.toplink.AbstractQueryStrategy execute TopLink internal error occured while executing query. <Exception [TOPLINK-43] (OracleAS TopLink - 10g (9.0.4.4) (Build 040627)): oracle.toplink.exceptions.DescriptorException
    Exception Description: Missing class for indicator field value [100,604,812] of type [class java.lang.Long].
    Descriptor: Descriptor(com.ford.apdm.types.Item --> [DatabaseTable(ITEM)])>Local Exception Stack:
    Exception [TOPLINK-43] (OracleAS TopLink - 10g (9.0.4.4) (Build 040627)): oracle.toplink.exceptions.DescriptorException
    Exception Description: Missing class for indicator field value [100,604,812] of type [class java.lang.Long].
    Descriptor: Descriptor(com.ford.apdm.types.Item --> [DatabaseTable(ITEM)])
         at oracle.toplink.exceptions.DescriptorException.missingClassForIndicatorFieldValue(DescriptorException.java:735)
         at oracle.toplink.publicinterface.InheritancePolicy.classFromRow(InheritancePolicy.java:260)
         at oracle.toplink.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:267)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.buildObject(ObjectLevelReadQuery.java:219)
         at oracle.toplink.queryframework.ReadObjectQuery.execute(ReadObjectQuery.java:383)
         at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:493)
         at oracle.toplink.queryframework.ReadQuery.execute(ReadQuery.java:125)
         at oracle.toplink.publicinterface.Session.internalExecuteQuery(Session.java:195

    Your drag and drop method may not be working out so well since you selected something along a hierarchy. That's the xpath error line of:
    Caused by: oracle.xdo.parser.v2.XPathException: Error in expression: './/CTD_SM_TOOLS><?CTC_CTD_SM_TOOLS'.
    You may have valid XML (i.e., load the data first before importing into a table), but the grouping is off.

  • Inheritance in mapping workbench

    I try to use an existing class design with TopLink: I have for each table classes for value objects (*VO) containing only the attributes from the database tables (including the foreign keys). And I have classes for composite objects (*CO) inherited from *VO, additional containing the references to other VO and CO objects.
    A simple example:
    class FirstVO           // attributes for first database table
    private long id;     // database primary key
    private long secondId;// database foreign key to second table
    class FirstCO extends FirstVO      // references from first database table
    private SecondVO second;     // object reference to second table's object
    class SecondVO           // attributes for second database table
    private long id;     // database primary key
    In TopLink mapping workbench I have done the mapping for classes *VO. That's okay.
    When I try to do the mapping for class FirstCO, I get problems:
    - TopLink mapping workbench recognizes the class hierarchy for FirstCO fine and displays it in class info.
    - But there is not way in workbench to do the mapping of the inherited attributes for class FirstCO.
    - It does not recognize that it could use the mapping from inherited class FirstVO also for FirstCO. Setting in Descriptor/...FirstClassCO.ClassDescriptor.xml the attribute Descriptor/mappings/Mapping/inherited to true will not change this (but a green arrow up is displayed with FirstCO).
    - The workbench displays an error about class FirstCO: The following primary key fields are unmapped: ID
    How can I map this field?

    Have you setup the descriptor inheritance? Right click on the Descriptor's FirstVO and FirstCO, and select "Advanced properties--inheritance". Set the Parent Decriptor for FirstCO to be FirstVO (it's on the bottom of the inheritance tab). When you do that, you should be able to map the inherited attributes with no problems. Basically, you can remap (aka override" the mappings for superclass in subclasses.
    - Don

  • Inheritance of Attributes / Mapping

    Hello!
    I have one abstract class BaseBean which holds common getter and setter (e.g. date of creation, date of last modification...), which is used in all of my beans.
    My concrete class TestBean extends from BaseBean.
    If i want to map TestBean with the Workbench, only the attributes of my concrete class can be mapped, but not the attributes which i need from the abstract class BaseBean.
    My question: Is it possible to map attributes inherited from base classes?
    regards
    Harald.

    Harald,
    You can view attributes from your parent class in the Mapping Workbench and map them. See "Mapping Inherited Attributes in a Subclass" in the docs at:
    http://otn.oracle.com/docs/products/ias/doc_library/90200doc_otn/toplink.903/b10063/descript.htm#1016101
    Do not use the advanced "Inheritance" settings on your descriptor unless there is a common table for your root class which has rows for multiple subclasses in it.
    Doug

  • 9.0.4 Mapping Workbench anomaly

    Environment:
    I recently converted from Mapping Workbench 9.0.3.5 (build 436) to 9.0.4 (build 031126).
    Classes:
    I have three classes A, B, and C. C extends B and B extends A. C is defined/known to the Workbench with its attributes and inherited attributes from B and A mapped.
    Anomaly:
    In my IDE I added a private attribute to B. In the 9.0.4 Workbench I “Refresh Classes” with C selected [or “Refresh Classes” with the project selected] and then “Map Inherited Attributes” [all permutations of the submenu and all of the classes available on “To Selected Class”] yet the new attribute does not show up in the Workbench.
    I open the “pre-conversion” project in 9.0.3 and “Refresh Classes” with C selected and the attribute shows up immediately and can be mapped.
    So I’m wondering what I’m doing wrong in the 9.0.4 version that keeps it from seeing the attribute I’ve placed into B.
    Thanks,
    Arvid

    Support was added for this in the Mapping Workbench in 9.0.4.1 (bug #3310537). You can upgrade to the latest 9.0.4 patch release on metalink.
    thanks,
    Karen

  • Many-to-Many mapping is not working as expected

    I have two tables USERS(PK: User Id) and TEAMS(PK is Team Id. We have an intermediate table MEMBERSHIP that has two columns (User Id, Team Id) and maintains the relation between Users and Teams.
    When we add team A to user ' B' the table(MEMBERSHIP) is updated as expected.
    When I retrieve the teams for user B. the team A is part of the list.
    But when I get the users for team A, the user B is not part of the list.
    If we again try to add user B to team A, we get a unique constraint violation as expected.
    Could anyone help resolve this issue?
    We have created the below 2 mappings:
    1. Users and Teams - > where we have to add teams to the user
    <mapping>
    <inherited>false</inherited>
    <instance-variable-name>teams</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>com.pkg.Team.ClassDescriptor</reference-descriptor>
    <private-owned>false</private-owned>
    <uses-batch-reading>false</uses-batch-reading>
    <table-reference-mapping-reference-handle>
    <reference-handle>
    <reference-table>MEMBERSHIP</reference-table>
    <reference-name>MEMBERSHIP_USERS</reference-name>
    </reference-handle>
    </table-reference-mapping-reference-handle>
    <container-type>Collection</container-type>
    <uses-default-container-class>true</uses-default-container-class>
    <key-method>
    <method-handle empty-aggregate="true"/>
    </key-method>
    <collection-mapping-indirection-policy>
    <collection-indirection-policy>
    <uses-indirection>false</uses-indirection>
    <uses-transparent-indirection>false</uses-transparent-indirection>
    </collection-indirection-policy>
    </collection-mapping-indirection-policy>
    <ordering-criteria>
    <collection-ordering-criteria>
    <use-ordering>false</use-ordering>
    <ascending>true</ascending>
    </collection-ordering-criteria>
    </ordering-criteria>
    <relation-table>MEMBERSHIP</relation-table>
    <target-reference-handle>
    <reference-handle>
    <reference-table>MEMBERSHIP</reference-table>
    <reference-name>MEMBERSHIP_TEAMS</reference-name>
    </reference-handle>
    </target-reference-handle>
    <mapping-class>MWManyToManyMapping</mapping-class>
    </mapping>
    2. Teams to User -> where we have to add users to the team
    <mapping>
    <inherited>false</inherited>
    <instance-variable-name>users</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>com.pkg.User.ClassDescriptor</reference-descriptor>
    <private-owned>false</private-owned>
    <uses-batch-reading>false</uses-batch-reading>
    <table-reference-mapping-reference-handle>
    <reference-handle>
    <reference-table>MEMBERSHIP</reference-table>
    <reference-name>MEMBERSHIP_TEAMS</reference-name>
    </reference-handle>
    </table-reference-mapping-reference-handle>
    <container-type>Collection</container-type>
    <uses-default-container-class>true</uses-default-container-class>
    <key-method>
    <method-handle empty-aggregate="true"/>
    </key-method>
    <collection-mapping-indirection-policy>
    <collection-indirection-policy>
    <uses-indirection>true</uses-indirection>
    <uses-transparent-indirection>false</uses-transparent-indirection>
    </collection-indirection-policy>
    </collection-mapping-indirection-policy>
    <ordering-criteria>
    <collection-ordering-criteria>
    <use-ordering>false</use-ordering>
    <ascending>true</ascending>
    </collection-ordering-criteria>
    </ordering-criteria>
    <relation-table>MEMBERSHIP</relation-table>
    <target-reference-handle>
    <reference-handle>
    <reference-table>MEMBERSHIP</reference-table>
    <reference-name>MEMBERSHIP_USERS</reference-name>
    </reference-handle>
    </target-reference-handle>
    <mapping-class>MWManyToManyMapping</mapping-class>
    </mapping>

    Hi Chris,
    Thank you so much for inputs/updates.
    "You must put A in B's collection of A's and also put B in A's collection of Bs" we are already handling this in our code.
    As per your suggestion i have used refreshIdentityMapResult() method and read only option, after that i m able to see User B in team A.
    ReadAllQuery findById = ..
    findById.refreshIdentityMapResult();
    But if try to remove team A from user ' B' and add same team A to user B then user B is not updating with team A. Please let me know if m missing any mapping/configurations.
    Regards
    Chandra

  • NullPointerException for Toplink mappings to inherited attributes

    In the Toplink workbench (I´m using TP3) I need to map inherited attributes to the super class. Whenever I try this, my Toplink map goes corrupt with a NullPointer and is not usable any more.
    This is how it goes:
    - I have different common attributes (such as id, version, ...) stored in the super class
    - Create a new Toplink map
    - Choose "Add or Remove Descriptors"
    - Add the child class to be mapped
    - Choose "Map inherited attributes" -> "To Root Minus One"
    - Nothing happens: the additional super attributes don´t show up (??)
    - Restart JDev
    - Choose again "Map inherited attributes" -> "To Root Minus One"
    - Now the additional super attributes show up and you can do any mapping
    - Yet, if you restart JDev again and try to open the Toplink mapping you get the stacktrace shown below
    I checked this with Jdev 10.1.3 and the same classes and didn´t have any problems.
    Can you reproduce this?
    Thanx in advance
    Jens
    java.lang.NullPointerException
         at oracle.toplink.workbench.mappingsmodel.descriptor.MWDescriptor.packageName(MWDescriptor.java:214)
         at oracle.toplink.workbench.mappingsplugin.ui.project.ProjectNode.descriptorPackageNodeFor(ProjectNode.java:375)
         at oracle.toplink.workbench.mappingsplugin.ui.project.ProjectNode.addDescriptorNodeFor(ProjectNode.java:444)
         at oracle.toplink.workbench.mappingsplugin.ui.project.ProjectNode.addDescriptorNodesFor(ProjectNode.java:438)
         at oracle.toplink.workbench.mappingsplugin.ui.project.ProjectNode.engageValue(ProjectNode.java:268)
         at oracle.toplink.workbench.uitools.app.AbstractTreeNodeValueModel.addStateChangeListener(AbstractTreeNodeValueModel.java:70)
         at oracle.toplink.workbench.uitools.app.swing.TreeModelAdapter.engageNode(TreeModelAdapter.java:370)
         at oracle.toplink.workbench.uitools.app.swing.TreeModelAdapter.addChildren(TreeModelAdapter.java:354)
         at oracle.toplink.workbench.uitools.app.swing.TreeModelAdapter$ChangePolicy.addChildren(TreeModelAdapter.java:478)
         at oracle.toplink.workbench.uitools.app.swing.TreeModelAdapter$4.itemsAdded(TreeModelAdapter.java:177)
         at oracle.toplink.workbench.utility.events.DefaultChangeNotifier.itemsAdded(DefaultChangeNotifier.java:76)
         at oracle.toplink.workbench.utility.events.ChangeSupport.fireItemsAdded(ChangeSupport.java:1140)
         at oracle.toplink.workbench.uitools.app.ValueModelChangeSupport.fireItemsAdded(ValueModelChangeSupport.java:242)
         at oracle.toplink.workbench.utility.AbstractModel.fireItemsAdded(AbstractModel.java:373)
         at oracle.toplink.workbench.uitools.app.CollectionListValueModelAdapter.itemsAdded(CollectionListValueModelAdapter.java:305)
         at oracle.toplink.workbench.uitools.app.SortedListValueModelAdapter.itemsAdded(SortedListValueModelAdapter.java:99)
         at oracle.toplink.workbench.uitools.app.CollectionListValueModelAdapter$1.itemsAdded(CollectionListValueModelAdapter.java:97)
         at oracle.toplink.workbench.utility.events.DefaultChangeNotifier.itemsAdded(DefaultChangeNotifier.java:55)
         at oracle.toplink.workbench.utility.events.ChangeSupport.fireItemsAdded(ChangeSupport.java:700)
         at oracle.toplink.workbench.uitools.app.ValueModelChangeSupport.fireItemsAdded(ValueModelChangeSupport.java:167)
         at oracle.toplink.workbench.utility.AbstractModel.fireItemsAdded(AbstractModel.java:179)
         at oracle.toplink.workbench.uitools.app.ListCollectionValueModelAdapter.addInternalItems(ListCollectionValueModelAdapter.java:269)
         at oracle.toplink.workbench.uitools.app.ListCollectionValueModelAdapter.itemsAdded(ListCollectionValueModelAdapter.java:273)
         at oracle.toplink.workbench.uitools.app.ListCollectionValueModelAdapter$1.itemsAdded(ListCollectionValueModelAdapter.java:89)
         at oracle.toplink.workbench.utility.events.DefaultChangeNotifier.itemsAdded(DefaultChangeNotifier.java:76)
         at oracle.toplink.workbench.utility.events.ChangeSupport.fireItemsAdded(ChangeSupport.java:1090)
         at oracle.toplink.workbench.uitools.app.ValueModelChangeSupport.fireItemsAdded(ValueModelChangeSupport.java:233)
         at oracle.toplink.workbench.utility.AbstractModel.fireItemsAdded(AbstractModel.java:377)
         at oracle.toplink.workbench.uitools.app.ItemAspectListValueModelAdapter.itemsAdded(ItemAspectListValueModelAdapter.java:234)
         at oracle.toplink.workbench.uitools.app.ListValueModelWrapper$1.itemsAdded(ListValueModelWrapper.java:69)
         at oracle.toplink.workbench.utility.events.DefaultChangeNotifier.itemsAdded(DefaultChangeNotifier.java:76)
         at oracle.toplink.workbench.utility.events.ChangeSupport.fireItemsAdded(ChangeSupport.java:1140)
         at oracle.toplink.workbench.uitools.app.ValueModelChangeSupport.fireItemsAdded(ValueModelChangeSupport.java:242)
         at oracle.toplink.workbench.utility.AbstractModel.fireItemsAdded(AbstractModel.java:373)
         at oracle.toplink.workbench.uitools.app.CollectionListValueModelAdapter.itemsAdded(CollectionListValueModelAdapter.java:305)
         at oracle.toplink.workbench.uitools.app.CollectionListValueModelAdapter$1.itemsAdded(CollectionListValueModelAdapter.java:97)
         at oracle.toplink.workbench.utility.events.DefaultChangeNotifier.itemsAdded(DefaultChangeNotifier.java:55)
         at oracle.toplink.workbench.utility.events.ChangeSupport.fireItemsAdded(ChangeSupport.java:650)
         at oracle.toplink.workbench.uitools.app.ValueModelChangeSupport.fireItemsAdded(ValueModelChangeSupport.java:158)
         at oracle.toplink.workbench.utility.AbstractModel.fireItemsAdded(AbstractModel.java:183)
         at oracle.toplink.workbench.uitools.app.CollectionAspectAdapter.itemsAdded(CollectionAspectAdapter.java:264)
         at oracle.toplink.workbench.uitools.app.CollectionAspectAdapter$1.itemsAdded(CollectionAspectAdapter.java:117)
         at oracle.toplink.workbench.utility.events.DefaultChangeNotifier.itemsAdded(DefaultChangeNotifier.java:55)
         at oracle.toplink.workbench.utility.events.ChangeSupport.fireItemAdded(ChangeSupport.java:751)
         at oracle.toplink.workbench.utility.events.ChangeSupport.fireItemAdded(ChangeSupport.java:757)
         at oracle.toplink.workbench.utility.AbstractModel.fireItemAdded(AbstractModel.java:175)
         at oracle.toplink.workbench.utility.AbstractModel.addItemToCollection(AbstractModel.java:214)
         at oracle.toplink.workbench.framework.internal.FrameworkNodeManager.addProjectNode(FrameworkNodeManager.java:121)
         at oracle.toplink.workbench.addin.ui.view.TopLinkViewContext.initializeApplicationNodes(TopLinkViewContext.java:413)
         at oracle.toplink.workbench.addin.ui.view.TopLinkViewContext.initialize(TopLinkViewContext.java:391)
         at oracle.toplink.workbench.addin.ui.view.TopLinkViewContext.<init>(TopLinkViewContext.java:98)
         at oracle.toplink.workbench.addin.ui.view.TopLinkContextTopLinkViewContext.<init>(TopLinkContextTopLinkViewContext.java:64)
         at oracle.toplink.workbench.addin.ui.view.TopLinkContextViewContextBuilder.buildViewContext(TopLinkContextViewContextBuilder.java:84)
         at oracle.toplink.workbench.addin.ui.view.ViewContextManager.buildViewContext(ViewContextManager.java:361)
         at oracle.toplink.workbench.addin.ui.view.ViewContextManager.buildViewContext(ViewContextManager.java:343)
         at oracle.toplink.workbench.addin.ui.view.ViewContextManager.getViewContext(ViewContextManager.java:849)
         at oracle.toplink.workbench.addin.ui.view.TopLinkEditor.updateViewContext(TopLinkEditor.java:497)
         at oracle.toplink.workbench.addin.ui.view.TopLinkEditor.setContext(TopLinkEditor.java:371)
         at oracle.ideimpl.editor.EditorState.createEditor(EditorState.java:147)
         at oracle.ideimpl.editor.EditorState.getOrCreateEditor(EditorState.java:94)
         at oracle.ideimpl.editor.SplitPaneState.canSetEditorStatePos(SplitPaneState.java:231)
         at oracle.ideimpl.editor.SplitPaneState.setCurrentEditorStatePos(SplitPaneState.java:194)
         at oracle.ideimpl.editor.TabGroupState.createSplitPaneState(TabGroupState.java:103)
         at oracle.ideimpl.editor.TabGroup.addTabGroupState(TabGroup.java:355)
         at oracle.ideimpl.editor.EditorManagerImpl.createEditor(EditorManagerImpl.java:1399)
         at oracle.ideimpl.editor.EditorManagerImpl.createEditor(EditorManagerImpl.java:1333)
         at oracle.ideimpl.editor.EditorManagerImpl.openEditor(EditorManagerImpl.java:1259)
         at oracle.ideimpl.navigator.OpenEditorController.whenOpenEditor(OpenEditorController.java:41)
         at oracle.ideimpl.navigator.OpenEditorContextMenuListener.handleDefaultAction(OpenEditorContextMenuListener.java:51)
         at oracle.ide.controller.ContextMenuListenersHook$LazyContextMenuListener.handleDefaultAction(ContextMenuListenersHook.java:212)
         at oracle.ide.controller.ContextMenu.fireDefaultAction(ContextMenu.java:415)
         at oracle.ideimpl.explorer.BaseTreeExplorer.fireDefaultAction(BaseTreeExplorer.java:1770)
         at oracle.ideimpl.explorer.BaseTreeExplorer.dblClicked(BaseTreeExplorer.java:2105)
         at oracle.ideimpl.explorer.BaseTreeExplorer.mouseReleased(BaseTreeExplorer.java:2126)
         at oracle.ideimpl.explorer.CustomTree.processMouseEvent(CustomTree.java:195)
         at java.awt.Component.processEvent(Component.java:5282)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3984)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3819)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1791)
         at java.awt.Component.dispatchEvent(Component.java:3819)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

    Hi John,
    thanks for the reply.
    Thing is, we need to use JSF 1.2. So I guess, either we use 10g mappings in JDev/OC4J 11g or we try an alternative mapping with the 11g JDev/Workbench (e.g. using interfaces instead).
    For the first case I´ve found no suitable way: I´ve tried to remove the toplink.jars by using the "remove-inherited" tag in the application´s "orion-application.xml" file. This did not have the proper effect.
    For the second case, I´m wondering if the 11g TP3 mapping files are compatible to the next releases and to any EclipseLink releases.
    It would be very helpful if you could clarify these issues.
    Jens

  • Inheritance and Nullpointers

    Hi,
    I'm using the mapping workbench, and trying to map inheritance.
    ClassC and ClassB inherits ClassA. ClassC has attributes, but so far ClassB has no attributes. ClassC maps correctly with the inheritance from ClassA. ClassB does not. When I try to "generate tables from descriptors" on ClassC I get the following error:
    Throwable Class Name:
    java.lang.NullPointerException
    Message:
    Stack trace:
    java.lang.NullPointerException
         at oracle.toplink.workbench.ui.db.TableGenerator.createTableIfAbsent(TableGenerator.java:252)
         at oracle.toplink.workbench.ui.db.TableGenerator.runGenerateTables(TableGenerator.java:1041)
         at oracle.toplink.workbench.ui.db.TableGenerator$1.run(TableGenerator.java:616)
    Anyone got any idea? Thanks.
    Anders,

    Hi Anders,
    What version of the Mapping Workbench are you using? It appears that you hit a bug in our table generation from descriptors functionality. If you have a small project that I can use to reproduce the problem, please send it to me at [email protected] I can test it out and file a bug report if necessary.
    Thanks,
    Karen Moore

  • Bug with exporting project to java source

    Hi,
    This is in TopLink 9.0.4.2 (Build 040311).
    We're in the process of trying to determine if we should upgrade our TopLink from 2.5 to 9.0.4, and have not yet purchased a support contract because we haven't made the final decision yet, so I'm posting this bug here in hopes that someone can submit the bug.
    In one of our projects, we have an AggregateObjectMapping (AOM) for a Measurement object that is owned by 2 different objects, each with 2 to 4 instances of this Measurement class. I set up the instances of the AOM in the workbench just fine, and looking at the XML descriptors that are written out, it appears fine. Exporting the project session XML file works fine as well. However, when it is exported to a Java file, the instances of the AOM are exported incorrectly as described below.
    Here is the abbreviated mapping of the attributes of the Measurement class:
    <mappings>
    <mapping>
    <inherited>false</inherited>
    <instance-variable-name>mPrecision</instance-variable-name>
    <default-field-names>
    <default-field-name>direct field=yPrecision</default-field-name>
    </default-field-names>
    <uses-method-accessing>false</uses-method-accessing>
    <read-only>false</read-only>
    <mapping-class>MWDirectToFieldMapping</mapping-class>
    </mapping>
    <mapping>
    <inherited>false</inherited>
    <instance-variable-name>mQuantity</instance-variable-name>
    <default-field-names>
    <default-field-name>direct field=y</default-field-name>
    </default-field-names>
    <uses-method-accessing>false</uses-method-accessing>
    <read-only>false</read-only>
    <mapping-class>MWDirectToFieldMapping</mapping-class>
    </mapping>
    <mapping>
    <inherited>false</inherited>
    <instance-variable-name>mUnit</instance-variable-name>
    <uses-method-accessing>false</uses-method-accessing>
    <read-only>false</read-only>
    <reference-descriptor>com.cimsoft.lws.units.Unit.ClassDescriptor</reference-descriptor>
    <private-owned>false</private-owned>
    <uses-batch-reading>false</uses-batch-reading>
    <table-reference-mapping-reference-handle>
    <reference-handle>
    <reference-table>csrSlotGenericValue</reference-table>
    <reference-name>csrSlotGenericValue_csdUnit</reference-name>
    </reference-handle>
    </table-reference-mapping-reference-handle>
    <uses-joining>false</uses-joining>
    <one-to-one-mapping-indirection-policy>
    <indirection-policy>
    <uses-indirection>false</uses-indirection>
    </indirection-policy>
    </one-to-one-mapping-indirection-policy>
    <mapping-class>MWOneToOneMapping</mapping-class>
    </mapping>
    <mapping>
    <inherited>false</inherited>
    <instance-variable-name>UNDEFINED_MEASUREMENT</instance-variable-name>
    <mapping-class>MWUnmappedMapping</mapping-class>
    </mapping>
    </mappings>
    Notice that there are two direct to field mappings (mPrecision and mQuantity) and one OneToOneMapping (mUnit). The exported sessions XML file has the correct XML for instances of this object. Here is an example from a class that has 3 instances of this Measurement object mapped:
    <database-mapping>
    <attribute-name>mAlarmSize</attribute-name>
    <read-only>false</read-only>
    <reference-class>com.cimsoft.lws.units.Measurement</reference-class>
    <is-null-allowed>true</is-null-allowed>
    <aggregate-to-source-field-name-associations>
    <association>
    <association-key>unitId</association-key>
    <association-value>csrStock.alarmSizeUnitId</association-value>
    </association>
    <association>
    <association-key>y</association-key>
    <association-value>csrStock.alarmSize</association-value>
    </association>
    <association>
    <association-key>yPrecision</association-key>
    <association-value>csrStock.alarmSizePrecision</association-value>
    </association>
    </aggregate-to-source-field-name-associations>
    <type>oracle.toplink.mappings.AggregateObjectMapping</type>
    </database-mapping>
    <database-mapping>
    <attribute-name>mCurrentSize</attribute-name>
    <read-only>false</read-only>
    <reference-class>com.cimsoft.lws.units.Measurement</reference-class>
    <is-null-allowed>true</is-null-allowed>
    <aggregate-to-source-field-name-associations>
    <association>
    <association-key>unitId</association-key>
    <association-value>csrStock.currentSizeUnitId</association-value>
    </association>
    <association>
    <association-key>y</association-key>
    <association-value>csrStock.currentSize</association-value>
    </association>
    <association>
    <association-key>yPrecision</association-key>
    <association-value>csrStock.currentSizePrecision</association-value>
    </association>
    </aggregate-to-source-field-name-associations>
    <type>oracle.toplink.mappings.AggregateObjectMapping</type>
    </database-mapping>
    <database-mapping>
    <attribute-name>mLotSize</attribute-name>
    <read-only>false</read-only>
    <reference-class>com.cimsoft.lws.units.Measurement</reference-class>
    <is-null-allowed>true</is-null-allowed>
    <aggregate-to-source-field-name-associations>
    <association>
    <association-key>unitId</association-key>
    <association-value>csrStock.lotSizeUnitId</association-value>
    </association>
    <association>
    <association-key>y</association-key>
    <association-value>csrStock.lotSize</association-value>
    </association>
    <association>
    <association-key>yPrecision</association-key>
    <association-value>csrStock.lotSizePrecision</association-value>
    </association>
    </aggregate-to-source-field-name-associations>
    <type>oracle.toplink.mappings.AggregateObjectMapping</type>
    </database-mapping>
    However, here are the corresponding mappings in the exported Java file (with what it really should be manually inserted by me in comments):
         AggregateObjectMapping mAlarmSizeMapping = new AggregateObjectMapping();
         mAlarmSizeMapping.setAttributeName("mAlarmSize");
         mAlarmSizeMapping.setReferenceClass(com.cimsoft.lws.units.Measurement.class);
         mAlarmSizeMapping.setIsNullAllowed(true);
         mAlarmSizeMapping.addFieldNameTranslation("csrStock.alarmSizeUnitId", "unitId");
         mAlarmSizeMapping.addFieldNameTranslation("csrStock.alarmSize", "y");
         mAlarmSizeMapping.addFieldNameTranslation("csrStock.alarmSizePrecision", "yPrecision");
         descriptor.addMapping(mAlarmSizeMapping);
         AggregateObjectMapping mCurrentSizeMapping = new AggregateObjectMapping();
         mCurrentSizeMapping.setAttributeName("mCurrentSize");
         mCurrentSizeMapping.setReferenceClass(com.cimsoft.lws.units.Measurement.class);
         mCurrentSizeMapping.setIsNullAllowed(true);
         mCurrentSizeMapping.addFieldNameTranslation("csrStock.currentSize", "alarmSize");
         mCurrentSizeMapping.addFieldNameTranslation("csrStock.currentSizeUnitId", "unitId");
         mCurrentSizeMapping.addFieldNameTranslation("csrStock.currentSizePrecision", "alarmSizePrecision");
         // should be: mCurrentSizeMapping.addFieldNameTranslation("csrStock.currentSize", "y");
         // should be: mCurrentSizeMapping.addFieldNameTranslation("csrStock.currentSizePrecision", "yPrecision");
         descriptor.addMapping(mCurrentSizeMapping);
         AggregateObjectMapping mLotSizeMapping = new AggregateObjectMapping();
         mLotSizeMapping.setAttributeName("mLotSize");
         mLotSizeMapping.setReferenceClass(com.cimsoft.lws.units.Measurement.class);
         mLotSizeMapping.setIsNullAllowed(true);
         mLotSizeMapping.addFieldNameTranslation("csrStock.lotSizeUnitId", "unitId");
         mLotSizeMapping.addFieldNameTranslation("csrStock.lotSize", "currentSize");
         mLotSizeMapping.addFieldNameTranslation("csrStock.lotSizePrecision", "currentSizePrecision");
         // should be: mLotSizeMapping.addFieldNameTranslation("csrStock.lotSize", "y");
         // should be: mLotSizeMapping.addFieldNameTranslation("csrStock.lotSizePrecision", "yPrecision");
         descriptor.addMapping(mLotSizeMapping);
    It appears that the actual Measurement descriptor is being modified accidentally as it's being exported, as you'll notice that the first mapping (for mAlarmSize) correctly maps the default "y" to "alarmSize", and then the next mapping (for mCurrentSize) instead of mapping "y" to "currentSize" maps "alarmSize" to "currentSize", and the next AOM maps "currentSize" to "lotSize" instead of "y" to "lotSize".
    Thanks,
    Greg

    No one ever responded, so I'm commenting to bring it up again. It turns out that the error happens not just exporting to Java, but anytime the command-line project generation is used. If the Workbench is used to export either to XML or to a Java file, the file is generated correctly. It is not generated correctly if you try to do it from the commandline (e.g. from a build environment).
    This has happened with 9.0.4.2 through the current 9.0.4.5.
    Here are different ways I've tried doing it from the commandline, and they all generate the erroneous XML and Java files:
    java oracle.toplink.workbench.external.api.JavaSourceGenerator inputMWP outputJava.java
    and
    java oracle.toplink.workbench.external.api.DeploymentXMLGenerator inputMWP outputXML.xml
    which are recommended by the documentation. Also recommended by the documentation:
    JavaSourceGenerator.generate( inputFile, outputFile )
    and
    DeploymentXMLGenerator.generate( inputFile, outputFile ).
    From decompiling the management workbench to see what it was doing differently:
    MWProject project = WorkbenchSession.instance().openProject( inputFile );
    if ( doXML )
    project.setProjectDeploymentXmlDirectory( directory );
    project.setProjectDeploymentXmlFileName( filename );
    project.exportDeploymentXml();
    else
    project.setProjectSourceRootDirectory( directory );
    project.setProjectClassName( classname );
    project.exportJavaSource( outputFile );
    //Also tried plain old project.exportJavaSource(); which appears to actually do something different.
    Any ideas? It looks like a bug to me, particularly that different java or XML deployment files are generated when run from the commandline versus run from the UI. Obviously, the commandline is very important because it is what the build system needs.
    Thanks,
    Greg

  • DBAdapter and Sequcne on 10.1.3.3

    I have an issue regarding using native sequnce in DBAdapter to insert a new record into database.
    For Bpel 10.1.2
    I have to problem to use native sequnce by setting *mappig.xml and oc4j.xml.
    For Bpel 10.1.3.3 I saw "cnnot insert NULL" error. I am not sure why.
    ==The error message
    ORA-01400: cannot insert NULL into ("AP"."AP_INVOICES_INTERFACE"."INVOICE_ID") Error Code: 1400 Query:InsertObjectQuery(&lt;ApInvoiceLinesInterface {&lt;ApInvoicesInterface null />} null />)</detail> }}
    ==Setting on my ApInvoice.xml
    <opm:primary-key>
    opm:field table="AP_INVOICE_LINES_INTERFACE" name="INVOICE_ID" xsi:type="opm:column"/>
    <opm:field table="AP_INVOICE_LINES_INTERFACE" name="INVOICE_LINE_ID" xsi:type="opm:column"/>
    </opm:primary-key>
    <toplink:sequencing>
    <toplink:sequence-name>AP.AP_INVOICE_LINES_INTERFACE_S</toplink:sequence-name>
    <toplink:sequence-field table="AP_INVOICE_LINES_INTERFACE" name="INVOICE_LINE_ID" xsi:type="opm:column"/>
    </toplink:sequencing>
    <opm:primary-key>
    <opm:field table="AP_INVOICES_INTERFACE" name="INVOICE_ID" xsi:type="opm:column"/>
    </opm:primary-key>
    <toplink:sequencing>
    <toplink:sequence-name>AP.AP_INVOICES_INTERFACE_S</toplink:sequence-name>
    <toplink:sequence-field table="AP_INVOICES_INTERFACE" name="INVOICE_ID" xsi:type="opm:column"/>
    </toplink:sequencing>

    I did some experiments
    I created a sequence TESTAN_S start with 50 increment by 50.
    I have inserted 300 rows using DB adaptrer with native sequencing option.
    The ID's in table are incremented by 1 staring with 50 ie 50,51,52,53.....upto 351..
    This is wrong as sequence.nextval should always be incerments of 50 not 1. I dont know why this is happening. What is the significance of preallocation size tag?
    Here are the steps I followed to achieve this. its working somewhat but not exactly what i was expecting. I just changes the files manually and did not run any wizards after changing the files manually.
    1. On the Top link I have selected Native sequencing Option and pre allocation=50 and Save
    2. Open the bpel/servicename_toplink_mappings.xml and add sequence.. see the xml pasted below.
    <?xml version="1.0" encoding="UTF-8"?>
    <toplink:object-persistence version="Oracle TopLink - 10g Release 3 (10.1.3.3.0) (Build 070608)" xmlns:opm="http://xmlns.oracle.com/ias/xsds/opm" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:toplink="http://xmlns.oracle.com/ias/xsds/toplink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <opm:name>readtest_service</opm:name>
    <opm:class-mapping-descriptors>
    <opm:class-mapping-descriptor xsi:type="toplink:relational-class-mapping-descriptor">
    <opm:class>readtestservice.Readtest</opm:class>
    <opm:alias>Readtest</opm:alias>
    <opm:primary-key>
    <opm:field table="READTEST" name="ID" xsi:type="opm:column"/>
    </opm:primary-key>
    <opm:events xsi:type="toplink:event-policy"/>
    <opm:querying xsi:type="toplink:query-policy">
    <opm:queries>
    <opm:query name="findAllReadtest" xsi:type="toplink:read-all-query">
    <toplink:timeout>0</toplink:timeout>
    <toplink:reference-class>readtestservice.Readtest</toplink:reference-class>
    <toplink:cache-usage>primary-key</toplink:cache-usage>
    <toplink:lock-mode>none</toplink:lock-mode>
    <toplink:container xsi:type="toplink:list-container-policy">
    <toplink:collection-type>java.util.Vector</toplink:collection-type>
    </toplink:container>
    </opm:query>
    </opm:queries>
    <toplink:does-exist-query xsi:type="toplink:does-exist-query">
    <toplink:existence-check>check-database</toplink:existence-check>
    </toplink:does-exist-query>
    </opm:querying>
    <opm:attribute-mappings>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>id</opm:attribute-name>
    <opm:field table="READTEST" name="ID" xsi:type="opm:column"/>
    <opm:attribute-classification>java.math.BigDecimal</opm:attribute-classification>
    </opm:attribute-mapping>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>value</opm:attribute-name>
    <opm:field table="READTEST" name="VALUE" xsi:type="opm:column"/>
    <opm:attribute-classification>java.lang.String</opm:attribute-classification>
    </opm:attribute-mapping>
    <opm:attribute-mapping xsi:type="toplink:direct-mapping">
    <opm:attribute-name>updateDate</opm:attribute-name>
    <opm:field table="READTEST" name="UPDATE_DATE" xsi:type="opm:column"/>
    <opm:attribute-classification>java.sql.Timestamp</opm:attribute-classification>
    </opm:attribute-mapping>
    </opm:attribute-mappings>
    <toplink:descriptor-type>independent</toplink:descriptor-type>
    <toplink:caching>
    <toplink:cache-type>weak-reference</toplink:cache-type>
    <toplink:always-refresh>true</toplink:always-refresh>
    </toplink:caching>
    <toplink:remote-caching>
    <toplink:cache-type>weak-reference</toplink:cache-type>
    </toplink:remote-caching>
    <toplink:instantiation/>
    <toplink:copying xsi:type="toplink:instantiation-copy-policy"/>
    <toplink:change-policy xsi:type="toplink:deferred-detection-change-policy"/>
              <toplink:sequencing>
    <toplink:sequence-name>TESTAN_S</toplink:sequence-name>
    <toplink:sequence-field table="READTEST" name="ID" xsi:type="opm:column"/>
    </toplink:sequencing>
    <toplink:tables>
    <toplink:table name="READTEST"/>
    </toplink:tables>
    </opm:class-mapping-descriptor>
    </opm:class-mapping-descriptors>
    </toplink:object-persistence>
    3. add following in class descriptor.xml in toplink/servicename/descripter/servicename.tablename.ClassDescripter.xml
    <sequence-number-name>TESTAN_S</sequence-number-name>
    <uses-sequencing>true</uses-sequencing>
    see below for the complete file:
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <descriptor>
    <unique-filename>readtestservice.Readtest.ClassDescriptor</unique-filename>
    <active>true</active>
    <bldr-class>readtestservice.Readtest</bldr-class>
    <mappings>
    <mapping>
    <inherited>false</inherited>
    <instance-variable-name>id</instance-variable-name>
    <default-field-names>
    <default-field-name>direct field=</default-field-name>
    </default-field-names>
    <uses-method-accessing>false</uses-method-accessing>
    <read-only>false</read-only>
    <get-method-handle>
    <method-handle/>
    </get-method-handle>
    <set-method-handle>
    <method-handle/>
    </set-method-handle>
    <direct-mapping-field-handle>
    <field-handle>
    <field-table>APPS.READTEST</field-table>
    <field-name>ID</field-name>
    </field-handle>
    </direct-mapping-field-handle>
    <mapping-class>MWDirectToFieldMapping</mapping-class>
    </mapping>
    <mapping>
    <inherited>false</inherited>
    <instance-variable-name>value</instance-variable-name>
    <default-field-names>
    <default-field-name>direct field=</default-field-name>
    </default-field-names>
    <uses-method-accessing>false</uses-method-accessing>
    <read-only>false</read-only>
    <get-method-handle>
    <method-handle/>
    </get-method-handle>
    <set-method-handle>
    <method-handle/>
    </set-method-handle>
    <direct-mapping-field-handle>
    <field-handle>
    <field-table>APPS.READTEST</field-table>
    <field-name>VALUE</field-name>
    </field-handle>
    </direct-mapping-field-handle>
    <mapping-class>MWDirectToFieldMapping</mapping-class>
    </mapping>
    <mapping>
    <inherited>false</inherited>
    <instance-variable-name>updateDate</instance-variable-name>
    <default-field-names>
    <default-field-name>direct field=</default-field-name>
    </default-field-names>
    <uses-method-accessing>false</uses-method-accessing>
    <read-only>false</read-only>
    <get-method-handle>
    <method-handle/>
    </get-method-handle>
    <set-method-handle>
    <method-handle/>
    </set-method-handle>
    <direct-mapping-field-handle>
    <field-handle>
    <field-table>APPS.READTEST</field-table>
    <field-name>UPDATE_DATE</field-name>
    </field-handle>
    </direct-mapping-field-handle>
    <mapping-class>MWDirectToFieldMapping</mapping-class>
    </mapping>
    </mappings>
    <sequence-number-name>TESTAN_S</sequence-number-name>
    <uses-sequencing>true</uses-sequencing>
    <should-always-refresh-cache>true</should-always-refresh-cache>
    <primary-key-field-handles>
    <field-handle>
    <field-table>APPS.READTEST</field-table>
    <field-name>ID</field-name>
    </field-handle>
    </primary-key-field-handles>
    <primary-table>APPS.READTEST</primary-table>
    <associated-tables>
    <associated-table>
    <name>APPS.READTEST</name>
    </associated-table>
    </associated-tables>
    <sequence-number-field-handle>
    <field-handle/>
    </sequence-number-field-handle>
    <class-descriptor-query-manager>
    <query-manager>
    <descriptor-alias>Readtest</descriptor-alias>
    <query-list>
    <query>
    <name>findAllReadtest</name>
    <query-type>oracle.toplink.queryframework.ReadAllQuery</query-type>
    <cache-usage>Check Cache by Primary Key</cache-usage>
    <lock-mode>Do Not Acquire Locks</lock-mode>
    <distinct-state>Uncomputed Distinct</distinct-state>
    <in-memory-query-indirection-policy>Throw Indirection Exception</in-memory-query-indirection-policy>
    <cache-query-results>false</cache-query-results>
    <maintain-cache>true</maintain-cache>
    <refresh-identity-map-result>false</refresh-identity-map-result>
    <refresh-remote-identity-map-result>false</refresh-remote-identity-map-result>
    <use-wrapper-policy>true</use-wrapper-policy>
    <prepare>true</prepare>
    <query-timeout>0</query-timeout>
    <maximum-rows>0</maximum-rows>
    <format>
    <query-format>
    <main-compound-expression>
    <expression>
    <operator-type>AND</operator-type>
    <expression-class>MWCompoundExpression</expression-class>
    </expression>
    </main-compound-expression>
    <query-format-class>MWExpressionQueryFormat</query-format-class>
    </query-format>
    </format>
    </query>
    </query-list>
    </query-manager>
    </class-descriptor-query-manager>
    <class-descriptor-identity-policy>
    <identity-policy>
    <identity-map-size>100</identity-map-size>
    <identity-map-class-name>oracle.toplink.internal.identitymaps.WeakIdentityMap</identity-map-class-name>
    <existence-checking>Check database</existence-checking>
    </identity-policy>
    </class-descriptor-identity-policy>
    <descriptor-class>MWClassDescriptor</descriptor-class>
    </descriptor>

  • Effort to upgrade from version 9.0.4.5 to 10.1.3.0.0

    What kind of effort is required to upgrade from 9.0.4.5 of Toplink to 10.1.3.0 (or later)? Any tips on estimating this effort? Any gotchas? Good Experiences? Bad Experiences?
    Thanks,
    Michael

    If you're talking about a big system, 200+ descriptors, it could be like this:
    Sorry for the long post.
    I have been upgrading from 9.0.3x to 10.1.3.0 and have been running into quite a few things that seem to have been tightened up in the tl runtime.
    Now, I would say that we have a test suite of 550 tests that tries to excercise the code and the TL implementation. And the way we implemented many of tests was with disregard for how TL would react to cached object changes. So, for example, in 9.03 we could get away with adding objects to TL-cached container objects outside of a UOW and it would not affect other objects in the system. But with 10.1.3 the cache got globally messed up and subsequent tests failed.
    It was aggrevating that the tests would run independently and I had to debug the test suite. BUT this is mainly in the way we were testing and goes against the TOPLink mantra of "don't change a toplink object outside a uow". So you probably won't run into that.
    I had a couple of remappings I had to do after using the Workbench to convert. Most were because in 9.0.3 you weren't required to have all of the heirarchy present in the builder for mapping inherited attributes and the builder left a few subclass descriptor mappings off.
    I had some expression issues when dealing with the aggregate object vs. query keys. In 9.03 you could say exp.get("date").equal(aDateWrapper.getDate()) and if date was an aggregate mapping of DateWrapper and a querykey it would still work. But this threw an exception in 10.1.3. I had to clean it up to say
    exp.get("date").equal(aDateWrapper), which is more correct.
    If your object model is pretty complex, like ours, you may have implemented some strange hierarchies/mappings. Another thread "Trouble implementing non-key relationship", highlights an issue I couldn't figure out.
    The Package renaming gave me some issues because the UnitOfWork deprecation was not included. The original UnitOfWork remains in the code but shows a deprecation marker. That's fine. But there are so many deprecations in 10.1.3 that I had some trouble tracking down ALL of the deprecated declarations of UOW. SO, to get rid of this UnitOfWork deprecation use a global replace if you can. Or just take better refactoring steps than I did. It would be best if the package rename could have somehow included that.
    It's been three weeks so far and I'm just now testing the application instead of the test suite. Overall I'm glad to be upgrading, but I'll definitely keep a closer watch on upgrades from now on. And I'm glad for the 550 tests.
    Bret

  • Using base classes for common attributes

    Can TopLink handle use of non-mapped abstract base classes? There are a number of fields that are common to each and every one of my domain objects which, following good OO design principals, are moved up to a common superclass. So I have:
    public abstract class AbstractDomainObject
    private Integer id;
    private Date dateCreated;
    private Integer creatorId;
    private Date dateModified;
    private Integer modifierId;
    // ... appropriate attribute accessors
    Then a concrete class which gets mappped in Workbench:
    public class Address
    extends AbstractDomainObject
    ... specific attributes
    I tried mapping all the specific attributes explicitly defined in the Address class and then using "Map Inherited Fields > To SuperClass" in Workbench. However, when attempting to test my mappings in the SessionConsole, only the attributes explicitly defined on Address are present in the SELECT clause.
    Can what I am trying be done? If so, how?

    Steve,
    What you are trying to do is very common and the process you described is exactly how map the class. I will summarize a couple of points for mapping this scenario.
    1. You only need to import Address in and map it. If AbstractDomainObject is imported into the Mapping Workbench make sure that it is disabled. The abstract class is only required on the project's CLASSPATH.
    2. You should not enable inheritance for the Address class. Inheritance is for situations where the abstract base class has its own independent table. I am assuming that your Address class has its own table that contains fields for all of the attributes it needs along with those of the abstract base class.
    Assuming these conditions are met then TopLink will work fine with you Address class just as if it had all of the inherited attributes directly.
    If you are still having trouble take a look through your generated project (XML or Java) to ensure that mappings exist in Address for All attributes. If the project looks good then I am at a loss. Customers have been using this pattern of use for over 5 years with TopLink and Java inheritance.
    Cheers,
    Doug

  • 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

  • DescriptorException

    Hello,
    I have the following exception
    Exception [TOPLINK-108] (OracleAS TopLink - 10g (9.0.4.2) (Build 040311)): oracle.toplink.exceptions.DescriptorException
    Description de l'exception : Valeur introuvable dans le mapping d'indicateurs de classe du descripteur parent [null].
    Descripteur : Descriptor(clara.prototype.accesdonnees.modelepersistant.Article --> [DatabaseTable(root.article)])
    This is the descripteur file (The problem seems to come from the inheritance). I used Mapping Workbench.
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <descriptor>
    <unique-filename>clara.prototype.accesdonnees.modelepersistant.Article.ClassDescriptor</unique-filename>
    <active>true</active>
    <bldr-class>clara.prototype.accesdonnees.modelepersistant.Article</bldr-class>
    <mapping-descriptor-inheritance-policy>
    <inheritance-policy>
    <is-root>true</is-root>
    <read-subclasses-on-query>false</read-subclasses-on-query>
    <inheritance-policy-class-indicator-policy>
    <class-indicator-policy>
    <class-name-is-indicator>false</class-name-is-indicator>
    <use-class-extraction-method>false</use-class-extraction-method>
    <default-field-name></default-field-name>
    <indicator-type>java.lang.String</indicator-type>
    <class-indicator-policy-field-handle>
    <field-handle>
    <field-table>article</field-table>
    <field-name>typeart</field-name>
    </field-handle>
    </class-indicator-policy-field-handle>
    <class-extraction-method-handle>
    <method-handle empty-aggregate="true"/>
    </class-extraction-method-handle>
    <class-indicator-values>
    <class-indicator-value>
    <indicator>M</indicator>
    <class-indicator-value-descriptor>clara.prototype.accesdonnees.modelepersistant.Materiel.ClassDescriptor</class-indicator-value-descriptor>
    </class-indicator-value>
    <class-indicator-value>
    <indicator>S</indicator>
    <class-indicator-value-descriptor>clara.prototype.accesdonnees.modelepersistant.Service.ClassDescriptor</class-indicator-value-descriptor>
    </class-indicator-value>
    </class-indicator-values>
    </class-indicator-policy>
    </inheritance-policy-class-indicator-policy>
    </inheritance-policy>
    </mapping-descriptor-inheritance-policy>
    <mappings>
    <mapping>
    <inherited>false</inherited>
    <instance-variable-name>catalogueRattachement</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>clara.prototype.accesdonnees.modelepersistant.Catalogue.ClassDescriptor</reference-descriptor>
    <private-owned>false</private-owned>
    <uses-batch-reading>false</uses-batch-reading>
    <table-reference-mapping-reference-handle>
    <reference-handle>
    <reference-table>article</reference-table>
    <reference-name>article_catalogue</reference-name>
    </reference-handle>
    </table-reference-mapping-reference-handle>
    <uses-joining>false</uses-joining>
    <one-to-one-mapping-indirection-policy>
    <indirection-policy>
    <uses-indirection>false</uses-indirection>
    </indirection-policy>
    </one-to-one-mapping-indirection-policy>
    <mapping-class>MWOneToOneMapping</mapping-class>
    </mapping>
    <mapping>
    <inherited>false</inherited>
    <instance-variable-name>dateCommercialisation</instance-variable-name>
    <default-field-names>
    <default-field-name>direct field=</default-field-name>
    </default-field-names>
    <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>
    <direct-mapping-field-handle>
    <field-handle>
    <field-table>article</field-table>
    <field-name>dateCom</field-name>
    </field-handle>
    </direct-mapping-field-handle>
    <mapping-class>MWDirectToFieldMapping</mapping-class>
    </mapping>
    <mapping>
    <inherited>true</inherited>
    <instance-variable-name>description</instance-variable-name>
    <default-field-names>
    <default-field-name>direct field=</default-field-name>
    </default-field-names>
    <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>
    <direct-mapping-field-handle>
    <field-handle>
    <field-table>article</field-table>
    <field-name>description</field-name>
    </field-handle>
    </direct-mapping-field-handle>
    <mapping-class>MWDirectToFieldMapping</mapping-class>
    </mapping>
    <mapping>
    <inherited>true</inherited>
    <instance-variable-name>identifiant</instance-variable-name>
    <default-field-names>
    <default-field-name>direct field=</default-field-name>
    </default-field-names>
    <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>
    <direct-mapping-field-handle>
    <field-handle>
    <field-table>article</field-table>
    <field-name>idart</field-name>
    </field-handle>
    </direct-mapping-field-handle>
    <mapping-class>MWDirectToFieldMapping</mapping-class>
    </mapping>
    <mapping>
    <inherited>false</inherited>
    <instance-variable-name>lesMarches</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>clara.prototype.accesdonnees.modelepersistant.Marche.ClassDescriptor</reference-descriptor>
    <private-owned>false</private-owned>
    <uses-batch-reading>false</uses-batch-reading>
    <table-reference-mapping-reference-handle>
    <reference-handle>
    <reference-table>artmar</reference-table>
    <reference-name>artmar_article</reference-name>
    </reference-handle>
    </table-reference-mapping-reference-handle>
    <container-type>Collection</container-type>
    <uses-default-container-class>true</uses-default-container-class>
    <key-method>
    <method-handle empty-aggregate="true"/>
    </key-method>
    <collection-mapping-indirection-policy>
    <collection-indirection-policy>
    <uses-indirection>true</uses-indirection>
    <uses-transparent-i</inherited>
    <instance-variable-name>dateCommercialisation</instance-variable-name>
    <default-field-names>
    <default-field-name>direct field=</default-field-name>
    </default-field-names>
    <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>
    <direct-mapping-field-handle>
    <field-handle>
    <field-table>article</field-table>
    <field-name>dateCom</field-name>
    </field-handle>
    </direct-mapping-field-handle>
    <mapping-class>MWDirectToFieldMapping</mapping-class>
    </mapping>
    <mapping>
    <inherited>true</inherited>
    <instance-variable-name>description</instance-variable-name>
    <default-field-names>
    <default-field-name>direct field=</default-field-name>
    </default-field-names>
    <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>
    <direct-mapping-field-handle>
    <field-handle>
    <field-table>article</field-table>
    <field-name>description</field-name>
    </field-handle>
    </direct-mapping-field-handle>
    <mapping-class>MWDirectToFieldMapping</mapping-class>
    </mapping>
    <mapping>
    <inherited>true</inherited>
    <instance-variable-name>identifiant</instance-variable-name>
    <default-field-names>
    <default-field-name>direct field=</default-field-name>
    </default-field-names>
    <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>
    <direct-mapping-field-handle>
    <field-handle>
    <field-table>article</field-table>
    <f

    This error happens when there is a value in the database for your type indicator field that does not have an entry in the mappings. In this case, it looks like the field you specified as the type indicator has null values, which is not allowed.
    - Don

Maybe you are looking for

  • How do I reinstall OS X Mavericks

    I inhereited an Apple at work for testing purposes. It was set up with only one Admin user and that person is long gone, So there is currently only one unusable admin and a guest account. I think the only thing I can do is re-install OS X Mavericks.

  • Is it a bug? Conditional request

    {color:#000000}Hi, I have a region button which submits with the request {color:#993366}APPLY_CHANGES{color} On this same page I have a {color:#993366}pl/sql{color} page process with a condition set to {color:#993366}Request is contained within Expre

  • F110 Error - Information re. vendor 1000037 / paying company code 1001 ...

    Dear, All Experts. While doing F110 Payment Run I encountered with this error. It is proposal Log. Job started Step 001 started (program SAPF110S, variant &0000000000003, user ID 367207) Log for proposal run for payment on 27.09.2010, identification

  • Join two dataProviders

    I have a chart with a secondary axis and two ArrayCollections because I want the series on the left axis to update independently from the series on the right axis. Flex charts support only one dataProvider. How do I join two ArrayCollections to make

  • How do I contact Kodak Imaging about my photo order

    I ordered 26 5X8's of the same picture. It was a group photo and in the prints sent to me 1/2 of a person was cut off. I have no idea how to talk to anyone about this, do you? I cannot find the path to a real person......I know somewhere there is a p