Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Exception mapping file using NHIBERNATE

Posted on 2009-05-20
1
Medium Priority
?
559 Views
Last Modified: 2012-05-07
I am trying to create a sample NHibernate application. And I am getting an exception {"Could not find a getter for property 'Id' in class 'NHibernateTest.Users'"} . The Id is the primary key for the table.

I have tried to set the Id as

 public int ID
        {
            get { return this.Id;}
        }
based on some help from the internet.
But still this doesnt help. I have attached all the files.

Hope someone can help me out.

Please rename all the files without the .txt extension.





AssemblyInfo.cs.txt
Program.cs.txt
Users.cs.txt
Users.hbm.xml.txt
0
Comment
Question by:pawan2290
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 7

Accepted Solution

by:
zwei earned 1500 total points
ID: 24440169
Could not find a getter for property 'Id' in class 'NHibernateTest.Users

This means it is trying to find 'Id', when it should be looking for 'ID'. I'm not experienced with hibernate but I can see in your xml you have written 'Id' and not 'ID'.

You can either change the property to match the call, or change the call.

Example:
private int id;
 
public int Id
{
    get { return this.id;}
}

Open in new window

0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question