-->
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: MappingException: No persister for CompositeUserType
PostPosted: Mon Nov 17, 2003 7:48 am 
Newbie

Joined: Tue Oct 28, 2003 8:00 am
Posts: 16
Location: Karlsruhe, Germany
hi,

we use a CompositeUserType and have problems in some
of our persistent classes.

I get the Exception
net.sf.hibernate.MappingException: No persister for:
xxx.app.vo.C6Betrag within net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java:342)

when I try to session.save an object of class LebenshaltungskostenVO
which contains properties of a CompositeUserType C6Betrag.

I think we need no mapping for C6Betrag and no persister class and
we use this CompositeUserType in other classes without problems (eg in LebenshaltungskostentabelleVO)

Why do I get this exception in this case ?


our mapping is
LebenshaltungskostenVO

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class
name="xxx.app.vo.LebenshaltungskostenVO"
table="LEBENSHALTUNGSKOSTEN"
dynamic-update="false"
dynamic-insert="false"
>
<id
name="id"
column="VOID"
type="string"
length="32"
unsaved-value="null"
>
<generator class="uuid.hex">
</generator>
</id>
<property
name="mehrverdienst"
type="xxx.app.vo.C6Betrag"
update="true"
insert="true"
>
<column
name="MVERDBTR"
/>
<column
name="MVERDWHG"
length="3"
/>
</property>

<property
name="pauschalKosten1"
type="xxx.app.vo.C6Betrag"
update="true"
insert="true"
>
<column
name="PAUSCH1BTR"
/>
<column
name="PAUSCH1WHG"
length="3"
/>
</property>

<property
name="pauschalKosten2"
type="xxx.app.vo.C6Betrag"
update="true"
insert="true"
>
<column
name="PAUSCH2BTR"
/>
<column
name="PAUSCH2WHG"
length="3"
/>
</property>

<property
name="pauschalKosten3"
type="xxx.app.vo.C6Betrag"
update="true"
insert="true"
>
<column
name="PAUSCH3BTR"
/>
<column
name="PAUSCH3WHG"
length="3"
/>
</property>

<property
name="pauschalKosten4"
type="xxx.app.vo.C6Betrag"
update="true"
insert="true"
>
<column
name="PAUSCH4BTR"
/>
<column
name="PAUSCH4WHG"
length="3"
/>
</property>

<property
name="pauschalKostenWeitere"
type="xxx.app.vo.C6Betrag"
update="true"
insert="true"
>
<column
name="PAUSCHWBTR"
/>
<column
name="PAUSCHWWHG"
length="3"
/>
</property>

<list
name="tabelle"
lazy="false"
inverse="false"
cascade="all"
>

<key
column="LHK_ID"
/>

<index
column="LHKTAB_ID"
type="integer"
/>

<one-to-many
class="xxx.app.vo.LebenshaltungskostentabelleVO"
/>
</list>

<property
name="zuschlag"
type="xxx.app.vo.C6Betrag"
update="true"
insert="true"
>
<column
name="ZUSCHLAG"
/>
<column
name="ZUSCHLAGWHG"
length="3"
/>
</property>


</class>

</hibernate-mapping>


<?xml version="1.0"?>

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>
<class
name="xxx.app.vo.LebenshaltungskostentabelleVO"
table="LHKTABELLE"
dynamic-update="false"
dynamic-insert="false"
>

<id
name="id"
column="VOID"
type="string"
length="32"
unsaved-value="null"
>
<generator class="uuid.hex">
</generator>
</id>

<timestamp
name="aenderungszeitpunkt"
column="TIME_MODIFIED"
/>

<property
name="betrag"
type="xxx.app.vo.C6Betrag"
update="true"
insert="true"
>
<column
name="BTR"
/>
<column
name="BTRWHG"
length="3"
/>
</property>

<property
name="kosten1"
type="xxx.app.vo.C6Betrag"
update="true"
insert="true"
>
<column
name="KS1BTR"
/>
<column
name="KS1WHG"
length="3"
/>
</property>

<property
name="kosten2"
type="xxx.app.vo.C6Betrag"
update="true"
insert="true"
>
<column
name="KS2BTR"
/>
<column
name="KS2WHG"
length="3"
/>
</property>

<property
name="kosten3"
type="xxx.app.vo.C6Betrag"
update="true"
insert="true"
>
<column
name="KS3BTR"
/>
<column
name="KS3WHG"
length="3"
/>
</property>

<property
name="kosten4"
type="xxx.app.vo.C6Betrag"
update="true"
insert="true"
>
<column
name="KS4BTR"
/>
<column
name="KS4WHG"
length="3"
/>
</property>

<property
name="kostenWeitere"
type="xxx.app.vo.C6Betrag"
update="true"
insert="true"
>
<column
name="KSWBTR"
/>
<column
name="KSWWHG"
length="3"
/>
</property>
</class>

</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 18, 2003 1:08 pm 
Beginner
Beginner

Joined: Wed Oct 08, 2003 6:34 am
Posts: 29
Have you found any answer?
I've got the same problem here and I cannot find a solution.

Regards
Jose


Top
 Profile  
 
 Post subject: My fault
PostPosted: Tue Nov 18, 2003 1:21 pm 
Beginner
Beginner

Joined: Wed Oct 08, 2003 6:34 am
Posts: 29
In this case it was my fault: I was incorrectly adding the composite type to a collection that expected another type, so that raised the exception in Hibernate. Maybe you have the same problem?

Regards
Jose


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 19, 2003 3:51 pm 
Newbie

Joined: Tue Oct 28, 2003 8:00 am
Posts: 16
Location: Karlsruhe, Germany
yes,

I put the wrong element in the collection,
it should contain a entity with a property C6Betrag and I had put the property of type C6Betrag.

thanks


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.