-->
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: How should I map component superclass fields?
PostPosted: Wed Sep 22, 2004 5:40 am 
Newbie

Joined: Tue Apr 13, 2004 6:41 am
Posts: 19
Hibernate version:
2.1.6
Mapping documents:
<hibernate-mapping package="bom.test.bomjdo.infrastructure" default-cascade="save-update">
<class name="BuildingHibernate" discriminator-value="Building.bomjdo.test.bom" optimistic-lock="version" table="BUILDING">
...
<component name="owner" access="field">
<property name="name" access="field" column="owner_name"/>
<property name="lastname" access="field" column="owner_lastname"/>
</component>
</class>
</hibernate-mapping>

Exception:

INFO main net.sf.hibernate.cfg.Configuration - Mapping resource: bom/test/bomjdo/infrastructure/BuildingHibernate.hbm.xml
INFO main net.sf.hibernate.cfg.Binder - Mapping class: bom.test.bomjdo.infrastructure.BuildingHibernate -> BUILDING
ERROR main net.sf.hibernate.cfg.Configuration - Could not compile the mapping document
net.sf.hibernate.PropertyNotFoundException: field not found: name
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.getSetter(DirectPropertyAccessor.java:93)
at net.sf.hibernate.mapping.Property.getSetter(Property.java:178)
at net.sf.hibernate.cfg.Binder.bindComponent(Binder.java:905)
at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:1052)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:362)
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.addInputStream(Configuration.java:288)
at net.sf.hibernate.cfg.Configuration.addClass(Configuration.java:354)
at com.exigen.bom.hibernate.runtime.HibernateDBTool.generate(HibernateDBTool.java:37)
at com.exigen.bom.hibernate.runtime.HibernateDBTool.generateSchema(HibernateDBTool.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.exigen.bom.eclipse.Launchable.launch(Launchable.java:80)
at com.exigen.bom.eclipse.Launchable.main(Launchable.java:34)


public class BuildingHibernate implements Building {
...
protected OwnerImpl owner;
}

public class OwnerImpl extends PeopleImpl
implements Owner
{

public OwnerImpl()
{
}

}

public class PeopleImpl
implements People
{


public PeopleImpl()
{
}

protected String name;
protected String lastname;
}


How should I map component superclass fields?


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.