-->
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.  [ 6 posts ] 
Author Message
 Post subject: Problems with composite-id
PostPosted: Fri Feb 06, 2004 9:38 am 
Beginner
Beginner

Joined: Thu Jan 22, 2004 6:16 am
Posts: 40
Location: Luxembourg
I am using Hibernate V2.0. My mapping for a class looks like this :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping.dtd">

<hibernate-mapping>
<class name="deploy.payments.BPOPaymentDecisionBean" table="bpo_payment_decision">
<!--<jcs-cache usage="read-write"/>-->

<composite-id>
<property name="ManagementCompany" column="ManagementCompany" type="string" length="10" not-null="true" unique="false"/>
<property name="FundSponsor" column="FundSponsor" type="string" length="50" not-null="true" unique="false"/>
<property name="FundID" column="FundID" type="string" length="35" not-null="true" unique="false"/>
<property name="TransactionType" column="TransactionType" type="string" length="15" not-null="true" unique="false"/>
</composite-id>

<property name="id" column="id" type="string" length="32" not-null="true" unique="false"/>
<property name="WireType" column="WireType" type="string" length="15" not-null="true" unique="false"/>
<property name="ChequeType" column="ChequeType" type="string" length="15" not-null="true" unique="false"/>
</class>
</hibernate-mapping>

But I got the following exception :

org.xml.sax.SAXParseException: The content of element type "composite-id" must match "(key-property|key-many-to-one)+".

Ideas ?

Thanks in advance !


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 06, 2004 9:39 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Can you read?

org.xml.sax.SAXParseException: The content of element type "composite-id" must match "(key-property|key-many-to-one)+".

Use key-property, not property inside of composite-did


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 06, 2004 9:50 am 
Beginner
Beginner

Joined: Thu Jan 22, 2004 6:16 am
Posts: 40
Location: Luxembourg
Oops, sorry..I did paste the wrong mapping file.
Here it is, and I still have the same problem :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping.dtd">

<hibernate-mapping>
<class name="deploy.payments.BPOPaymentDecisionBean" table="bpo_payment_decision">
<!--<jcs-cache usage="read-write"/>-->

<composite-id>
<key-property name="ManagementCompany" column="ManagementCompany" type="string" length="10" not-null="true" unique="false"/>
<key-property name="FundSponsor" column="FundSponsor" type="string" length="50" not-null="true" unique="false"/>
<key-property name="FundID" column="FundID" type="string" length="35" not-null="true" unique="false"/>
<key-property name="TransactionType" column="TransactionType" type="string" length="15" not-null="true" unique="false"/>
</composite-id>

<property name="id" column="id" type="string" length="32" not-null="true" unique="false"/>
<property name="WireType" column="WireType" type="string" length="15" not-null="true" unique="false"/>
<property name="ChequeType" column="ChequeType" type="string" length="15" not-null="true" unique="false"/>
</class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 06, 2004 11:35 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Remove the comment, and try again

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 06, 2004 2:11 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
And use a proper doctype declaration for 2.0:
Code:
<!DOCTYPE hibernate-mapping PUBLIC
   "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
   "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 06, 2004 2:23 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Forget my post. Michael is right

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.