-->
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.  [ 2 posts ] 
Author Message
 Post subject: composite-element
PostPosted: Mon Nov 10, 2003 5:44 am 
Newbie

Joined: Wed Aug 27, 2003 4:39 am
Posts: 10
I am using mysql. I have the follwing mapping file. Here FullArticle extends from Article. Also FullArticle has a collection of authors which are mapped using composite element.
When I load FullArticle and do a
Collection authors = fullArticle.getAuthors(), null value for authors is returned

<class name="org.bsms.persistence.jdo.Article" table="article" proxy="org.bsms.persistence.jdo.Article">
<id name="id" column="article_id" type="java.lang.Long" unsaved-value="null">
<generator class="native">
<param name="native">article_seq</param>
</generator>
</id>
<property name="subject" column="subject" type="string"/>
<many-to-one name="type" column="article_type_id" class="org.bsms.persistence.jdo.ArticleType"/>
<property name="wordCount" column="word_count" type="integer"/>
.....
<many-to-one name="journal" column="journal_id" class="org.bsms.persistence.jdo.JournalJDO" cascade="none" outer-join="false"/>

<joined-subclass name="org.bsms.persistence.jdo.FullArticle" table="full_article" proxy="org.bsms.persistence.jdo.FullArticle">
<key column="full_article_id"/>
<property name="keyWords" column="keyWords" type="string"/>
<bag name="authors" table="author" lazy="true">
<key column="full_article_id"/>
<composite-element class="org.bsms.persistence.jdo.AuthorJDO">
<property name="firstName" column="first_name" type="string"/>
<property name="surName" column="sur_name" type="string"/>
</composite-element>
</bag>
<many-to-one name="category" column="category_id" class="org.bsms.persistence.jdo.ArticleCategory" cascade="none" outer-join="false"/>
</joined-subclass>

</class>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 10, 2003 7:33 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Check your getters and setters.

as per the forum entrance
Quote:
If you have code thats misbehaving, the quickest way to a solution is to provide:
* your mapping document(s)
* the code between sessionFactory.openSession() and session.close()
* a TRACE level Hibernate log (see the FAQ for instructions on enabling logging)


It's hard to do divination.

_________________
Emmanuel


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