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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:01:29+00:00 2026-05-24T10:01:29+00:00

When trying to map an inherited property using AttributeOverride annotation, OpenJPA throws an error

  • 0

When trying to map an inherited property using AttributeOverride annotation, OpenJPA throws an error that it cannot find the property in the super class. I’m not sure how to map this the correct way.

Error

Embedded property "Order.mailingAddress" declares a mapping override for "addressLine", but that is not a persistent property in the embedded type.

Code

@Embeddable
public class Address{
    private String addressLine;
    private String city;
    private String state;
    private String zip;

    //getters and setters
}

@Embeddable
public class ExtendedAddress extends Address{
    private String additionalAddressLine;

    //getters and setters
}

@Entity
public class Order {
    @Id
    private id;

    @OneToOne
    private Customer customer;

    @Embedded
    @AttributeOverrides(value={
            @AttributeOverride(name="addressLine", 
                 column=@Column(name="mailingAddressLine")),
            @AttributeOverride(name="additionalAddressLine", 
                  column=@Column(name="mailingAddressLine2")),
            @AttributeOverride(name="city", 
                  column=@Column(name="mailingAddressCity")),
            @AttributeOverride(name="state", 
                  column=@Column(name="mailingAddressState")),
            @AttributeOverride(name="zip", 
                  column=@Column(name="mailingAddressZip")),
    })
    private ExtendedAddress mailingAddress;

    @Embedded
    @AttributeOverrides(value={
            @AttributeOverride(name="addressLine", 
                 column=@Column(name="billingAddressLine")),
            @AttributeOverride(name="city", 
                  column=@Column(name="billingAddressCity")),
            @AttributeOverride(name="state", 
                  column=@Column(name="billingAddressState")),
            @AttributeOverride(name="zip", 
                  column=@Column(name="billingAddressZip")),
    })
    private Address billingAddress;

    //getters and setters
    //hashcode
    //equals
}

SQL

CREATE TABLE Orders (
  id INT PRIMARY KEY GENERATED ALWAYS,
  mailingAddressLine VARCHAR(45) DEFAULT NULL,
  mailingAddressLine2 VARCHAR(45) DEFAULT NULL,
  mailingAddressCity VARCHAR(45) DEFAULT NULL,
  mailingAddressState CHAR(2) DEFAULT NULL,
  mailingAddressZip CHAR(9) DEFAULT NULL,
  billingAddressLine VARCHAR(45) DEFAULT NULL,
  billingAddressCity VARCHAR(45) DEFAULT NULL,
  billingAddressState CHAR(2) DEFAULT NULL,
  billingAddressZip CHAR(9) DEFAULT NULL
)
  • 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-24T10:01:30+00:00Added an answer on May 24, 2026 at 10:01 am

    Change the access level in your Embeddables (Address and ExtendedAddress) from private to protected or default.

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

Sidebar

Related Questions

Trying to map the following schema using the Entity Framework. A Customer can have
I'm trying to map a struct definition using ctypes: struct attrl { struct attrl
I am trying to map several tables using Fluent Nhibernate. My tests are giving
I'm trying to figure out how to map against a simple read-only property and
I am having trouble trying to map this object that contains a collection of
I'm currently trying to map music related data using Doctrine2's POPO Annotations. I haven't
Using Sharp Architecture 1.9 I have a base class that inherits from the Sharp
I am trying to map an Address entity and a Person entity using a
I'm trying to map a ManyToMany relationships between 2 tables, both having composite primary
I'm trying to map a Dictionary containing Lists. I have the following set of

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.