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

  • Home
  • SEARCH
  • 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 6825499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:02:13+00:00 2026-05-26T22:02:13+00:00

I am trying to use an inner class as embeddable to represent some complicated

  • 0

I am trying to use an inner class as embeddable to represent some complicated properties of the outer class. When I store this, there is no information from the inner class in the database schema generated by eclipselink.

Does what I’m trying to do seem like a good idea? Why doesn’t eclipselink seem to recognize them @Basic attribute on the getRate() in Attributes?

Some other info: Measure must be instantiated using a factory which is provided to the constructor of Person, so I don’t even know how I’m going to be able to use this at all. It seems more and more likely that I’ll have to make a separate class just to store the state of Person in simple terms (like doubles, not Measures) and use those to create the real Person-type objects, but that has very sad implications for the rest of my application.

  @Entity
  public static class Person {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int id;
    @Transient
    public Measure<Double, CleanupRate> rate;
    @Embedded
    private Attributes attributes;

    @Embeddable
    public static class Attributes {

      @Transient
      private Person person;

      public Attributes() {

      }

      public Attributes(Person person) {
        this.person = person;
      }

      @Basic
      public double getRate() {
        return person.rate.getInternalValue();
      }

      public void setRate(double value) {
        person.rate.setInternalValue(value);
      }
    }

    public Person() {
      rate = udm.getMeasureFactory().createMeasure(0.0, CleanupRate.class);
      attributes = new Attributes(this);
    }

    public void setRate(double rate) {
      this.rate.setValue(rate);
    }
  }

Edit:

In order to inject the measure dependency into my objects when they are retrieved from storage, I’ve added an interface which injects the dependency and used it in my DAO. Since the DAO can be injected, I can propagate the dependency down to the retrieved objects. I got the idea from a blog.

  private <T extends UomInjectable> List<T> //
          getListOfUomInjectableType(final Class<T> klass) {
    List<T> result = getListOfType(klass);
    for (UomInjectable injectable : result) {
      injectable.injectUomFactory(udm);
    }
    return result;
  }
  • 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-26T22:02:14+00:00Added an answer on May 26, 2026 at 10:02 pm

    It is using the access type from the Person class, which is set to field, and so not seeing the annotation at the property level.

    You will need to change the access type using Access(PROPERTY) on the embeddable class, and should remove the @Transient annotation on the person attribute.

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

Sidebar

Related Questions

I am trying to use an inner class setup, however I'm having some problems.
I'm trying to use inheritance among classes defined inside a class template (inner classes).
I was trying to use an inner class of the super type, which was
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
Trying to use an excpetion class which could provide location reference for XML parsing,
Trying to use this method (gist of which is use self.method_name in the FunnyHelper
Trying to use GnuPG with Delphi (Win32). I need to sign some file with
Trying to use this code to connect the AD PrincipalContext context = new PrincipalContext(ContextType.Domain,
I'm trying to use a Spring context namespace to build some existing configuration objects
I have a json string like this: http://pastebin.com/ckUZadwL I'm trying to use gson to

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.