"epbernard" wrote :
| You need to explicitly list your embedded superclasses in your persistence.xml
I'm using 4.0.3RC1 and have the same problem. I tried your tip but it fails. This is the persistence.xml I have:
<entity-manager>
| <class>foo.EmbeddedSuperClass</class>
| </entity-manager>
|
Where EmbeddedSuperClass is
@Embeddable
| @EmbeddableSuperclass
| public class EmbeddableSuperClass implements java.io.Serializable {
|
| ...
| }
and DerivedClass is
@Entity
| @Inheritance(strategy=InheritanceType.JOINED)
| public class DerivedClass extends EmbeddableSuperClass implements Serializable{
| ...
| }
But the properties derived from EmbeddableSuperClass are note created in the database. Is there a "conflict" because EmbeddableSuperClass is used as a @EmbeddableClass and a @Embeddable?
This kind of hierachy is driven by the following design. I have some global types which act as a default value and which are used as embedded instantec as well as in many-to-one relations. An example would be contract detail. In each order instance I have a reference to a "GlobalContractDetail" which is an instance of a ContractDetail and a used contract detail which store a snapshop of the GlobalContractDetail used a time of creation of the order. In my usecase I have a hierachie of ContractDetail. So the actual class model is:
@Embeddable, @EmbeddableSuperClass ContractDetail with basic properties.
@Entity GlobalContractDetail extends ContractDetail which adds a PK to ContractDetail
Order has a @many-to-one to GlobalContractDetali and a @embedded ContractDatail which stores the snapshot.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3887478#3887478
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3887478
|