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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:52:30+00:00 2026-06-07T18:52:30+00:00

Setup: Hibernate 4.0 (JPA 2.0), Java EE 6 I have the following problem: I

  • 0

Setup: Hibernate 4.0 (JPA 2.0), Java EE 6

I have the following problem: I have a class “HandAttributes” annotated with @Embeddable which holds a lot of boolean attributes. In another class “Person” I want to embed this class twice. The idea is, that the values in the class “Attributes” represent attributes the “Person” can have on its left and right hand.

As far as I understand the possibilites with @AttributeOverride, I could override each attribute in the HandAttributes class and give them a new Column name i.e. “BrokenNailRight” and “BrokenNailLeft”. But as I mentioned, there are many of those Attributes, so I would like to rather not override them all explicitly.

Is there a possibility to Override all attributes in the Embeddable class by giving some kind of naming pattern? Like add the String “left” to all columns or anything similar.

I hope the question is understandable and I’m looking forward any ideas you might have!

  • 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-07T18:52:33+00:00Added an answer on June 7, 2026 at 6:52 pm

    Is there a possibility to Override all attributes in the Embeddable
    class?

    I’ve never heard of something like this and am pretty sure that this is not possible.

    Are you sure that you want to embed these objects? This results in a lot of really static code, that might better be written like this:

    public class Human {
    Hand leftHand;
    Hand rightHand;
    ...
    }
    

    or even

    public class Alien {
    Map<ConnectedBodyPart, Hand> hands
    ...
    }
    

    This should also enable generic versions of getBrokenNails()…

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

Sidebar

Related Questions

We have a setup where we are using an embedded HSQLDB for backing Hibernate/JPA
Can I setup JPA/hibernate to persist Boolean types as Y/N ? In the database
I have what I would assume is a pretty standard setup...spring, jpa (hibernate) and
The project that I'm working on has the following setup: JPA 2.0 (Hibernate 4
I have an application which uses JPA/Hibernate and Google Guice. Guice is bootstrapped in
I've set up ehcache on our Java application, which uses Spring and Hibernate. However,
I have my Fluent NHibernate setup code in a DataAccess project which is accessed
I am working on a Java application that will use some Hibernate (annotated by
I have an application that uses Hibernate/JPA, with Spring and Jersey. In my application
I'm using Spring + Hibernate + JPA and I have a situation where I

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.