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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:21:41+00:00 2026-05-21T22:21:41+00:00

Consider the following three classes @Entity @Inheritance(strategy = InheritanceType.JOINED) @SequenceGenerator(name = GenericIdGenerator, sequenceName =

  • 0

Consider the following three classes

@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@SequenceGenerator(name = "GenericIdGenerator",
sequenceName = "GENERIC_SEQ", initialValue = 1)
@Table(name = "tbl_datastores")
public abstract class DataStore implements Serializable {

    private int storeId;

    public getStoreId()
    {
        return this.storeId;
    }

    //..other code removed for brevity.
}

@Entity
@Table(name = "tbl_filedatastores")
public class FileDataStore extends DataStore {

    private Set<FieldDetails> fields;

    @OneToMany(mappedBy="datastore")
    public getFields()
    {
        return this.fields;
    }
    //..other code removed for brevity.
}

@Entity
@Table(name="tbl_fields")
@SequenceGenerator(name = "GenericIdGenerator",
sequenceName = "GENERIC_SEQ", initialValue = 1)
public class FieldDetails
{
    private int fieldId;
    private DataStore datastore;

    @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="GenericIdGenerator")
    @Column(name="id", nullable=false, updatable=false)
    public int getFieldId() {
        return fieldId;
    }

    @ManyToOne
    @JoinColumn (name="datastore_id", referencedColumnName="id")
    public FileDataStore getDataStore(){
        return datastore;
    }
    //..other code removed for brevity.
}

When I run this code I get the following error…

org.hibernate.AnnotationException: mappedBy reference an unknown target entity  property: entities.FieldDetails.datastore in entities.FileDataStore.fields

I have seen some posts that seem to suggest it is a hibernate issue but I could not get a proper solution anywhere?

Can you please suggest a way to map this in hibernate or a workaround?

Thank you in advance!

  • 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-05-21T22:21:42+00:00Added an answer on May 21, 2026 at 10:21 pm

    Note the difference in character case in property names. It should be either

    @OneToMany(mappedBy="dataStore") 
    ...
    public FileDataStore getDataStore(){ ... }
    

    or

    @OneToMany(mappedBy="datastore") 
    ...
    public FileDataStore getDatastore(){ ... }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the three following classes: EntityTransformer contains a map associating an Entity with a
Consider the following implementation of a few classes: .h file implementations of three different
Please consider the following three .NET types: I have an interface, an abstract class,
Consider the following Ruby code analyzing a three-byte UTF-8 string: #encoding: utf-8 s =
Consider the following set of classes/Interfaces: class IFish{ public: virtual void eat() = 0;
I have the following problem. Consider the classes class face { virtual std::vector<ptr>& get_vertices(void)
Today, I've stumbled over the following: Consider two classes NewClass and NewClass1, which have
Consider the following scenario: There are three kinds of entities, say Foo , Bar
Consider the following hibernate configuration: <class name=Person> <id name=id column=personId> <generator class=native/> </id> <set
Consider the following data classes: class TopLevel { public TopLevel() { collection = new

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.