Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Embeddable annotation?
[Teneo] Embeddable annotation? [message #602879] Thu, 22 February 2007 18:07
Brian Vetter is currently offline Brian VetterFriend
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
Previous Topic:Re: Deadlock in WorkspaceSynchronizer
Next Topic:EMFT - OCL Release 1.0.1 build
Goto Forum:
  


Current Time: Fri Apr 26 07:54:53 GMT 2024

Powered by FUDForum. Page generated in 0.02965 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top