[Teneo] Embeddable annotation? [message #602879] |
Thu, 22 February 2007 18:07 |
Brian Vetter Messages: 74 Registered: July 2009 |
Member |
|
|
I have a type that I always want to embed in the including type. While I can use the @Embedded annotation on each element of that type, I'd like to set it for all elements that included it without having to annotate each element. I was presuming that this was the idea behind the @Embeddable class annotation.
However, when I use @Embeddable in the type, I get the following exception when generating the mappings:
Exception in thread "main" org.hibernate.MappingException: An association from the table ziptypes_memory refers to an unmapped class: basictypes.SizeType
at org.hibernate.cfg.Configuration.secondPassCompileForeignKeys (Configuration.java:1252)
at org.hibernate.cfg.Configuration.secondPassCompile(Configurat ion.java:1170)
at org.hibernate.cfg.Configuration.buildMappings(Configuration. java:1115)
at org.eclipse.emf.teneo.hibernate.HbDataStore.initialize(HbDat aStore.java:174)
at org.ziptie.persist.TestXSD.createDataStore(TestXSD.java:114)
The XSD fragment that I'm trying to make embeddable is the following:
<complexType name="SizeType">
<annotation>
<appinfo source="teneo.jpa">@Embeddable</appinfo>
</annotation>
<simpleContent>
<extension base="long">
<attribute name="unit" use="required">
<simpleType>
<restriction base="string">
<enumeration value="B"></enumeration>
<enumeration value="KB"></enumeration>
<enumeration value="MB"></enumeration>
<enumeration value="GB"></enumeration>
</restriction>
</simpleType>
</attribute>
</extension>
</simpleContent>
</complexType>
Is there something I'm doing wrong or did I misunderstand the meaning of the Embeddable annotation? Do I have to place @Embedded annotations in the including elements even if the @Embeddable annotations are in place. The documentation I've read on a variety of sites make this a bit unclear.
Based upon what I'm seeing, the @Embeddable tag simply tells Teneo to not generate a table mapping. You still have to use @Embedded in any elements that use it in order to avoid a mapping error. Failure to do so results in the above error.
BTW, I'm operating off the R0_7_maintenance branch (up to date with the CVS repository).
Brian
|
|
|
Powered by
FUDForum. Page generated in 0.02965 seconds