[Teneo] Exception and Persistence mapping [message #85864] |
Fri, 08 June 2007 10:22  |
Eclipse User |
|
|
|
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 #85955 is a reply to message #85927] |
Sat, 09 June 2007 08:29  |
Eclipse User |
|
|
|
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 10:32  |
Eclipse User |
|
|
|
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 #606897 is a reply to message #85927] |
Sat, 09 June 2007 08:29  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.33158 seconds