-->
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.  [ 3 posts ] 
Author Message
 Post subject: associations using join says "table or view does not ex
PostPosted: Mon Jul 21, 2008 5:35 am 
Newbie

Joined: Mon Jul 21, 2008 5:22 am
Posts: 1
Hi,

im doing associations using joins. i have a join table in DB PersonAddress.

and the mapping is here
Code:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
   "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
   "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>

   <class name="Person" table="person" >
      <id name="personId" column="personId">
         <generator class="assigned"/>
      </id>
      <join  table="personaddress" >
         <key column="personId" unique="true"/>
         <many-to-one name="address" column="addressId" not-null="true" cascade="save-update"/>
      </join>
   </class>
   
   <class name="Address" table="address">
      <id name = "addressId" column="addressId">
           <generator class="assigned"/>
       </id>
   </class>
   
</hibernate-mapping>


when i call the save(person) it say "table or view does not exist" and table is not there in the schema. but it is there before i execute the same program

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 21, 2008 10:41 pm 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Which table does it complain does not exist?

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 22, 2008 8:17 am 
Newbie

Joined: Thu Jul 26, 2007 8:25 am
Posts: 6
Are you using 'hibernate.hbm2ddl.auto' property in configuration file ?


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