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