I think @Embeddable is optional in the spec, not sure if it is optional in my impl though...
@Embeddable is useful if you want to declare whether your persistent props are FIELD or PROPERTY based. Are they defined as getter/setter methods? Or should the persistence manager use fields. Get me?
@Embeddable is not optional in your implementation, it throws an NPE if you leave it out.
Also, if I do declare @Embeddable, then having to explicitly declare @AttributeOverrides in @Embedded side seems redundant in usual cases.
The simplest case would be to declare an @Embedded property, and if nothing else is declared default to AccessType = PROPERTY on the property's type (no need to have @Embeddable annotation) and AttributeOverrides default to all properties of the @Embedded type. Assuming this is the most common use case (JavaBean class), only a single @Embedded annotation is required. Only cases where default behavior is not desired, should more annotations be necessary.
At the moment I need to annotate @Embedded with @AttributeOverrides and the JavaBean with an @Embeddable annotation just to get a simple one-to-one JavaBean property to table column mapping done.
yes, i know. There is a jira task on this.