-->
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.  [ 1 post ] 
Author Message
 Post subject: One-to-Many help
PostPosted: Wed Jul 19, 2006 2:56 pm 
Beginner
Beginner

Joined: Wed Jun 28, 2006 2:03 pm
Posts: 22
Hibernate version:
1.2.0 Alpha

A have two tables :

Table1:
id : pk

Table2:
id : pk
id_table2 :fk

Mapping Class1:
Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" assembly="BLL" namespace="BLL">
<class name="Class1" table="table1">

<id name="Id" column="id" type="Int32" unsaved-value="0">
      <generator class="sequence">
        <param name="sequence">Class1_id_seq</param>
      </generator>
</id>   

<bag
     name="myList"
     access="field"
     inverse ="true"     
     cascade="all-delete-orphan">
      <key column ="id_table2"></key>
      <one-to-many class ="BLL.Class2,BLL" />
    </bag>


  </class>
</hibernate-mapping>


My cs
Code:
public class Class1    {
                private IList<Class2> myList;

public virtual IList<Class2> MyList
        {
            get
            {
                return myList;
            }
        }
}


But I got the error:
ERROR: 42703: column mylist0_.filme_id does not exist

Help?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.