Toplink inheritance

Hi there,
I have 3 classes B, C and D subclassed from A, an abstract class. I'm mapping the 3 subclasses to one table. I'm having difficulty inserting an instance of a sublass into the table. We're using Spring so I simply call merge passing the instance and I get no exception, but no record appears in the table.
I have descriptors for all classes with the inheritance policy set up correctly I believe. In fact, I inserted a record manually in the table and did a readAll on the subclass that mapped to the class indicator field and it instantiated the subclass as expected.
What I'm not sure of is: Do I need to map table, primary key and sequence for all descriptors, or do I just map them in the descriptor of the abstract class, and the subclasses inherit them? - much like the <database-mappings> get inherited from the parent.
appreciate any help you may have...Barry

Many thanks for the reply James.
The id of the object is indeed null when calling merge, and I have no records in the table so there are no id matches.
I did an explicit call to registerNewObject before calling merge. After stepping over the registerNewObject call, I noticed that it populated the id of the object with the next sequence (should it do this?) Subsequently, after stepping over the merge call, I still have no entry in the table.
I've included the 4 desciptors if you wish to take a peek...
<descriptor>
          <java-class>edu.rcpsc.cvi.application.itembank.model.asset.Asset</java-class>
<tables>
               <table>T_ASSET</table>
          </tables>
          <primary-key-fields>
               <field>T_ASSET.ID</field>
          </primary-key-fields>
<sequence-number-field>T_ASSET.ID</sequence-number-field>
          <sequence-number-name>S_ASSET_ID</sequence-number-name>
          <descriptor-type-value>Normal</descriptor-type-value>
          <identity-map-class>oracle.toplink.internal.identitymaps.SoftCacheWeakIdentityMap</identity-map-class>
          <remote-identity-map-class>oracle.toplink.internal.identitymaps.SoftCacheWeakIdentityMap</remote-identity-map-class>
          <identity-map-size>100</identity-map-size>
          <remote-identity-map-size>100</remote-identity-map-size>
          <should-always-refresh-cache>true</should-always-refresh-cache>
          <should-always-refresh-cache-on-remote>true</should-always-refresh-cache-on-remote>
          <should-only-refresh-cache-if-newer-version>false</should-only-refresh-cache-if-newer-version>
          <should-disable-cache-hits>false</should-disable-cache-hits>
          <should-disable-cache-hits-on-remote>false</should-disable-cache-hits-on-remote>
<descriptor-is-read-only>true</descriptor-is-read-only>
          <alias>Asset</alias>
<inheritance-policy>
<descriptor-inheritance-policy>
<should-read-subclasses>true</should-read-subclasses>
<read-all-subclasses-view>T_ASSET</read-all-subclasses-view>
<should-use-class-name-as-indicator>false</should-use-class-name-as-indicator>
<class-indicator-field>T_ASSET.ASSET_TYPE</class-indicator-field>
<class-indicator-associations>
<typed-association>
<association-key>edu.rcpsc.cvi.application.itembank.model.asset.AddendumAsset</association-key>
<association-value>3</association-value>
<association-key-type>java.lang.Class</association-key-type>
<association-value-type>java.lang.String</association-value-type>
</typed-association>
<typed-association>
<association-key>edu.rcpsc.cvi.application.itembank.model.asset.DigitalAsset</association-key>
<association-value>1</association-value>
<association-key-type>java.lang.Class</association-key-type>
<association-value-type>java.lang.String</association-value-type>
</typed-association>
<typed-association>
<association-key>edu.rcpsc.cvi.application.itembank.model.asset.AnalogAsset</association-key>
<association-value>2</association-value>
<association-key-type>java.lang.Class</association-key-type>
<association-value-type>java.lang.String</association-value-type>
</typed-association>
</class-indicator-associations>
</descriptor-inheritance-policy>
</inheritance-policy>
          <copy-policy>
               <descriptor-copy-policy>
               <type>oracle.toplink.internal.descriptors.CopyPolicy</type>
               </descriptor-copy-policy>
          </copy-policy>
          <instantiation-policy>
               <descriptor-instantiation-policy>
               <type>oracle.toplink.internal.descriptors.InstantiationPolicy</type>
               </descriptor-instantiation-policy>
          </instantiation-policy>
          <query-manager>
               <descriptor-query-manager>
               <existence-check>Check database</existence-check>
               </descriptor-query-manager>
          </query-manager>
          <event-manager>
               <descriptor-event-manager empty-aggregate="true"/>
          </event-manager>
          <mappings>
               <database-mapping>
               <attribute-name>id</attribute-name>
               <read-only>false</read-only>
               <get-method-name>getId</get-method-name>
               <set-method-name>setId</set-method-name>
               <field-name>T_ASSET.ID</field-name>
               <type>oracle.toplink.mappings.DirectToFieldMapping</type>
               </database-mapping>
               <database-mapping>
               <attribute-name>nameEN</attribute-name>
               <read-only>false</read-only>
               <get-method-name>getNameEN</get-method-name>
               <set-method-name>setNameEN</set-method-name>
               <field-name>T_ASSET.NAMEEN</field-name>
               <type>oracle.toplink.mappings.DirectToFieldMapping</type>
               </database-mapping>
               <database-mapping>
               <attribute-name>nameFR</attribute-name>
               <read-only>false</read-only>
               <get-method-name>getNameFR</get-method-name>
               <set-method-name>setNameFR</set-method-name>
               <field-name>T_ASSET.NAMEFR</field-name>
               <type>oracle.toplink.mappings.DirectToFieldMapping</type>
               </database-mapping>
               <database-mapping>
               <attribute-name>descriptionEN</attribute-name>
               <read-only>false</read-only>
               <get-method-name>getName</get-method-name>
               <set-method-name>setName</set-method-name>
               <field-name>T_ASSET.DESCRIPTIONEN</field-name>
               <type>oracle.toplink.mappings.DirectToFieldMapping</type>
               </database-mapping>
               <database-mapping>
               <attribute-name>descriptionFR</attribute-name>
               <read-only>false</read-only>
               <get-method-name>getDescriptionFR</get-method-name>
               <set-method-name>setDescriptionFR</set-method-name>
               <field-name>T_ASSET.DESCRIPTIONFR</field-name>
               <type>oracle.toplink.mappings.DirectToFieldMapping</type>
               </database-mapping>
               <database-mapping>
               <attribute-name>addedToTarget</attribute-name>
               <read-only>false</read-only>
               <get-method-name>getAddedToTarget</get-method-name>
               <set-method-name>setAddedToTarget</set-method-name>
               <field-name>T_ASSET.ADDED_TO_TARGET</field-name>
               <type>oracle.toplink.mappings.DirectToFieldMapping</type>
               </database-mapping>
<database-mapping>
               <attribute-name>type</attribute-name>
               <read-only>false</read-only>
               <get-method-name>getType</get-method-name>
               <set-method-name>setType</set-method-name>
               <field-name>T_ASSET.ASSET_TYPE</field-name>
               <type>oracle.toplink.mappings.DirectToFieldMapping</type>
          </database-mapping>
<database-mapping>
               <attribute-name>specialty</attribute-name>
               <read-only>false</read-only>
               <get-method-name>getSpecialty</get-method-name>
               <set-method-name>setSpecialty</set-method-name>
               <field-name>T_ASSET.SPECIALTY</field-name>
               <type>oracle.toplink.mappings.DirectToFieldMapping</type>
          </database-mapping>
     </mappings>
          <type>oracle.toplink.publicinterface.Descriptor</type>
     </descriptor>
     <descriptor>
          <java-class>edu.rcpsc.cvi.application.itembank.model.asset.DigitalAsset</java-class>
          <descriptor-type-value>Normal</descriptor-type-value>
          <identity-map-class>oracle.toplink.internal.identitymaps.SoftCacheWeakIdentityMap</identity-map-class>
          <remote-identity-map-class>oracle.toplink.internal.identitymaps.SoftCacheWeakIdentityMap</remote-identity-map-class>
          <identity-map-size>100</identity-map-size>
          <remote-identity-map-size>100</remote-identity-map-size>
          <should-always-refresh-cache>true</should-always-refresh-cache>
          <should-always-refresh-cache-on-remote>true</should-always-refresh-cache-on-remote>
          <should-only-refresh-cache-if-newer-version>false</should-only-refresh-cache-if-newer-version>
          <should-disable-cache-hits>false</should-disable-cache-hits>
          <should-disable-cache-hits-on-remote>false</should-disable-cache-hits-on-remote>
          <alias>DigitalAsset</alias>
<inheritance-policy>
<descriptor-inheritance-policy>
<parent-class>edu.rcpsc.cvi.application.itembank.model.asset.Asset</parent-class>
<should-use-class-name-as-indicator>false</should-use-class-name-as-indicator>
</descriptor-inheritance-policy>
</inheritance-policy>
          <copy-policy>
               <descriptor-copy-policy>
               <type>oracle.toplink.internal.descriptors.CopyPolicy</type>
               </descriptor-copy-policy>
          </copy-policy>
          <instantiation-policy>
               <descriptor-instantiation-policy>
               <type>oracle.toplink.internal.descriptors.InstantiationPolicy</type>
               </descriptor-instantiation-policy>
          </instantiation-policy>
          <query-manager>
               <descriptor-query-manager>
               <existence-check>Check database</existence-check>
               </descriptor-query-manager>
          </query-manager>
          <event-manager>
               <descriptor-event-manager empty-aggregate="true"/>
          </event-manager>
          <mappings>
<database-mapping>
               <attribute-name>digitalAssetType</attribute-name>
               <read-only>false</read-only>
               <get-method-name>getDigitalAssetType</get-method-name>
               <set-method-name>setDigitalAssetType</set-method-name>
               <field-name>T_ASSET.DIGITAL_ASSET_TYPE</field-name>
               <type>oracle.toplink.mappings.DirectToFieldMapping</type>
          </database-mapping>
               <database-mapping>
               <attribute-name>donatedBy</attribute-name>
               <read-only>false</read-only>
               <get-method-name>getDonatedBy</get-method-name>
               <set-method-name>setDonatedBy</set-method-name>
               <field-name>T_ASSET.DONATEDBY</field-name>
               <type>oracle.toplink.mappings.DirectToFieldMapping</type>
               </database-mapping>
<database-mapping>
               <attribute-name>donatedDate</attribute-name>
               <read-only>false</read-only>
               <get-method-name>getDonatedDate</get-method-name>
               <set-method-name>setDonatedDate</set-method-name>
               <field-name>T_ASSET.DONATED_DATE</field-name>
               <type>oracle.toplink.mappings.DirectToFieldMapping</type>
               </database-mapping>
<database-mapping>
               <attribute-name>keywords</attribute-name>
               <read-only>false</read-only>
               <get-method-name>getKeywords</get-method-name>
               <set-method-name>setKeywords</set-method-name>
               <field-name>T_ASSET.KEYWORDS</field-name>
               <type>oracle.toplink.mappings.DirectToFieldMapping</type>
               </database-mapping>
               <database-mapping>
               <attribute-name>isReleased</attribute-name>
               <read-only>false</read-only>
               <get-method-name>isReleased</get-method-name>
               <set-method-name>setReleased</set-method-name>
               <field-name>T_ASSET.RELEASED</field-name>
               <type>oracle.toplink.mappings.DirectToFieldMapping</type>
               </database-mapping>
          </mappings>
          <type>oracle.toplink.publicinterface.Descriptor</type>
     </descriptor>
     <descriptor>
          <java-class>edu.rcpsc.cvi.application.itembank.model.asset.AnalogAsset</java-class>
          <descriptor-type-value>Normal</descriptor-type-value>
          <identity-map-class>oracle.toplink.internal.identitymaps.SoftCacheWeakIdentityMap</identity-map-class>
          <remote-identity-map-class>oracle.toplink.internal.identitymaps.SoftCacheWeakIdentityMap</remote-identity-map-class>
          <identity-map-size>100</identity-map-size>
          <remote-identity-map-size>100</remote-identity-map-size>
          <should-always-refresh-cache>true</should-always-refresh-cache>
          <should-always-refresh-cache-on-remote>true</should-always-refresh-cache-on-remote>
          <should-only-refresh-cache-if-newer-version>false</should-only-refresh-cache-if-newer-version>
          <should-disable-cache-hits>false</should-disable-cache-hits>
          <should-disable-cache-hits-on-remote>false</should-disable-cache-hits-on-remote>
          <alias>AnalogAsset</alias>
<inheritance-policy>
<descriptor-inheritance-policy>
<parent-class>edu.rcpsc.cvi.application.itembank.model.asset.Asset</parent-class>
<should-use-class-name-as-indicator>false</should-use-class-name-as-indicator>
</descriptor-inheritance-policy>
</inheritance-policy>
          <copy-policy>
               <descriptor-copy-policy>
               <type>oracle.toplink.internal.descriptors.CopyPolicy</type>
               </descriptor-copy-policy>
          </copy-policy>
          <instantiation-policy>
               <descriptor-instantiation-policy>
               <type>oracle.toplink.internal.descriptors.InstantiationPolicy</type>
               </descriptor-instantiation-policy>
          </instantiation-policy>
          <query-manager>
               <descriptor-query-manager>
               <existence-check>Check database</existence-check>
               </descriptor-query-manager>
          </query-manager>
          <event-manager>
               <descriptor-event-manager empty-aggregate="true"/>
          </event-manager>
          <mappings>
               <database-mapping>
               <attribute-name>keywords</attribute-name>
               <read-only>false</read-only>
               <get-method-name>getKeywords</get-method-name>
               <set-method-name>setKeywords</set-method-name>
               <field-name>T_ASSET.KEYWORDS</field-name>
               <type>oracle.toplink.mappings.DirectToFieldMapping</type>
               </database-mapping>
               <database-mapping>
               <attribute-name>location</attribute-name>
               <read-only>false</read-only>
               <get-method-name>getLocation</get-method-name>
               <set-method-name>setLocation</set-method-name>
               <field-name>T_ASSET.LOCATION</field-name>
               <type>oracle.toplink.mappings.DirectToFieldMapping</type>
               </database-mapping>
          </mappings>
          <type>oracle.toplink.publicinterface.Descriptor</type>
     </descriptor>
     <descriptor>
          <java-class>edu.rcpsc.cvi.application.itembank.model.asset.AddendumAsset</java-class>
          <descriptor-type-value>Normal</descriptor-type-value>
          <identity-map-class>oracle.toplink.internal.identitymaps.SoftCacheWeakIdentityMap</identity-map-class>
          <remote-identity-map-class>oracle.toplink.internal.identitymaps.SoftCacheWeakIdentityMap</remote-identity-map-class>
          <identity-map-size>100</identity-map-size>
          <remote-identity-map-size>100</remote-identity-map-size>
          <should-always-refresh-cache>true</should-always-refresh-cache>
          <should-always-refresh-cache-on-remote>true</should-always-refresh-cache-on-remote>
          <should-only-refresh-cache-if-newer-version>false</should-only-refresh-cache-if-newer-version>
          <should-disable-cache-hits>false</should-disable-cache-hits>
          <should-disable-cache-hits-on-remote>false</should-disable-cache-hits-on-remote>
          <alias>AddendumAsset</alias>
<inheritance-policy>
<descriptor-inheritance-policy>
<parent-class>edu.rcpsc.cvi.application.itembank.model.asset.Asset</parent-class>
<should-use-class-name-as-indicator>false</should-use-class-name-as-indicator>
</descriptor-inheritance-policy>
</inheritance-policy>
          <copy-policy>
               <descriptor-copy-policy>
               <type>oracle.toplink.internal.descriptors.CopyPolicy</type>
               </descriptor-copy-policy>
          </copy-policy>
          <instantiation-policy>
               <descriptor-instantiation-policy>
               <type>oracle.toplink.internal.descriptors.InstantiationPolicy</type>
               </descriptor-instantiation-policy>
          </instantiation-policy>
          <query-manager>
               <descriptor-query-manager>
               <existence-check>Check database</existence-check>
               </descriptor-query-manager>
          </query-manager>
          <event-manager>
               <descriptor-event-manager empty-aggregate="true"/>
          </event-manager>
          <mappings>
          </mappings>
          <type>oracle.toplink.publicinterface.Descriptor</type>
     </descriptor>

Similar Messages

  • Mapping an attribute to different classes

    I have a class, A that contains an attribute called "state" of type State. Class State is an abstract class that contains 2 methods. Classes ActiveState and CompletedState extend State and none of them have attributes. They only implement the 2 methods. I am having problems trying to map the state attribute of A since the state can be either an ActiveState or a CompletedState. Any suggestions?

    Hi Cynthia,
    I would assume that the State object itself is un-persistentable as there is in fact no persistent attribute defined in either State or it's subclasses.
    If you treat the State as a kind of status flag to A class, you could use Transformation Mapping for the attribute (refer to the manual for the setting of the mapping).
    If you do have persistent attributes in State and/or it's subclasses, you could simply use 1:1 mapping from A to State, and use TopLink inheritance support to map State, ActiveState and CompletedState.
    King

  • Toplink XML: polymorphism/inheritance

    Hi all,
    I have an XML like this (I have replaced the real business names by A, B, C, X ,etc etc)
    [root]
    [collectionOfX]
    [A/]
    [A/]
    [B/]
    [C/]
    [C/]
    [C/]
    [collectionOfX]
    [root]
    On the Java side, A, B and C are concrete classes extending an abstract class X. I have one root class with a collection of Xs.
    I am not able to map this stuff. Toplink requires to have concrete X elements with an attribute telling that it is in fact a A [X xsi:type="A"] and not [A]
    I have seen that substitution groups were a possible way for doing this, how does it work?
    If you have any indication about how to do this stuff, it is very welcome. I have not found any example of this.

    Ok Blaise, the example you provided me is working and I was able to apply the same principle to my project which is now working also.
    I want to share the "tricks" that will make it work for anyone after me who could face the same problem again.
    1. A, B and C must be defined as elements and these elements must be used as both schema context and default root element in the descriptor info pane of the corresponding A, B and C classes. In my case, A, B and C were complexTypes in the schema and it was not working.
    2. The abstract X class was added to the project but its descriptor was de-activated (maybe not really necessary)
    3. I have Mapped the Inherited Attributes for A, B, C concrete classes. It means the X attributes are now appearing in the A, B and C list of attributes in the workbench.
    4. The mapping of all inherited attributes is repeated in the workbench for all concrete classes (a pain if there are many attributes).
    Blaise, if possible I would like to find a better support for this case in future versions of the product. Ideally, the mapping of inherited attributes should be defined only once.
    Thx.
    Robin

  • 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

  • TopLink caching policy and inheritance

    Just looking for some confirmation on TopLink caching policy behavior for descriptors involving inheritance.
    The TopLink workbench allows me to specify the "Identity" policy advanced property for descriptor that involve inheritance (subclasses).
    Subclass descriptors can have different identity policies right?
    I could have some subclasses (descriptors) which I wish to use a FullIdentityMap and other subclasses (descriptors) that I wish to have a SoftCacheWeakIdentityMap?
    Thanks for clarification. The manuals don't really clarify this behavior.
    ...Steve

    TopLink maintains one identity map (cache) per root class. That means that all settings are shared for an inheritance tree and cannot be overridden on a per class basis.
    Doug

  • Object to xml inheritance feature in toplink

    i created a project for object to xml mapping but require "inheritance features to be included ".i tried but it gives --"missing class indicator " and other root error
    any help please

    or send me your email i will mail you the require stuff as its to much to paste here my id is ::[email protected]
    or [email protected]

  • Toplink mapping for one-to-many object inheritance

    Hi
    I currently have a Person object, extended by two specialist classes, PremisesLicenceHolder and PersonalLicenceHolder. I have mapped this in Toplink and it works fine saving a person into the specialist tables using the primary key person_id.
    However, a single Person may be extended any number of times by either one or both of the two specialist types. So, a Person may be a PremisesLicenceHolder many times over for different premises and licences, and also a PersonalLicenceHolder several times over.
    Is it possible to map this object model in Toplink avoiding duplicate person_id primary keys in the specialist tables?
    Thanks

    Hi,
    I am happy that my object model fits the problem domain. The Person and Organisation objects contain base information and have the primary keys person_id and organisation_id. It is important that there is no duplication of person and organisation records, no matter how many times they are saved in different roles.
    There are two types of licenceholder in the problem domain, and the ILicenceHolder interface defines information and methods that are common to both. The PersonalLicenceHolder object represents one of these types of licenceholder, and is always a person, so this class extends Person and implements ILicenceHolder.
    The additional information and methods that are required by the second type of licenceholder are defined in the interface IPremisesLicenceHolder, which extends ILicenceHolder. Premises licence holders can either be people or organisations, so I have two objects to represent these - PremisesLicenceHolderPerson which implements IPremisesLicenceHolder and extends Person, and PremisesLicenceHolderOrganisation which implements IPremisesLicenceHolder and extends Organisation.
    The model is further complicated by the fact that any single Person may be both a PersonalLicenceHolder and a PremisesLicenceHolderPerson, and may be so several times over. In this case, the same basic Person information needs to be linked to several different sets of licenceholder information. In the same way, any single Organisation may be a PremisesLicenceHolderOrganisation several times over.
    Sorry this is complicated!
    My initial idea for the schemas is to have Person and Organisation tables containing the basic information with the primary keys person_id and organisation_id. The Person table would have a one-to-many relationship with both the PersonalLicenceHolder table (pk: personalLicenceHolder_id, fk: person_id), and the PremisesLicenceHolderPerson table (pk: premisesLicenceHolderPerson_id, fk: person_id). There would also be a one-to-many relationship between the Organisation table and the PremisesLicenceHolderOrganisation table (pk: premisesLicenceHolderOrganisation_id, fk: organisation_id).
    I am flexible as to the design of my schema though, as I am happy to adopt any that will facilitate the Toplink Mapping.
    Thanks for your help with this.

  • Toplink and Multiple inheritance

    Hi !
    If 'A' is my root descriptor, 'B' a child descriptor of 'A' and 'C', a child descriptor of 'B'.
    Do I absolutely need to define an indicator mapping for 'C' in 'A' ? Can I define an indicator mapping in a child descriptor for his own child descriptors.
    Thanks in advance,
    Christian Hebert

    No. You must configure the mappings at the root of the hierarchy. Your root table must provide some way to determine which subclass corresponds to a row anyways.
    Doug

  • Inheritance based on USER column and JPQL based on @ManyToOne column

    I wanted to build a simple inheritence scheme for no other reason than to support a generalized table that I could manipulate in standard libraries and to extend that table with columns that might exist in various customer implementations. In the extra-ordinarily simple example that follows I created a base Parcel class; extend that with a ParcelBean which has a column specific to a user; and extend that further with a wrapper class that will include some Trinidad references that I want to keep completely away from the bean classes. In short, I wanted to put together an inheritence scheme for basic OO reasons, not because of any particular table structure.
    After some thought I figured that the best way to do this might be to use the Single-Table Strategy, especially after I discovered that I could fool the system by using the Oracle USER pseudo-column for my DiscriminatorColumn and use my schema name for the DiscriminatorValue.
    @Entity
    @Table(name = "PARCEL")
    @Inheritance
    @DiscriminatorColumn(name = "USER")
    public class Parcel {
      String parcelPin;
      public Parcel() {
      @Id
      @Column(name = "PARCELPIN", nullable = false)
      public String getParcelPin() {
        return parcelPin;
      public void setParcelPin(String parcelPin) {
        this.parcelPin = parcelPin;
    @Entity
    public class ParcelBean extends Parcel {
      LandUseType luc;
      public ParcelBean() {
      public void setLuc(LandUseType newluc) {
        this.luc = newluc;
      @ManyToOne
      @JoinColumn(name = "LUC")
      public LandUseType getLuc() {
        return luc;
    @Entity
    @DiscriminatorValue("CPC")
    public class ParcelRow extends ParcelBean {
      public ParcelRow() {
      public void doSomething(ActionEvent ae) {
        ; // Trinidad code
    }For a couple of weeks this has been working fine. Right up until I tried to a JPQL like the following:
    "select p from ParcelRow p where p.luc.cpcCode=12"The problem is that TOPLINK will generate SQL that prefixes USER with an alias (something it does not do if there isn't a foreign key reference involved). This won't work because Oracle SQL does not allow aliases on pseudo-columns
    select USER from PARCEL; -- return CPC
    select p.USER from PARCEL p; -- throws ORA-01747: invalid user.table.column specificationSo now I'm in a jam. I can't (read won't if you will) give up on my requirement for inheritence. I have multiple clients with the same basic legacy table with minor variations and I have tens of thousands of lines of code that work on the basic core table properties and I don't want to copy and paste. I could use interfaces, except that I would still have to extend the Beans with my Row classes so that I could add the JSF actionListeners (and other such stuff). I need to be able to select Lists of these Row classes with the JSF methods so that I can expose them as values to JSF/Trinidad/ADF Tables and it break every person pattern I enforce to mix JSF and JPA dependencies in the same class.
    Anyone out there have any ideas?
    Thanks Mark

    Of course a simple fix for this problem would be if the Oracle provider code was smart enough to recognize pseudo columns and to not prefix them with an alias.
    Is there any chance that this might be done before a final release?
    Mark

  • 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.

  • 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 and One-To-Many Mapping Issue

    Are there any known issues with TopLink 4.6 mapping a one-to-many relationship where the classes in the list span more than 2 levels deep in the inheritance chain? We seem to notice that TopLink creates the class that is 2 levels deep before the owning class.

    Sorry for the delayed response to your post. I'm not sure I follow what you mean by "owning class". You have a 1-M mapping where the M has inheritance. Are you mapping to the root of the inhertance hierarchy, or to a leaf class? I.e., do you have a 1-M "Company - Employee" or a 1-M "Company - SalariedEmployee". In this example, what would you call the "owning class"?
    - Don

  • Dynamic Query Mapping using Toplink Entity

    Hi,
    We have a requirement that the column names of the table dynamically gets changed for different customers.
    eg;
    Client 1 , will have
    Select EMP_ID, EMP_NAME from EMPLOYEE
    Client 2 will have
    SELECT CEMP_ID, EMP_NAME, CEMP_ADDR from EMPLOYEE
    Is it possible to make a Toplink Entity Employee object to support both the queries at runtime ?ie; we should not modify the java entity object for each customer.
    With normal JDBC , we can perform SELECT * from EMPLOYEE ,get the resultset , and using metadata , we can find the column names and process it accordingly.
    Is this functionality possible with toplink JPA at all ?
    Thanks
    prabu

    Hi,
    I am trying to use DynamicEntity class. Is Joined Table Inheritance supported in DynamicEntity ? Since I need to create an HybridEntity on the fly by selecting all the fields from TABLE A and TABLE B by joining key fields, whose fields will dynamically change based upon the customer. Below is what I am currently trying to do. But the Entity Object that I got contains fields only from TABLE A and not from TABLE B
    EntityManagerFactory emf = new EntityManagerFactoryImpl(setup,EclipseLinkJPATest.getEMFProperties());
    SchemaManager manager = new SchemaManager(JpaHelper.getServerSession(emf));
    Vector <DatabaseRecord>tableAEntityFieldNames = manager.getAllColumnNames("TABLE A");
    Vector <DatabaseRecord>tableBFieldNames = manager.getAllColumnNames("TABLE B");
    EntityType tableAType = EntityTypeFactory.create("TableAEntity","DynamicEntity$TableAEntity", "TABLE A", loader);
    String columnName = null;
    for(DatabaseRecord tableAObj: tableAEntityFieldNames){
    columnName = tableAObj.get("COLUMN_NAME").toString();
    EntityTypeFactory.addBasicProperty(tableAType, columnName, columnName,
    "TABLE A_ID".equals(columnName) ? Long.class : String.class, "TABLE A_ID".equals(columnName) ? true : false);
    EntityTypeFactory.addToPersistenceUnit(emf, tableAType);
    EntityType stepType = EntityTypeFactory.create("TableBEntity","DynamicEntity$TableBEntity", "TABLE B", loader);
    for(DatabaseRecord tableBObj: tableBEntityFieldNames) { 
    columnName = tableBObj.get("COLUMN_NAME").toString();
    EntityTypeFactory.addBasicProperty(tableBType, columnName, columnName,"TABLE B_ID".equals(columnName) ? Long.class : String.class, "TABLE B_ID".equals(columnName) ? true : false);
    EntityTypeFactory.addToPersistenceUnit(emf, tableBType);
    EntityManager em = emf.createEntityManager();
    List <DynamicEntity> entityList = null;
    entityList = em.createQuery("select s from TableAEntity s, TableBEntity st where s.TABLE A_ID= st.TABLE B_IDand s.TABLE A_ID=?1")
              .setParameter(1, 1397)
              .getResultList();
    System.out.println("entityList..."+entityList);
    Thanks
    Prabu

  • Mapping Database using Oracle Toplink 10.1.3.3.0

    Hi everybody, I'd like to use Oracle TopLink to do mapping my database and here is the database's script
    1F.sql
    ==========
    @@case1F.typ
    @@case1F.tab
    @@case1F.con
    1F.typ
    ==========
    CREATE TYPE TCUSTOMER
    CREATE TYPE TMEMORY
    CREATE TYPE TPHONE
    CREATE TYPE TNAME
    CREATE TYPE TMOTHERBOARD
    CREATE TYPE TADDRESS
    PROMPT Creating Object Type 'TNAME'
    CREATE OR REPLACE TYPE TNAME AS OBJECT
    (FIRST VARCHAR2(240)
    ,LAST VARCHAR2(240)
    SHOW ERROR
    PROMPT Creating Object Type 'TMOTHERBOARD'
    CREATE OR REPLACE TYPE TMOTHERBOARD AS OBJECT
    (KODE VARCHAR2(240)
    ,SERIES VARCHAR2(240)
    ,MERK VARCHAR2(240)
    ,VGA VARCHAR2(240)
    SHOW ERROR
    PROMPT Creating Object Type 'TMEMORY'
    CREATE OR REPLACE TYPE TMEMORY AS OBJECT
    (KODE VARCHAR2(240)
    ,MERK VARCHAR2(240)
    ,TIPE VARCHAR2(240)
    ,UKURAN VARCHAR2(240)
    SHOW ERROR
    PROMPT Creating Object Type 'TADDRESS'
    CREATE OR REPLACE TYPE TADDRESS AS OBJECT
    (STREET VARCHAR2(240)
    ,CITY VARCHAR2(240)
    SHOW ERROR
    PROMPT Creating Object Type 'TPHONE'
    CREATE OR REPLACE TYPE TPHONE AS OBJECT
    (CODE VARCHAR2(240)
    ,DIGIT VARCHAR2(240)
    SHOW ERROR
    PROMPT Creating Object Type 'TCUSTOMER'
    CREATE OR REPLACE TYPE TCUSTOMER AS OBJECT
    (USERNAME VARCHAR2(240)
    ,NAME TNAME
    ,ADDRESS TADDRESS
    ,PHONE TPHONE
    ,TYPE NUMERIC(1)
    ,EMAIL VARCHAR2(240)
    SHOW ERROR
    1F.tab
    ==========
    PROMPT Creating Table 'DTRANSAKSI'
    CREATE TABLE DTRANSAKSI
    (CPU_KODBERG VARCHAR2(6) NOT NULL
    ,HTI_NONOTA VARCHAR2(4) NOT NULL
    ,JMLBRG NUMERIC
    PROMPT Creating Table 'CPU'
    CREATE TABLE CPU
    (KODBERG VARCHAR2(6) NOT NULL
    ,NAMA VARCHAR2(240)
    ,MEMORY REF TMEMORY
    ,MOTHERBOARD REF TMOTHERBOARD
    ,HARGA NUMERIC
    ,KET CLOB
    ,VERSI VARCHAR2(240)
    PROMPT Creating Table 'HTRANSAKSI'
    CREATE TABLE HTRANSAKSI
    (NONOTA VARCHAR2(4) NOT NULL
    ,USERNAME REF TCUSTOMER
    ,TGLTRANS DATE
    ,VERSI VARCHAR2(240)
    ,CONSTRAINT HTI_PK PRIMARY KEY
    (NONOTA)
    ORGANIZATION INDEX
    PROMPT Creating Table 'MEMORY'
    CREATE TABLE MEMORY OF TMEMORY
    (KODE NOT NULL
    PROMPT Creating Table 'MOTHERBOARD'
    CREATE TABLE MOTHERBOARD OF TMOTHERBOARD
    (KODE NOT NULL
    PROMPT Creating Table 'CUSTOMER'
    CREATE TABLE CUSTOMER OF TCUSTOMER
    ALTER TABLE CPU
    ADD (SCOPE FOR (MEMORY) IS MEMORY)
    ALTER TABLE CPU
    ADD (SCOPE FOR (MOTHERBOARD) IS MOTHERBOARD)
    ALTER TABLE HTRANSAKSI
    ADD (SCOPE FOR (USERNAME) IS CUSTOMER)
    1F.conn
    ===================
    PROMPT Creating Primary Key on 'DTRANSAKSI'
    ALTER TABLE DTRANSAKSI
    ADD (CONSTRAINT DTI_PK PRIMARY KEY
    (HTI_NONOTA
    ,CPU_KODBERG))
    PROMPT Creating Primary Key on 'CPU'
    ALTER TABLE CPU
    ADD (CONSTRAINT CPU_PK PRIMARY KEY
    (KODBERG))
    PROMPT Creating Foreign Key on 'DTRANSAKSI'
    ALTER TABLE DTRANSAKSI ADD (CONSTRAINT
    DTI_HTI_FK FOREIGN KEY
    (HTI_NONOTA) REFERENCES HTRANSAKSI
    (NONOTA))
    PROMPT Creating Foreign Key on 'DTRANSAKSI'
    ALTER TABLE DTRANSAKSI ADD (CONSTRAINT
    DTI_CPU_FK FOREIGN KEY
    (CPU_KODBERG) REFERENCES CPU
    (KODBERG))
    I found an error in ORACLE TOPLINK while adding table CUSTOMER, MOTHERBOARD and MEMORY from database to workbench. Any idea how to solve that error?
    And other questions:
    1. Does Toplink support inheritance and aggregation object table modelling? If it doesn't, what should I do?
    2. Is there any example or tutorial using Toplink Foundation Library?
    Thanks a lot.

    What error do you get in the MW?
    TopLink does support object-relational data-types, but the Mapping Workbench does not have support for object-relational data-types, so you may need to define your mappings through the TopLink Descriptor and Mapping Java code API. There is a section on object-relational data-type mappings in the TopLink User Guide.
    -- James : http://www.eclipselink.org

  • Toplink essentials overwhelming bug(s)

    Hello.
    I'm working on EJB3 project running on Glassfish application server that uses Toplink Essentials as persistance engine.
    In the project there is User entity and some entities inherited from User such as Operator, Vendor, Client, etc... And there is StoredMessage entity. StoredMessage has two attributes (sender, recepient) of User class.
    And the problem is: when trying to persist StoredMessage object via entity manager i'm getting an error like "Cannot persist detached object Operator"... but that is gibberish thing. The User objects are not detached (for test purposes I even merged them vie entity manage just befor StoredMessage persisting) and i'm not working with Operator object there, I'm working with User object, that's most interesting thing.
    I decided to make a temporary workaround and store sender and recepient's IDs int StoredMessage class insted of User object references... But i didn't want to change interfaces in my program, so I leaved old getters and setters for sender and recepient, annotated them transient and changed to get these User objects transparrently through entity menager (I know, that's not a good architectural solution).
    Afrer that Toplink become insane :) I got an error that java.util.Date property in my StoredMessage class is not annotated with a @Temporal, but in code everything was ok. I removed all the code related to that date field and after that I got another error: it said i have to annotate ID field with @Id, but it also was annotated correctly.
    When I'm setting sender and recepient fields to null everything works all right and entity manager persists my StoredMessage object with no problem.
    That bugs are very weird, I haven't seen anything like this... And i'm working on this project for two months, there are about 30 other entities with different relation types in the project and everything works all right and doesn't have any problem with entity manager. Today i've got the first bug.
    Does anybody seen something like this? Do you know how to fix it?
    There is another workaround in my mind, i can just use pure JDBC for StoredMessage objects persistance, but such solution has a number of disadvantages and I have no guarantee that such bugs won't happen with new entities in the project.

    Thank you for reply!
    Do sender and recipient use the same Foreign key? Do you have cascade persist set?Humm, yes, they both the same foreign key. Yes, i have "(cascade = {CascadeType.ALL})" if you mean that.
    Can you please post the relevant Portions of the java and annotations and I can take a closer look.Sure, http://lab37.com/xchng/javacode.zip -- here is archive with User entity, StoredMessage entity and just in case i put Operator (extends User) entity there.

Maybe you are looking for

  • Lumia 1520 Battery Discharge Issue After Updating ...

    After updating to Denim, my Nokia Lumia 1520 started to experience the following symptoms: Phone charges to 100%, I disconnect and use an app like Instagram BETA, Internet Explorer, Lumia Camera, or any game--after no more than 5 minutes of use, the

  • New mac vs. replace hard drive?

    My iMac hard drive totally died, crashed, stopped working. : ( Do you suggest getting a totally new computer or just replacing the hard drive? What are the advantages/disadvantages of either choice (cost, difficulty, etc.)

  • Problem with debug config

    cisco 2651XM router IOS: c2600-adventerprisek9-mz.124-15.T9.bin I have a mail-and-web server set at 192.168.0.6 connected to fa0/0 on my router and I want to monitor all traffic in and out of the server. The best debug config I've found so far for th

  • Creating hyperlinks in Incopy

    I have created hyperlinks in Incopy and tested them using the hyperlinks panel. The links work. However, when I export to PDF from Incopy, the hyperlinks are not there. I noticed when exporting the PDF from Incopy, there is no option in include hyper

  • Tivolo storage manager error message is Database Cache Hit Ratio is too low

    Hi  basis friends,we are performing incremental backup from mon-fri.from past two days i was getting error message as 'data base cache hit ratio is too low (97.3,98)and increase buffer pool size value.what is the problem for this error message? how c