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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:49:18+00:00 2026-05-25T16:49:18+00:00

I have this class that I’m trying to map in Hibernate 3.6.x @Entity @Table(name

  • 0

I have this class that I’m trying to map in Hibernate 3.6.x

@Entity @Table(name = "address") @Inheritance()
public abstract class Address {
    @Column(name = "address_type") @Enumerated(EnumType.STRING)
    private final AddressType addressType;

    @Embedded @AttributeOverrides({@AttributeOverride(name = "addressLine", column = @Column(name = "address_line1"))})
    private final AddressLine addressLine1;

    @Embedded @AttributeOverrides({@AttributeOverride(name = "addressLine", column = @Column(name = "address_line2"))})
    private final AddressLine addressLine2;

    @Embedded @AttributeOverrides({@AttributeOverride(name = "addressLine", column = @Column(name = "address_line3"))})
    private final AddressLine addressLine3;

    @Embedded @AttributeOverrides({@AttributeOverride(name = "addressLine", column = @Column(name = "address_line4"))})
    private final AddressLine addressLine4;

    @Embedded @AttributeOverrides({@AttributeOverride(name = "addressLine", column = @Column(name = "address_line5"))})
    private final AddressLine addressLine5;

    @Embedded @AttributeOverrides({@AttributeOverride(name = "postcode", column = @Column(name = "postcode"))})
    private final Postcode postcode;
}

I’m getting this error. (Which I don’t fully understand – can someone explain it?)

Repeated column in mapping for entity:
Address column: addressLine (should
be mapped with insert=”false” update=”false”)

Although the @Embeddable AddressLine is just a object wrapping a string, I would like to keep the type so I can add behaviour/rules later on.

Any suggests that would allow this type of configuration?

  • 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-25T16:49:19+00:00Added an answer on May 25, 2026 at 4:49 pm

    I’m ashamed to say that the error I was getting from this question was due to a copy & paste crime.

    Although not in the question code, but in my actual code base, the @Column annotation name value within the duplicated AddressLines 1,2,3, and 4 were not changed to be unique.

    For example – This is BAD as both @Column name values are the same of “address_line1”

    @Embedded @AttributeOverrides({@AttributeOverride(name = "addressLine", column = @Column(name = "address_line1"))})
    private final AddressLine addressLine1;
    
    @Embedded @AttributeOverrides({@AttributeOverride(name = "addressLine", column = @Column(name = "address_line1"))})
    private final AddressLine addressLine2;
    

    If all column names are unique this example will work as expected.

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

Sidebar

Related Questions

I have this abstract class that is used as data repository. public abstract class
I have class that looks like this: class A { public: class variables_map vm
I have a Handler class that looks like this: class Handler{ public $group; public
Assume I have a class that looks like this: class Sample { public string
I currently have this class that another programmer in my team coded: public static
Say I have this class Myclass that contains this method: public class MyClass {
Say I have this class : public class BaseJob{ String name; public void setName(String
I have this class: public class TimeIntCo<T> extends TimeValueCo<Integer> { } I decided that
I have this class that implements FilenameFilter package Logic; import java.io.File; import java.io.FilenameFilter; public
I'm trying to construct a class that would map with this XML structure, but

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.