-->
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.  [ 5 posts ] 
Author Message
 Post subject: Association references unmapped class
PostPosted: Thu Feb 12, 2004 3:36 am 
Newbie

Joined: Tue Feb 10, 2004 12:03 am
Posts: 16
i got 3 tables named, address, lookup_code,state

CREATE TABLE `address` (
`OID` varchar(35) NOT NULL default '',
`ADDRESS_TYPE_OID` varchar(35) default NULL,
`ADDRESS_LINE_1` varchar(25) NOT NULL default '',
`ADDRESS_LINE_2` varchar(25) default NULL,
`STREET_TYPE_OID` varchar(35) default NULL,
`UNIT_NUMBER` varchar(15) default NULL,
`CITY` varchar(25) NOT NULL default '',
`STATE_OID` varchar(35) NOT NULL default '',
`ZIP` varchar(10) NOT NULL default '',
`CREATE_DTM` datetime NOT NULL default '0000-00-00 00:00:00',
`UPDATE_DTM` datetime NOT NULL default '0000-00-00 00:00:00',
`CREATED_BY` varchar(35) NOT NULL default '',
`UPDATED_BY` varchar(35) NOT NULL default '',
PRIMARY KEY (`OID`),
UNIQUE KEY `XPKADDRESS` (`OID`),
KEY `XIF89ADDRESS` (`ADDRESS_TYPE_OID`),
KEY `XIF90ADDRESS` (`STREET_TYPE_OID`),
KEY `XIF91ADDRESS` (`STATE_OID`),
CONSTRAINT `0_222` FOREIGN KEY (`STATE_OID`) REFERENCES `state` (`OID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `0_224` FOREIGN KEY (`STREET_TYPE_OID`) REFERENCES `lookup_code` (`OID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `0_226` FOREIGN KEY (`ADDRESS_TYPE_OID`) REFERENCES `lookup_code` (`OID`) ON DELETE NO ACTION ON UPDATE NO ACTION
) TYPE=InnoDB;





CREATE TABLE `lookup_code` (
`OID` varchar(35) NOT NULL default '',
`TYPE` varchar(15) NOT NULL default '',
`LABEL` varchar(255) NOT NULL default '',
`WEIGHT` int(11) default NULL,
`VALUE` float default NULL,
PRIMARY KEY (`OID`),
UNIQUE KEY `XPKLOOKUP_CODE` (`OID`)
) TYPE=InnoDB;




CREATE TABLE `state` (
`OID` varchar(35) NOT NULL default '',
`STATE_CD` char(2) NOT NULL default '',
`STATE_NAME` varchar(35) NOT NULL default '',
`CREATE_DTM` datetime NOT NULL default '0000-00-00 00:00:00',
`UPDATE_DTM` datetime NOT NULL default '0000-00-00 00:00:00',
`CREATED_BY` varchar(35) NOT NULL default '',
`UPDATED_BY` varchar(35) NOT NULL default '',
PRIMARY KEY (`OID`),
UNIQUE KEY `XPKSTATE` (`OID`)
) TYPE=InnoDB;


and here are my hbm files
AddressVO.hbm.xml



<hibernate-mapping package="com.aib.vo" >


<class name="AddressVO" table="address" not-null="true" lazy="true" >
<id name="oid"column="OID" >
<generator class="assigned" />
</id>

<property name="addressTypeOid" column="ADDRESS_TYPE_OID" length="35" />
<property name="addressLine1" column="ADDRESS_LINE_1" not-null="true" length="25" />
<property name="addressLine2" column="ADDRESS_LINE_2" length="25" />
<property name="streetTypeOid" column="STREET_TYPE_OID" length="35" />
<property name="unitNumber" column="UNIT_NUMBER" length="15" />
<property name="city" column="CITY" not-null="true" length="25" />
<property name="stateOid" column="STATE_OID" not-null="true" length="35" />
<property name="zip" column="ZIP" not-null="true" length="10" />
<property name="createDtm" column="CREATE_DTM" not-null="true" length="19" />
<property name="updateDtm" column="UPDATE_DTM" not-null="true" length="19" />
<property name="createdBy" column="CREATED_BY" not-null="true" length="35" />
<property name="updatedBy" column="UPDATED_BY" not-null="true" length="35" />


<many-to-one name="lookup" column="OID" not-null="true"/>
<many-to-one name="state" column="OID" not-null="true"/>


</class>
</hibernate-mapping>



LookupBeanhbm.xml

<hibernate-mapping>
<class name="com.aib.vo.LookupCodeBean" table="lookup_code">
<id name="oid" type="string" column="OID" length="32">
<generator class="assigned"/>
</id>
<property name="label" column="TYPE" length="15" not-null="true"/>
<property name="type" column="LABEL" length="255" not-null="true"/>
<property name="weight" column="WEIGHT" length="11" not-null="false"/>
<property name="value" column="VALUE" length="12" not-null="false"/>
<!-- associations -->
<!--<set name="address" lazy="true" inverse="true" table="Address" >
<key column="OID"/>
<one-to-many class="com.aib.vo.AddressVO"/>
</set>-->
</class>
</hibernate-mapping>


StateVO.hbm.xml



<hibernate-mapping>

<class name="com.aib.vo.StateVO" table="STATE" lazy="true">

<id name="oid" type="string" column="OID" >
<generator class="assigned" />
</id>

<property name="stateCd" column="STATE_CD" not-null="true" length="2" />

<property name="stateName" column="STATE_NAME" not-null="true" length="35" />

<property name="createDtm" column="CREATE_DTM" not-null="true" length="19" />

<property name="updateDtm" column="UPDATE_DTM" not-null="true" length="19" />

<property name="createdBy" column="CREATED_BY" not-null="true" length="35" />

<property name="updatedBy" column="UPDATED_BY" not-null="true" length="35" />

<!-- associations -->

<set name="address" lazy="true" inverse="true">
<key column="OID"/>
<one-to-many class="com.aib.vo.AddressVO"/>
</set>




</class>
</hibernate-mapping>






when i am trying to execute , i'm getting this particular erro.

net.sf.hibernate.MappingException: Association references unmapped class: com.aib.vo.AddressVO

can some one point ,where exactly the problem is .

Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 12, 2004 4:30 am 
Expert
Expert

Joined: Fri Nov 07, 2003 4:24 am
Posts: 315
Location: Cape Town, South Africa
Quote:
<class name="AddressVO" table="address" not-null="true" lazy="true" >


Fully qualify the class name


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 12, 2004 10:06 am 
Newbie

Joined: Tue Feb 10, 2004 12:03 am
Posts: 16
changed to fully qualified name, still getting the same error


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 12, 2004 10:20 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Your Hibernate.cfg.xml refer the 2 files ?

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 12, 2004 10:40 am 
Newbie

Joined: Tue Feb 10, 2004 12:03 am
Posts: 16
Thanks Emanuel, it worked, i was defining miltiple x.hbm.xml in hibernate-cfg.xml.


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