-->
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.  [ 2 posts ] 
Author Message
 Post subject: Error Could not find a getter for property ?????he
PostPosted: Tue Apr 03, 2007 11:23 pm 
Newbie

Joined: Tue Apr 03, 2007 11:13 pm
Posts: 1
i want to code one-to-meny but display
"Could not find a getter for property 'Sys_Menu_Tree' in class 'SpringDemo.DAO.Domain.Sys_Page_Info' "

Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="false">
   <class name="SpringDemo.DAO.Domain.Sys_Menu_Tree, SpringDemo.DAO" table="Sys_Menu_Tree">
      <id name="Id" type="Int32" unsaved-value="null">
         <column name="ID" length="4" sql-type="int" not-null="true" unique="true" index="PK_Sys_Menu_Tree"/>
         <generator class="native" />
      </id>
      <property name="Type" type="String">
         <column name="Type" length="1" sql-type="char" not-null="true"/>
      </property>
      <property name="PageID" type="Int32">
         <column name="Page_ID" length="4" sql-type="int" not-null="true"/>
      </property>
      <property name="Label" type="String">
         <column name="Label" length="20" sql-type="nvarchar" not-null="true"/>
      </property>
      <property name="ParentID" type="Int32">
         <column name="Parent_ID" length="4" sql-type="int" not-null="true"/>
      </property>
    <many-to-one name="Sys_Page_Info" class="SpringDemo.DAO.Domain.Sys_Page_Info, SpringDemo.DAO" cascade="all" left-join="auto" column="ID" not-null="false" />
  </class>
</hibernate-mapping>

Code:
using System;
using System.Collections;

namespace SpringDemo.DAO.Domain
{
   #region SysMenuTree

   /// <summary>
   /// SysMenuTree object for NHibernate mapped table 'Sys_Menu_Tree'.
   /// </summary>
   public class Sys_Menu_Tree
   {
      #region Member Variables
      
      protected int _id;
      protected string _type;
      protected int _pageID;
      protected string _label;
      protected int _parentID;
       

      #endregion

      #region Constructors

      public Sys_Menu_Tree() { }

      public Sys_Menu_Tree( string type, int pageID, string label, int parentID,Sys_Page_Info syspageinfo )
      {
         this._type = type;
         this._pageID = pageID;
         this._label = label;
         this._parentID = parentID;
            this._syspagepinfo = syspageinfo;
      }

      #endregion

      #region Public Properties

      public int Id
      {
         get {return _id;}
         set {_id = value;}
      }

      public string Type
      {
         get { return _type; }
         set
         {
            if ( value != null && value.Length > 1)
               throw new ArgumentOutOfRangeException("Invalid value for Type", value, value.ToString());
            _type = value;
         }
      }

      public int PageID
      {
         get { return _pageID; }
         set { _pageID = value; }
      }

      public string Label
      {
         get { return _label; }
         set
         {
            if ( value != null && value.Length > 20)
               throw new ArgumentOutOfRangeException("Invalid value for Label", value, value.ToString());
            _label = value;
         }
      }

      public int ParentID
      {
         get { return _parentID; }
         set { _parentID = value; }
      }

        protected Sys_Page_Info _syspagepinfo = null;

        public Sys_Page_Info SysPageInfo
        {
            get { return _syspagepinfo; }
            set { _syspagepinfo = value; }
        }

      #endregion
   }
   #endregion
}


Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="false">
   <class name="SpringDemo.DAO.Domain.Sys_Page_Info, SpringDemo.DAO" table="Sys_Page_Info">
      <id name="Id" type="Int32" unsaved-value="null">
         <column name="ID" length="4" sql-type="int" not-null="true" unique="true" index="PK_Sys_Page_Info"/>
         <generator class="native" />
      </id>
      <property name="Label" type="String">
         <column name="Label" length="20" sql-type="nvarchar" not-null="true"/>
      </property>
      <property name="Link" type="String">
         <column name="Link" length="100" sql-type="varchar" not-null="false"/>
      </property>
      <property name="Remark" type="String">
         <column name="Remark" length="200" sql-type="nvarchar" not-null="false"/>
      </property>
      <property name="Effective" type="String">
         <column name="Effective" length="1" sql-type="char" not-null="true"/>
      </property>
    <set name="Sys_Menu_Tree" cascade="all" inverse="true" lazy="false">
      <key column="Page_ID"/>
      <one-to-many class="SpringDemo.DAO.Domain.Sys_Menu_Tree, SpringDemo.DAO"/>
    </set>
  </class>
</hibernate-mapping>

Code:
using System;
using System.Collections;
using Spring.Collections;

namespace SpringDemo.DAO.Domain
{
   #region SysPageInfo

   /// <summary>
   /// SysPageInfo object for NHibernate mapped table 'Sys_Page_Info'.
   /// </summary>
   public class Sys_Page_Info
   {
      #region Member Variables
      
      protected int _id;
      protected string _label;
      protected string _link;
      protected string _remark;
      protected string _effective;

      #endregion

      #region Constructors

      public Sys_Page_Info()
        {
        }

        public Sys_Page_Info(string label, string link, string remark, string effective)
      {
         this._label = label;
         this._link = link;
         this._remark = remark;
         this._effective = effective;
      }

      #endregion

      #region Public Properties

      public int Id
      {
         get {return _id;}
         set {_id = value;}
      }

      public string Label
      {
         get { return _label; }
         set
         {
            if ( value != null && value.Length > 20)
               throw new ArgumentOutOfRangeException("Invalid value for Label", value, value.ToString());
            _label = value;
         }
      }

      public string Link
      {
         get { return _link; }
         set
         {
            if ( value != null && value.Length > 100)
               throw new ArgumentOutOfRangeException("Invalid value for Link", value, value.ToString());
            _link = value;
         }
      }

      public string Remark
      {
         get { return _remark; }
         set
         {
            if ( value != null && value.Length > 200)
               throw new ArgumentOutOfRangeException("Invalid value for Remark", value, value.ToString());
            _remark = value;
         }
      }

      public string Effective
      {
         get { return _effective; }
         set
         {
            if ( value != null && value.Length > 1)
               throw new ArgumentOutOfRangeException("Invalid value for Effective", value, value.ToString());
            _effective = value;
         }
      }

        private ISet _sysmenutree = new ListSet();

        public ISet SysMenuTree
        {
            get
            {
                return _sysmenutree;
            }
            set
            {
                _sysmenutree = value;
            }
        }
      #endregion
   }
   #endregion
}


where error???? 3Q


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 04, 2007 6:46 am 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
your set name is Sys_Menu_Tree and your property name is SysMenuTree

_________________
Seb
(Please don't forget to give credits if you found this answer useful :)


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