Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Exception and Persistence mapping
[Teneo] Exception and Persistence mapping [message #85864] Fri, 08 June 2007 14:22 Go to next message
Roman Bliznets is currently offline Roman BliznetsFriend
Messages: 75
Registered: July 2009
Member
Exception occur:
org.hibernate.MappingException: Repeated column in mapping for entity:
DTSMethod236Type column: supplementaryquantityt_id (should be mapped with
insert="false" update="false")
at
org.hibernate.mapping.PersistentClass.checkColumnDuplication (PersistentClass.java:652)
at
org.hibernate.mapping.PersistentClass.checkPropertyColumnDup lication(PersistentClass.java:674)
at
org.hibernate.mapping.PersistentClass.checkColumnDuplication (PersistentClass.java:696)
at org.hibernate.mapping.PersistentClass.validate(PersistentCla ss.java:450)
at org.hibernate.mapping.RootClass.validate(RootClass.java:192)
at org.hibernate.cfg.Configuration.validate(Configuration.java: 1102)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1287)
at
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.buildSess ionFactory(HbSessionDataStore.java:156)
at
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:79)
at
ru.spb.nicetu.SessionFactoryBean.getSessionFactory(SessionFa ctoryBean.java:71)
at ru.spb.nicetu.ReadXML.main(ReadXML.java:33)

I should write in persistence.xml something like this?:
<epackage
namespace-uri="urn:customs.ru:Information:CustomsDocuments:DTSout:3.0.1 ">
<eclass name="DTSMethod236Type">
<property name="....">
<column name="supplementaryquantityt_id" insertable="false"
updatable="false"/>
</property>
</eclass>
</epackage>

I don't understand how to get the name of the property
Maybe I have to do something else?
Re: [Teneo] Exception and Persistence mapping [message #85880 is a reply to message #85864] Fri, 08 June 2007 14:32 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
It is probably a nameclash of a join column which is used to persist an association. So you need to
search for an association from DTSMethod236Type to Supplementaryquantity (or vice versa), then
instead of the column annotation you need the joincolumn annotation to give the joincolumn another
name.

gr. Martin

wolf_roma wrote:
> Exception occur:
> org.hibernate.MappingException: Repeated column in mapping for entity:
> DTSMethod236Type column: supplementaryquantityt_id (should be mapped with
> insert="false" update="false")
> at
> org.hibernate.mapping.PersistentClass.checkColumnDuplication (PersistentClass.java:652)
> at
> org.hibernate.mapping.PersistentClass.checkPropertyColumnDup lication(PersistentClass.java:674)
> at
> org.hibernate.mapping.PersistentClass.checkColumnDuplication (PersistentClass.java:696)
> at org.hibernate.mapping.PersistentClass.validate(PersistentCla ss.java:450)
> at org.hibernate.mapping.RootClass.validate(RootClass.java:192)
> at org.hibernate.cfg.Configuration.validate(Configuration.java: 1102)
> at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1287)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.buildSess ionFactory(HbSessionDataStore.java:156)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:79)
> at
> ru.spb.nicetu.SessionFactoryBean.getSessionFactory(SessionFa ctoryBean.java:71)
> at ru.spb.nicetu.ReadXML.main(ReadXML.java:33)
>
> I should write in persistence.xml something like this?:
> <epackage
> namespace-uri="urn:customs.ru:Information:CustomsDocuments:DTSout:3.0.1 ">
> <eclass name="DTSMethod236Type">
> <property name="....">
> <column name="supplementaryquantityt_id" insertable="false"
> updatable="false"/>
> </property>
> </eclass>
> </epackage>
>
> I don't understand how to get the name of the property
> Maybe I have to do something else?
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] Exception and Persistence mapping [message #85927 is a reply to message #85880] Sat, 09 June 2007 11:20 Go to previous messageGo to next message
Roman Bliznets is currently offline Roman BliznetsFriend
Messages: 75
Registered: July 2009
Member
Thanks, it was helpful
Will it be everytime when class has to reference on the two same class?
May be in future Teneo will do this automaticly?
Re: [Teneo] Exception and Persistence mapping [message #85955 is a reply to message #85927] Sat, 09 June 2007 12:29 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Teneo does this automatically but there is probably a limit to the length of the column name in your
case, if there is a maximum length on the sql column naming then Teneo truncates the part before the
underscore resulting in non-unique column names.
I have plans to completely change the naming logic so that others can more easily plugin their own
strategy.

gr. Martin

wolf_roma wrote:
> Thanks, it was helpful
> Will it be everytime when class has to reference on the two same class?
> May be in future Teneo will do this automaticly?
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] Exception and Persistence mapping [message #606892 is a reply to message #85864] Fri, 08 June 2007 14:32 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
It is probably a nameclash of a join column which is used to persist an association. So you need to
search for an association from DTSMethod236Type to Supplementaryquantity (or vice versa), then
instead of the column annotation you need the joincolumn annotation to give the joincolumn another
name.

gr. Martin

wolf_roma wrote:
> Exception occur:
> org.hibernate.MappingException: Repeated column in mapping for entity:
> DTSMethod236Type column: supplementaryquantityt_id (should be mapped with
> insert="false" update="false")
> at
> org.hibernate.mapping.PersistentClass.checkColumnDuplication (PersistentClass.java:652)
> at
> org.hibernate.mapping.PersistentClass.checkPropertyColumnDup lication(PersistentClass.java:674)
> at
> org.hibernate.mapping.PersistentClass.checkColumnDuplication (PersistentClass.java:696)
> at org.hibernate.mapping.PersistentClass.validate(PersistentCla ss.java:450)
> at org.hibernate.mapping.RootClass.validate(RootClass.java:192)
> at org.hibernate.cfg.Configuration.validate(Configuration.java: 1102)
> at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1287)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.buildSess ionFactory(HbSessionDataStore.java:156)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:79)
> at
> ru.spb.nicetu.SessionFactoryBean.getSessionFactory(SessionFa ctoryBean.java:71)
> at ru.spb.nicetu.ReadXML.main(ReadXML.java:33)
>
> I should write in persistence.xml something like this?:
> <epackage
> namespace-uri="urn:customs.ru:Information:CustomsDocuments:DTSout:3.0.1 ">
> <eclass name="DTSMethod236Type">
> <property name="....">
> <column name="supplementaryquantityt_id" insertable="false"
> updatable="false"/>
> </property>
> </eclass>
> </epackage>
>
> I don't understand how to get the name of the property
> Maybe I have to do something else?
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] Exception and Persistence mapping [message #606895 is a reply to message #85880] Sat, 09 June 2007 11:20 Go to previous message
Roman Bliznets is currently offline Roman BliznetsFriend
Messages: 75
Registered: July 2009
Member
Thanks, it was helpful
Will it be everytime when class has to reference on the two same class?
May be in future Teneo will do this automaticly?
Re: [Teneo] Exception and Persistence mapping [message #606897 is a reply to message #85927] Sat, 09 June 2007 12:29 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Teneo does this automatically but there is probably a limit to the length of the column name in your
case, if there is a maximum length on the sql column naming then Teneo truncates the part before the
underscore resulting in non-unique column names.
I have plans to completely change the naming logic so that others can more easily plugin their own
strategy.

gr. Martin

wolf_roma wrote:
> Thanks, it was helpful
> Will it be everytime when class has to reference on the two same class?
> May be in future Teneo will do this automaticly?
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:[teneo] XML(Gregorian)Calendar or GregorianCalendar
Next Topic:OutOfMemoryError in HbDataStore.initialize()
Goto Forum:
  


Current Time: Thu Jan 21 06:24:03 GMT 2021

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

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

Back to the top