Solved

Exception mapping file using NHIBERNATE

Posted on 2009-05-20
1
552 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
1 Comment
 
LVL 7

Accepted Solution

by:
zwei earned 500 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

840 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