-->
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: Hibernate with DynaBeans
PostPosted: Wed Sep 24, 2003 12:44 pm 
Newbie

Joined: Wed Sep 24, 2003 12:41 pm
Posts: 2
Does anyone have an example of how to configure hibernate to use a DynaBean? Currently I have:

<class name="test.Author" table="Author">

<id name="id" type="long" column="author_id" >
<generator class="sequence">
<param name="sequence">author_author_id_seq</param>
</generator>
</id>

<property name="name"/>

</class>

in my Author.hbm.xml file for a DynaBean of:

DynaProperty[] props = new DynaProperty[] { new DynaProperty("name"), new DynaProperty("id") };
DynaBean a = new BasicDynaBean(new BasicDynaClass("Author", BasicDynaBean.class, props));

Trying to store an Author dynabean in the database gives me:

Exception in thread "main" net.sf.hibernate.MappingException: No persister for: org.apache.commons.beanutils.BasicDynaBean

I can see in the manual that there is a dynabean tag, but there's no example of where it should go.


Top
 Profile  
 
 Post subject: Newbie.
PostPosted: Wed Sep 24, 2003 2:01 pm 
Newbie

Joined: Wed Sep 24, 2003 12:41 pm
Posts: 2
I'm an idiot. Found it in another part of the manual:

6.5. Dynabean components

http://www.hibernate.org/hib_docs/refer ... nents-s2-4


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.