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 8087529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:48:22+00:00 2026-06-05T18:48:22+00:00

I have these simplified types: public class DataBean extends ZZZZZ { public String name;

  • 0

I have these simplified types:

public class DataBean extends ZZZZZ {
    public String   name;
}

public class Member extends CCCCC {
    public DataBean m_data;
}

I’d like to map m_data.name directly within Member.
I cannot use any sort of inheritance between the two (occupied already!).

This would be ideal:

<property name="m_data.name" column="name" type="string" access="field" />

Any idea? Is it possible with Hibernate?

Currently I’m getting this error:

org.hibernate.PropertyNotFoundException: field [m_data.name] not found
on com.example.Member

The main reason is that I’m trying to (re)use a data bean taken from an http service, and I really don’t feel like rewriting all the fields, nor writing a setter/getter.

  • 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-05T18:48:24+00:00Added an answer on June 5, 2026 at 6:48 pm

    The name property is actually in the DataBean class. So, the exception you are getting is obvious. Because the mapping is for Member.

    The DataBean is embedded in Member and to map the field in the embedded class you have to use the <component> element.

    Please refer to this answer to this question here in SO: Hibernate @embeddable annotation equivalent for XML mapping file?

    The answer also has a link to the page that explains what embedded objects are how to map them.

    Update:

    <component
            name="m_data"
            class="com.example.DemoBean"
            access="field">
        <property name="name" column="NAME" type="string" access="field" />
    </component>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an object that in a simplified form is as follows: public class
I have this simplified code: <div class=container> <input type=submit name=submit class=submit value=Sign Up> </div>
I have these two models: class Service(MelosModel): performer = models.ForeignKey(Performer) event = models.ForeignKey('Event') composition
I have these two table with some data sample in them. I would like
I have a problem in a VB.Net class library which I have simplified greatly
I have a class that represents an external physical measuring device. The simplified version
I have a label like this: <Label Name=LblUsersWithHair> <Binding Path=Users ElementName=ElementSelf Converter={StaticResource Converter_UsersWithHairPresenter} />
I have a domain model that contains member variables for two languages, something like
I have this class, just for the purpose of learning: public class MyClass{ //Looking
I have these three tables: Table 1 : InvoiceId InvoiceNumber CompanyId ------------------------------------------------- 3 1

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.