-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: composite-id and joined-subclasses
PostPosted: Sun Aug 15, 2004 8:54 am 
Beginner
Beginner

Joined: Tue Mar 30, 2004 5:54 am
Posts: 22
Location: Bangalore
Gentlemen

Hibernate version:
hibernate 2.1.5

Mapping documents:
Code:
<hibernate-mapping>
    <class name="com.domain.ectd.bpms.dao.views.BudgetView"
          table="BPMS_V_BUDGET"
          dynamic-update="false"
          dynamic-insert="false" >
       <composite-id class="com.domain.ectd.bpms.dao.views.BudgetViewPK">
      <key-property name="budgetYear" column="BUDGET_YEAR" access = "field" type="date" insert="false" />
      <key-many-to-one name="organisation" class="com.domain.ectd.bpms.dao.domains.Organisation" column="ORG_CODE" access = "field"/>
      <key-many-to-one name="costElement" class="com.domain.ectd.bpms.dao.domains.CostElements" column="ELEMENT_ID" access = "field"/>       
       </composite-id>

       
   <joined-subclass name="com.domain.ectd.bpms.dao.views.LaborActualsView" table = "BPMS_V_LABOR_ACTUALS"
               lazy="true"
          dynamic-insert="false"
          dynamic-update="false" >
     <key>
        <column name="BUDGET_YEAR" />
        <column name="ORG_CODE" />
        <column name="ELEMENT_ID" />
     </key>
          <property name="actuals" column="ACTUALS" access="field"  type="double"  />
          <property name="laborHours" column="LABOR_HOURS" access="field" type="double"/>
          <property name="overTime" column="OVER_TIME" access="field" type="double"/>
          <many-to-one name="plannedData" class="com.domain.ectd.bpms.dao.views.LaborPlannedView" >
      <column name="BUDGET_YEAR"  />
          <column name="ORG_CODE" />
          <column name="ELEMENT_ID" />               
          </many-to-one>
   </joined-subclass>       

<hibernate-mapping>


Code between sessionFactory.openSession() and session.close():
Code:
            sfSessionFactory = new Configuration().configure()
                    .buildSessionFactory();


Full stack trace of any exception that occurs:
[@APPNAME@] ERROR [AWT-EventQueue-0] XMLHelper$ErrorLogger.error(48) | Error parsing XML: XML InputStream(12) Attribute "insert" must be declared for element type "key-property".
net.sf.hibernate.MappingException: Error reading resource: com/domain/ectd/bpms/dao/views/BudgetView.hbm.xml
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:336)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:990)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:946)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:908)
at net.sf.hibern8ide.Hibern8IDE.reconfig(Hibern8IDE.java:189)
at net.sf.hibern8ide.Hibern8IDE$6.configurationChanged(Hibern8IDE.java:666)
at net.sf.hibern8ide.ConfigurationUI$ApplyConfig.actionPerformed(ConfigurationUI.java:277)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
Caused by: net.sf.hibernate.MappingException: invalid mapping
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:284)
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:333)
... 29 more
Caused by: org.xml.sax.SAXParseException: Attribute "insert" must be declared for element type "key-property".
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:339)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:283)
... 30 more


Name and version of the database you are using:
Oracle 9i

Debug level Hibernate log excerpt:
DEBUG

There is only one place I have key-property in this document, and I do have insert attribute in it. But I am still getting this message.

I have please insert="false" and update="false" in all the possible locations, but still I am getting this error message.

Please help.

_________________
Thanks
Irfani


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 16, 2004 6:37 am 
Beginner
Beginner

Joined: Tue Mar 30, 2004 5:54 am
Posts: 22
Location: Bangalore
Help on this issue please.

_________________
Thanks
Irfani


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 16, 2004 6:43 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
remove it from the key-property and put it somewher else if you really need it.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 18, 2004 4:19 am 
Beginner
Beginner

Joined: Tue Mar 30, 2004 5:54 am
Posts: 22
Location: Bangalore
Thanks I ll have a look at it.

_________________
Thanks
Irfani


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.