title: Hibernate embeddables: component property not found
body: <p>I'm trying to use JPA <code>@Embeddable</code>s with Hibernate. The entity and the embeddable both have a property named <code>id</code>:</p>
  
  <pre><code>@MappedSuperclass
  public abstract class A {
      @Id
      @GeneratedValue
      long id;
  }
  
  @Embeddable
  public class B extends A {
  
  }
  
  @Entity
  public class C extends A {
      B b;
  }
  </code></pre>
  
  <p>This raises a <code>org.hibernate.MappingException: component property not found: id</code>.</p>
  
  <p>I want to avoid using <code>@AttributeOverrides</code>. I thus tried to set <code>spring.jpa.hibernate.naming_strategy=org.hibernate.cfg.DefaultComponentSafeNamingStrategy</code> (I'm using Spring Boot). This did not have any effect (same exception). I, however, suspect that the setting is beeing ignored because specifying a non-existing class doesn't raise an exception.</p>
  
  <p>The strange thing is, even with this variant</p>
  
  <pre><code>@Entity
  public class C extends A {
      @Embedded
      @AttributeOverrides( {
          @AttributeOverride(name="id", column = @Column(name="b_id") ),
      } )
      B b;
  }
  </code></pre>
  
  <p>I still get the same error.</p>