This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Problem with mapping Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "Problem with mapping " Watch "Problem with mapping " New topic
Author

Problem with mapping

Alen Dao
Greenhorn

Joined: May 27, 2009
Posts: 1
Hello,
I have simple mapping I don't know why it doesn't work

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="mappings" default-access="field">

<class name="Product" table="PRODUCTS" >
<composite-id>
<key-many-to-one name="productId" column="PRODUCT_ID" class="mappings.Product" />
<key-many-to-one name="productAltId" column="PRODUCT_ALT_ID"/>
</composite-id>
</class>

</hibernate-mapping>

Exception:

org.hibernate.MappingException: An association from the table PRODUCTS refers to an unmapped class: java.lang.Integer


Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4967

Perhaps somewhere in your class you are mapping to java.lang.Integer instead of simply declaring a property of type Integer in your code. Any chance?

-Cameron McKenzie


Author of Hibernate Made Easy, What is WebSphere???, JSF 2.0 Made Easy and the SCJA Certification Guides
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Problem with mapping
 
Similar Threads
left outer join *= how make compitible in HQL
Different Mapping Types in Hibernate
Please suggest on this Mapping
hibernate mapping
Help with mapping set - Hibernate