-->
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-element inside component
PostPosted: Fri Dec 17, 2004 10:25 am 
Newbie

Joined: Fri Oct 08, 2004 5:29 am
Posts: 8
I have a class Document that has a component of type MetaInfo. MetaInfo itself maintains a list of entries (class MetaInfoEntry).

I get the following exception:
No persister for: org.tdr.document.MetaInfoEntry

Why do I need a persister for this class?

Here is the mapping I use:

Code:
<hibernate-mapping>
  <class name="eg.GenericDocumentData" table="document_values">

    ....

    <component name="metaInfo" class="eg.MetaInfo">

      <list name="entries" table="documents_meta_info"
            cascade="all-delete-orphan">

        <key column="document_id" />

        <index column="idx" />

        <composite-element class="eg.MetaInfoEntry">

          <property name="element" type="java.lang.String" not-null="true" />
          <property name="qualifier" type="java.lang.String" />
          <property name="value" type="java.lang.String" not-null="true" />

        </composite-element>

      </list>

    </component>

    ....

  </class>

</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 17, 2004 10:27 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
You get that error when you do what, exactly??

Where is your stack trace??


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 17, 2004 10:39 am 
Newbie

Joined: Fri Oct 08, 2004 5:29 am
Posts: 8
The error occurs when I try to save a newly created Document instance using saveOrUpdate().

Here's the stack trace:

Caused by: net.sf.hibernate.MappingException: No persister for: eg.MetaInfoEntry
net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java:347)
net.sf.hibernate.impl.SessionImpl.getClassPersister(SessionImpl.java:2690)
net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2697)
net.sf.hibernate.impl.SessionImpl.isSaved(SessionImpl.java:2734)
net.sf.hibernate.collection.PersistentCollection.getOrphans(PersistentCollection.java:753)
net.sf.hibernate.collection.List.getOrphans(List.java:42)
net.sf.hibernate.impl.SessionImpl.getOrphans(SessionImpl.java:3251)
net.sf.hibernate.engine.Cascades.deleteOrphans(Cascades.java:542)
net.sf.hibernate.engine.Cascades.cascadeCollection(Cascades.java:533)
net.sf.hibernate.engine.Cascades.cascade(Cascades.java:452)
net.sf.hibernate.engine.Cascades.cascade(Cascades.java:464)
net.sf.hibernate.engine.Cascades.cascade(Cascades.java:503)
net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:952)
net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:857)
net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:779)
net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:738)
net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1388)
net.sf.hibernate.engine.Cascades$4.cascade(Cascades.java:114)
net.sf.hibernate.engine.Cascades.cascade(Cascades.java:436)
net.sf.hibernate.engine.Cascades.cascade(Cascades.java:503)
net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:890)
net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:857)
net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:779)
net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:738)
net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1388)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 17, 2004 11:07 am 
Newbie

Joined: Fri Oct 08, 2004 5:29 am
Posts: 8
OK, I've just figured out that it works when I use cascade="all" instead of cascade="all-delete-orphan".

So, what's the problem with all-delete-orphan in this case? I really would like the orphans to be deleted when I save a document.


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.