Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Teneo: More than one class with same name
Teneo: More than one class with same name [message #601730] Tue, 30 January 2007 11:19
Parvez is currently offline ParvezFriend
Messages: 181
Registered: July 2009
Senior Member
Hi,

As I am having more than one ecore models, it is possible that classes
in different models can have the same name though in different packages.

By default, hibernate file generated by Teneo does not qualify entity
name with package, so that result in duplicate mapping error.

I tried to qualify entities with full package name then hibernate
complains that duplicate import and suggests:

try using auto-import="false"

So just wondering, where & how to specify this?
Though during initialization I specify some hibernate properties using

hbds.setHibernateProperties

and I don’t see this property in Environment class of hibernate.


Another issue is, if in case I don’t want to persist one of the entity
i.e. more than one class with same name in different packages), then I
comment out mapping for that class in hibernate file, but class still
exist in package and Teneo complains that more then one EClass with same
name:

java.lang.IllegalArgumentException: There is more than one EClass with
the same name (. . . . . A different EClassResolver should be used.
at
org.eclipse.emf.teneo.ecore.DefaultEClassNameStrategy.toECla ss(DefaultEClassNameStrategy.java:60)
at
org.eclipse.emf.teneo.hibernate.HbDataStore.setRefersToOfSup ers(HbDataStore.java:812)
at
org.eclipse.emf.teneo.hibernate.HbDataStore.setRefersToOfSup ers(HbDataStore.java:826)
at
org.eclipse.emf.teneo.hibernate.HbDataStore.computeReferers( HbDataStore.java:800)
at
org.eclipse.emf.teneo.hibernate.HbDataStore.initialize(HbDat aStore.java:163)

Any idea how to solve it?

Thanks.

- Parvez
Previous Topic:Query 1.1M4
Next Topic:Generating EMF model with virtual attributes
Goto Forum:
  


Current Time: Sat Feb 27 22:19:11 GMT 2021

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

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

Back to the top