|
Re: "Repeated column in mapping for entity" [message #70225 is a reply to message #70201] |
Fri, 02 February 2007 16:25 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hibernate does not support multiple inheritance. Teneo tries to overcome this missing feature but
the approach has limitations:
http://www.elver.org/hibernate/inheritance.html#Multiple+Inh eritance+Support
The 'trick' Teneo uses to support multiple inheritance is that it takes the first supertype as the
real superclass and considers the other inheritance tree as a mapped-superclass (copies the
properties to the subclass in the hibernate mapping). This results in two columns with the same name
in your case. Then if you use single_table inheritance these columns are placed in the same table
and a clash occurs. Teneo can do this better (check if a feature is already covered by the first
supertype). Can you enter a bugzilla for this?
For now to get you going the 'solution' is to use joined as the inheritance strategy.
gr. Martin
JG wrote:
> I have a class which has to inheritance paths to one of its
> superclasses. When throwing this class at Teneo/Hibernate, Hibernate(? I
> guess...) complains about
>
> "Repeated column in mapping for entity:
> rel.datatypes.RelationalTimestamp column: subsecondprecision (should be
> mapped with insert="false" update="false"
>
> Apparently, it is bothered by the field subsecondprecision, perhaps
> assuming it has the same field twice. Renaming the property did not help
> (it would complain about the column with the new name).
> I am not sure what actually happens if I set insertable and updatable to
> false as the error message suggests... the error message disappears, but
> since my attempt at renaming apparently applied to "both" properties
> (which are one and the same thing, but not for hibernate), might these
> settings not result in not being able to store this property at all?
>
> Regards
>
> Jürgen
--
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: "Repeated column in mapping for entity" [message #602061 is a reply to message #70201] |
Fri, 02 February 2007 16:25 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hibernate does not support multiple inheritance. Teneo tries to overcome this missing feature but
the approach has limitations:
http://www.elver.org/hibernate/inheritance.html#Multiple+Inh eritance+Support
The 'trick' Teneo uses to support multiple inheritance is that it takes the first supertype as the
real superclass and considers the other inheritance tree as a mapped-superclass (copies the
properties to the subclass in the hibernate mapping). This results in two columns with the same name
in your case. Then if you use single_table inheritance these columns are placed in the same table
and a clash occurs. Teneo can do this better (check if a feature is already covered by the first
supertype). Can you enter a bugzilla for this?
For now to get you going the 'solution' is to use joined as the inheritance strategy.
gr. Martin
JG wrote:
> I have a class which has to inheritance paths to one of its
> superclasses. When throwing this class at Teneo/Hibernate, Hibernate(? I
> guess...) complains about
>
> "Repeated column in mapping for entity:
> rel.datatypes.RelationalTimestamp column: subsecondprecision (should be
> mapped with insert="false" update="false"
>
> Apparently, it is bothered by the field subsecondprecision, perhaps
> assuming it has the same field twice. Renaming the property did not help
> (it would complain about the column with the new name).
> I am not sure what actually happens if I set insertable and updatable to
> false as the error message suggests... the error message disappears, but
> since my attempt at renaming apparently applied to "both" properties
> (which are one and the same thing, but not for hibernate), might these
> settings not result in not being able to store this property at all?
>
> Regards
>
> Jürgen
--
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.03873 seconds