-->
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.  [ 1 post ] 
Author Message
 Post subject: Composite-id without class
PostPosted: Mon Apr 25, 2005 11:29 am 
Newbie

Joined: Mon Apr 25, 2005 11:01 am
Posts: 1
Hi!

I use hibernate3 mapping files for export DB schema without use the class for reflection, only the XML files.
But when I use composite-id :
Code:
<class name="TSectionXItem" table="TSection_X_Item" >
  <composite-id name="id" class="TSectionXItemPK">
     <key-many-to-one
            name="section" column="codSection"
            class="TSection"     
            foreign-key="FK_SECTION_X_ITEM_1"/>
     <key-many-to-one
            name="item" 
            column="codItem"
            class="TItem"
            foreign-key="FK_SECTION_X_ITEM_2"/>
  </composite-id>
  <property name="itemOrder" type="integer"  not-null="true"/>
</class>


always throw an HibernateException (ClassNotFound):

Code:
org.hibernate.MappingException:
component class not found:
org.osid.atril.services.datos.TSectionXItemPK
   at org.hibernate.mapping.Component.getComponentClass(Component.java:101)
   at org.hibernate.tuple.PojoComponentTuplizer.buildGetter(PojoComponentTuplizer.java:105)
   at org.hibernate.tuple.AbstractComponentTuplizer.<init>(AbstractComponentTuplizer.java:40)
....
Caused by: java.lang.ClassNotFoundException: org.osid.atril.services.datos.TSectionXItemPK
....


The solution that i find is generate the class (class generation without error) and then i can generate the DB schema.
¿Its posible do it without the first step of class generation? (always generate the DB script correctly without the .class files if i don't use composite-id)

The DB schema generation:
Code:
   Configuration cfg = new Configuration();
   cfg.configure("/hibernate.cfg.xml");
   SchemaExport schemaExport = new SchemaExport(cfg);
   schemaExport.create(true, true);


Thanks you for your response.

-- I'm sorry for my English. :P


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.