-->
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.  [ 3 posts ] 
Author Message
 Post subject: SchemaExport tool requires composite.class field?
PostPosted: Wed Jan 12, 2005 10:21 pm 
Newbie

Joined: Wed Jan 12, 2005 10:04 pm
Posts: 1
Hi everyone,

I am using the SchemaExport tool with the following mapping:

<hibernate-mapping package="com.frs.model">
<class name="CustomerAttribute" table="customer_attribute">
<composite-id
name="customer_attribute_pk"
unsaved-value="none">
<key-property name="customerId" type="integer" column="customer_id"/>
<key-property name="name" column="name" type="string" length="256"/>
<key-property name="value" column="value" type="string" length="256"/>
</composite-id>

<property
column="create_dt"
name="createDt"
not-null="true"
type="date"
/>

<many-to-one name="customer" class="Customer" column="customer_id" foreign-key="customer__id_fk1"/>
</class>
</hibernate-mapping>


I recieve the following error when I run the SchemaExport tool:

net.sf.hibernate.PropertyNotFoundException: field not found: customer_attribute_pk
at net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:74)
at net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:80)
at net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:80)
at net.sf.hibernate.property.DirectPropertyAccessor.getGetter(DirectPropertyAccessor.java:88)
at net.sf.hibernate.util.ReflectHelper.getter(ReflectHelper.java:81)
at net.sf.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:90)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:286)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1256)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:252)
at net.sf.hibernate.cfg.Configuration.addFile(Configuration.java:174)
at net.sf.hibernate.tool.hbm2ddl.SchemaExport.main(SchemaExport.java:289)


Seems the tool is looking for the composite-id class, which I do not want to define since it generates an unnecessary class. Anyway to get around this?

i.e. if I edit the composite key to:

<composite-id
name="customer_attribute_pk"
unsaved-value="none"
class="something">
<key-property name="customerId" type="integer" column="customer_id"/>
<key-property name="name" column="name" type="string" length="256"/>
<key-property name="value" column="value" type="string" length="256"/>
</composite-id>

The error goes away.

Thanks!

Scott.


Top
 Profile  
 
 Post subject: I'am sorry . I've find the way to do what I want.
PostPosted: Wed Jan 19, 2005 1:38 am 
Regular
Regular

Joined: Sat Apr 10, 2004 8:39 pm
Posts: 84
I'am sorry . I've find the way to do what I want.

_________________
I am the creatxr of world.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 19, 2005 2:06 am 
Regular
Regular

Joined: Sat Apr 10, 2004 8:39 pm
Posts: 84
sorry , I've post error.

I also want to know that...

It seems hbm2ddl can't work without PK class.

have you find the way to do that?

_________________
I am the creatxr of world.


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