Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8868433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:16:13+00:00 2026-06-14T17:16:13+00:00

Possible Duplicate: Hibernate – PropertyNotFoundException: Could not find a getter for I am getting

  • 0

Possible Duplicate:
Hibernate – PropertyNotFoundException: Could not find a getter for

I am getting error when I am trying to run my code. Can you guys Please help. I have attached my mapping files. The issue here is that, am getting below error. ” org.hibernate.PropertyNotFoundException: Could not find a getter for eployeedetail in class bean.Employee ”

Here is my Employee Class

   package bean;

   import bean.EployeeDetails;

   public class Employee {


    int             EmpId;
    String          name;
    String          phone;
    EployeeDetails          Edetails;

   public EployeeDetails getEdetails() {
        return Edetails;
    }
    public void setEdetails(EployeeDetails eDetails) {
        Edetails = eDetails;
    }

And other getters ans setters.

EployeeDetails.hbm.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
       "-//Hibernate/Hibernate Mapping DTD//EN"
       "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

       <hibernate-mapping>
        <class name="bean.EployeeDetails" table="eployeedetail">
            <id name="EmpId">
                <column name="employee_id"/>
                <generator class="foreign" >
                <param name="property">eployee</param>
                </generator>
            </id>
            <one-to-one name="eployee" class="bean.Employee" constrained="true"></one-to-one>
            <property name="Address" column="ADDRESS"/>
        </class>
       </hibernate-mapping>

Employee.hbm.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
       "-//Hibernate/Hibernate Mapping DTD//EN"
       "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

       <hibernate-mapping>
        <class name="bean.Employee" table="eployee">
            <id name="EmpId" column="employee_id">
                <generator class="native" />
            </id>
            <one-to-one name="eployeedetail" class="bean.EployeeDetails"/>
            <property name="name" column="NAME"/>
            <property name="phone" column="PHONE"/>
        </class>
       </hibernate-mapping>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:16:14+00:00Added an answer on June 14, 2026 at 5:16 pm

    The problem is in Employee.hbm.xml. Whenever you specify a one-to-one tag, you need to specify 2 basic attributes:

    1. name which represents name of the property. In you case it should be Edetails & not eployeedetail. THIS IS THE REASON YOU’RE GETTING THE EXCEPTION.
    2. class which represents the class name which is associated as one-to-one with this class. In your case it should be EployeeDetails.

    Change Employee.hbm.xml, change one-to-one tag attribute name to Edetails & your problem will be solved.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Learning to write a compiler I looked around trying to find out
Possible Duplicate: Can you write object oriented code in C? Hi, can someone point
Possible Duplicate: Reading through file using ifstream I'm trying to find a way to
Possible Duplicate: Hibernate - AnnotationConfiguration deprecated In version 3.2 of Hibernate, I could configure
Possible Duplicate: Hibernate: different object with the same identifier value was already associated with
Possible Duplicate: Hibernate and no PK Anyone knows how to do hibernate mapping for
Possible Duplicate: Hibernate: different object with the same identifier value was already associated with
Possible Duplicate: && operator in Javascript In the sample code of the ExtJS web
Possible Duplicate: How can I convert a list<> to a multi-dimensional array? I want
Possible Duplicate: How can I understand nested ?: operators in PHP? Why does this:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.