-->
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 (with inverse=false)
PostPosted: Thu Oct 14, 2010 4:16 am 
Newbie

Joined: Sun Sep 26, 2010 2:09 am
Posts: 11
i am trying to make a one-to-many relation (one way that is inverse="false")

heres the mapping file
Code:
<?xml version="1.0" encoding="utf-8" ?>


<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="Jinnah.ObjectPersistanceLayer" assembly="Jinnah.OPL">

  <class name="Course_Info" table="Course_Info">
    <id name="CourseId" column="Course_Id" type="int">
      <generator class="identity"></generator>
    </id>


    <property name="CourseTitle"      column="Course_Title" type="String"/>

    <property name="CourseCode"  column="Course_Code"  type="String"/>

    <property name="CourseDept"  column="Course_Dept"  type="String"/>



    <property name="DateOfEntry"  column="Date_Of_Entry"  type="String"/>
    <property name="UpdatedOnDate"  column="Updated_On_Date"  type="String"/>

    <bag name="TPF_Course_Property" Inverse="false" cascade="all-delete-orphan">
      <key column="Fk_Course_Id" type="int" length="4" not-null="false" />
      <one-to-many class="Jinnah.ObjectPersistanceLayer.Classes.TPF_Teacher_Performance,Jinnah.OPL" />
    </bag>
   
   
   
   
  </class>
</hibernate-mapping>





here is the POCO class
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Jinnah.ObjectPersistanceLayer.Classes
{
    public class Course_Info
    {
        private int _CourseId;
        private string _Course_Title;
        private string _CourseCode;
        private string _CourseDept;
        private string _DateOfEntry;
        private string _UpdatedOnDate;

        public virtual int CourseId
        {
            get { return _CourseId; }
            set { _CourseId = value; }
        }


        public virtual string Course_Title
        {
            get { return _Course_Title; }
            set { _Course_Title = value; }
        }


        public virtual string CourseCode
        {
            get { return _CourseCode; }
            set { _CourseCode = value; }
        }


        public virtual string CourseDept
        {
            get { return _CourseDept; }
            set { _CourseDept = value; }
        }


        public virtual string DateOfEntry
        {
            get { return _DateOfEntry; }
            set { _DateOfEntry = value; }
        }


        public virtual string UpdatedOnDate
        {
            get { return _UpdatedOnDate; }
            set { _UpdatedOnDate = value; }
        }


        private IList<TPF_Teacher_Performance> _TPF_Course;
        public virtual IList<TPF_Teacher_Performance> TPF_Course_Property
        {
            get { return _TPF_Course; }
            set { _TPF_Course = value; }
        }



        public Course_Info()
        {
        }

    }
}



when is run this by calling a method , in the .aspx page it gives

The 'Inverse' attribute is not declared.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Xml.Schema.XmlSchemaValidationException: The 'Inverse' attribute is not declared.


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.