-->
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.  [ 5 posts ] 
Author Message
 Post subject: could not find getter
PostPosted: Sat Jun 04, 2005 8:01 pm 
hi
i have the following error.....

NHibernate.MappingException: Problem trying to set association type by reflection ---> NHibernate.MappingException: Problem trying to set association type by reflection ---> NHibernate.PropertyNotFoundException: Could not find a getter for property 'unit' in class 'bsm.Product'
at NHibernate.Property.BasicPropertyAccessor.GetGetter(Type type, String propertyName)
at NHibernate.Util.ReflectHelper.GetGetter(Type theClass, String propertyName, String propertyAccessorName)
at NHibernate.Mapping.ManyToOne.SetTypeByReflection(Type propertyClass, String propertyName, String propertyAccess)
--- End of inner exception stack trace ---
at NHibernate.Mapping.ManyToOne.SetTypeByReflection(Type propertyClass, String propertyName, String propertyAccess)

my product.hbm.xml contains the following line....

Code:
<many-to-one name="unit" column="unit" />



and Product.cs has the following method.....
Code:
public Unit unit
      {
         get
         {
            return unit;
         }
         set
         {
            unit = value;
         }
      }


what am i doing wrong ? thanks in advance...


Top
  
 
 Post subject:
PostPosted: Sat Jun 04, 2005 10:45 pm 
Regular
Regular

Joined: Mon May 16, 2005 2:15 pm
Posts: 59
I think you have to tell it that the unit propery is Type Unit.


Top
 Profile  
 
 Post subject: already specified no ?
PostPosted: Sat Jun 04, 2005 11:04 pm 
hi
if u see my Product.cs the method signature clearly defines
property unit is of type Unit....

or do i have to declare it in a different manner diff. location....

an example would be highly appreciated...

thanks.


Top
  
 
 Post subject: Re: could not find getter
PostPosted: Sun Jun 05, 2005 4:20 am 
Newbie

Joined: Wed May 11, 2005 9:34 pm
Posts: 9
Code:
public Unit unit
      {
         get
         {
            return unit;
         }
         set
         {
            unit = value;
         }
      }



return unit from within the property will just cause a reflexive call on the property, won't it?

Regards,
Lars Arne Brekken


Top
 Profile  
 
 Post subject: weird mapping exception
PostPosted: Sun Jun 05, 2005 4:23 am 
hi

i got rid of the no getter errors by adding element
class="bsm.Unit, NHIbernate.Bsmcrm"

now i am getting a really weird mapping exception....stack trace follows..

C:\MICROSOFT.NET\bsmcrm-alpha\lib>class1 >> out.txt
NHibernate.MappingException: The '.' character, hexadecimal value 0x2E, cannot begin with a name. Line 28, position 78. ---> System.Xml.XmlException: The '.' character, hexadecimal value 0x2E, cannot begin with a name. Line 28, position 78.
at System.Xml.XmlScanner.ScanName()
at System.Xml.XmlScanner.ScanMarkup()
at System.Xml.XmlTextReader.ParseElement()
at System.Xml.XmlTextReader.Read()
at System.Xml.XmlValidatingReader.CollectTextToken(EntityHandling ehMode, Int32 depth, Boolean isAttText)
at System.Xml.XmlValidatingReader.ReadWithCollectTextToken()
at System.Xml.XmlValidatingReader.Read()
at System.Xml.XmlLoader.LoadChildren(XmlNode parent)
at System.Xml.XmlLoader.LoadElementNode()
at System.Xml.XmlLoader.LoadCurrentNode()
at System.Xml.XmlLoader.LoadCurrentNode()
at System.Xml.XmlLoader.LoadChildren(XmlNode parent)
at System.Xml.XmlLoader.LoadElementNode()
at System.Xml.XmlLoader.LoadCurrentNode()
at System.Xml.XmlLoader.LoadCurrentNode()
at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at NHibernate.Cfg.Configuration.LoadMappingDocument(XmlReader hbmReader)
at NHibernate.Cfg.Configuration.AddXmlFile(String xmlFile)
--- End of inner exception stack trace ---
at NHibernate.Cfg.Configuration.AddXmlFile(String xmlFile)
at CodeGeneration.Class1.Main(String[] args)
at NHibernate.Cfg.Configuration.AddXmlFile(String xmlFile)
at CodeGeneration.Class1.Main(String[] args)

C:\MICROSOFT.NET\bsmcrm-alpha\lib>


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