|
Re: AttributeOverride of Parent's Component [message #125474 is a reply to message #125408] |
Sat, 07 June 2008 21:10 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Alex,
AttributeOverride of parent component types is not yet supported. Can you create a bugzilla for
this? Can you also post the exception stack trace you see?
It would be great if you can also post a complete xsd which contains this case.
gr. Martin
gr. Martin
Alex Black wrote:
> Hello,
> A co-worked of mine has the following situation:
> He has a base class (LensBase) with a Component (DatePeriod). He then
> derives from this base class (Lens) and wants to use AttributeOverride the
> database mapping for the parent class's component. That is, Lens wants to
> over-ride the database mapping for LensBase.effectiveDatePeriod:
>
>
> <xsd:complexType name="DatePeriod">
> <xsd:annotation><xsd:appinfo source="teneo.jpa">@MappedSuperclass
> @Embeddable</xsd:appinfo></xsd:annotation>
> <xsd:sequence>
> </xsd:sequence>
> <!-- Primitive Data Fields -->
> <xsd:attribute name="start" type="xsd:date" use="required" />
> <xsd:attribute name="end" type="xsd:date" use="required" />
> </xsd:complexType>
>
> <xsd:complexType name="LensBase">
> <xsd:annotation>
> <xsd:appinfo source="teneo.jpa">
> @MappedSuperclass
> </xsd:appinfo>
> </xsd:annotation>
> <xsd:sequence>
> <xsd:element name="effectiveDatePeriod"
> type="DatePeriod" minOccurs="0">
> <xsd:annotation>
> <xsd:appinfo source="teneo.jpa">
> @Embedded
> </xsd:appinfo>
> </xsd:annotation>
>
> </xsd:element>
> </xsd:sequence>
> </xsd:complexType>
>
>
> <xsd:complexType name="Lens">
> <xsd:annotation>
> <xsd:appinfo source="teneo.jpa">
> @Entity
> @Table( name="CSA4521T" )
> @AttributeOverrides({
> @AttributeOverride(name="effectiveDatePeriod.start", column =
> @Column(name="PRODUCT_EFF_DT")),
> @AttributeOverride(name="effectiveDatePeriod.end", column =
> @Column(name="PRODUCT_TERM_DT")),
> @AttributeOverride(name="displayOrder", column =
> @Column(name="DISPLAY_SORT_NBR")) })
> </xsd:appinfo>
> <xsd:documentation>
> Lens Style Information
> </xsd:documentation>
> </xsd:annotation>
> <xsd:complexContent>
> <xsd:extension base="LensBase">
> <xsd:sequence>
> ...
> </xsd:sequence>
> </xsd:extension>
> </xsd:complexContent>
> </xsd:complexType>
>
>
> This doesn't work, it errors out with the name of the default hibernate
> generated columns instead of the mapped ones.
>
> Any ideas? Are we on the right track here?
>
> Thanks!
>
> -Alex
>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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: AttributeOverride of Parent's Component [message #619218 is a reply to message #125408] |
Sat, 07 June 2008 21:10 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Alex,
AttributeOverride of parent component types is not yet supported. Can you create a bugzilla for
this? Can you also post the exception stack trace you see?
It would be great if you can also post a complete xsd which contains this case.
gr. Martin
gr. Martin
Alex Black wrote:
> Hello,
> A co-worked of mine has the following situation:
> He has a base class (LensBase) with a Component (DatePeriod). He then
> derives from this base class (Lens) and wants to use AttributeOverride the
> database mapping for the parent class's component. That is, Lens wants to
> over-ride the database mapping for LensBase.effectiveDatePeriod:
>
>
> <xsd:complexType name="DatePeriod">
> <xsd:annotation><xsd:appinfo source="teneo.jpa">@MappedSuperclass
> @Embeddable</xsd:appinfo></xsd:annotation>
> <xsd:sequence>
> </xsd:sequence>
> <!-- Primitive Data Fields -->
> <xsd:attribute name="start" type="xsd:date" use="required" />
> <xsd:attribute name="end" type="xsd:date" use="required" />
> </xsd:complexType>
>
> <xsd:complexType name="LensBase">
> <xsd:annotation>
> <xsd:appinfo source="teneo.jpa">
> @MappedSuperclass
> </xsd:appinfo>
> </xsd:annotation>
> <xsd:sequence>
> <xsd:element name="effectiveDatePeriod"
> type="DatePeriod" minOccurs="0">
> <xsd:annotation>
> <xsd:appinfo source="teneo.jpa">
> @Embedded
> </xsd:appinfo>
> </xsd:annotation>
>
> </xsd:element>
> </xsd:sequence>
> </xsd:complexType>
>
>
> <xsd:complexType name="Lens">
> <xsd:annotation>
> <xsd:appinfo source="teneo.jpa">
> @Entity
> @Table( name="CSA4521T" )
> @AttributeOverrides({
> @AttributeOverride(name="effectiveDatePeriod.start", column =
> @Column(name="PRODUCT_EFF_DT")),
> @AttributeOverride(name="effectiveDatePeriod.end", column =
> @Column(name="PRODUCT_TERM_DT")),
> @AttributeOverride(name="displayOrder", column =
> @Column(name="DISPLAY_SORT_NBR")) })
> </xsd:appinfo>
> <xsd:documentation>
> Lens Style Information
> </xsd:documentation>
> </xsd:annotation>
> <xsd:complexContent>
> <xsd:extension base="LensBase">
> <xsd:sequence>
> ...
> </xsd:sequence>
> </xsd:extension>
> </xsd:complexContent>
> </xsd:complexType>
>
>
> This doesn't work, it errors out with the name of the default hibernate
> generated columns instead of the mapped ones.
>
> Any ideas? Are we on the right track here?
>
> Thanks!
>
> -Alex
>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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.03042 seconds