• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with mapping

 
Alen Dao
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic