This week's giveaways are in the JDBC and Relational Databases and A Day in Code forums.
We're giving away four copies each of JDBC Workbook and A Day in Code and have the authors on-line!
See this thread and this one for details.
Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Problem with mapping

 
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


 
author and cow tipper
Posts: 5000
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
 
If you send is by car it's a shipment, but if by ship it's cargo. This tiny ad told me:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic