Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Column name for attribute override
Column name for attribute override [message #116797] Fri, 04 April 2008 00:50 Go to next message
Eclipse UserFriend
Originally posted by: pavata.vsp.com

Hi,
This is regarding the column name restriction on inherited field from a
superclass. We have a parent class and subclass hierarchy as Email.xsd and
MyEmail.xsd respectively. A field name emailaddress is inherited from Email
class to MyEmail class and the attribute override column name is
EMAIL_ADDRESS. But teneo overrides the column name as MYEMAIL_ADDRES once it
identifies specified column name starts with parent class name. We don't
understand the need to override the column name when it counters this
situation. The specific class that is performing this is
ClassicMappingContext.class

Can you throw some light on this funtionality? It is forcing us to rename
our class names to some other names which we really don't want to.

- Pavan
Re: Column name for attribute override [message #116820 is a reply to message #116797] Fri, 04 April 2008 06:18 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Pavan,
Can you post a small xsd sample so I can better understand what you try to do?

btw, you can always replace the mapping context class with your own implementation which does what
you want. See the extensions mechanism of Teneo.

gr. Martin

Pavan Tata wrote:
> Hi,
> This is regarding the column name restriction on inherited field from a
> superclass. We have a parent class and subclass hierarchy as Email.xsd and
> MyEmail.xsd respectively. A field name emailaddress is inherited from Email
> class to MyEmail class and the attribute override column name is
> EMAIL_ADDRESS. But teneo overrides the column name as MYEMAIL_ADDRES once it
> identifies specified column name starts with parent class name. We don't
> understand the need to override the column name when it counters this
> situation. The specific class that is performing this is
> ClassicMappingContext.class
>
> Can you throw some light on this funtionality? It is forcing us to rename
> our class names to some other names which we really don't want to.
>
> - Pavan
>
>


--

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: Column name for attribute override [message #116882 is a reply to message #116820] Fri, 04 April 2008 16:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: pavata.vsp.com

Hi Martin,
I wanted to confirm with you before I have my own implementation of
mappingcontext. Here is what I am doing.

The superclass annotation is
<xsd:complexType name="Email">
<xsd:annotation><xsd:appinfo source="teneo.jpa">@MappedSuperclass
@Embeddable</xsd:appinfo></xsd:annotation>
<xsd:sequence>
<xsd:element default="" nillable="true" name="emailAddress"
type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="teneo.jpa">
@Column(name=XXX,nullable="false")
</xsd:appinfo>
<xsd:documentation>
Type of e-mail address [we need codes here]
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>

and subclass annotation is
<xsd:complexType name="MyEMail">
<xsd:annotation>
<xsd:appinfo source="teneo.jpa">
@AttributeOverrides({
@AttributeOverride(name="emailAddress", @Transient
column=@Column(name="EMAIL_ADDR", length="50")),

})
@Table(
name="CMR3607T"
uniqueConstraints = { @UniqueConstraint(columnNames={"EMAIL_SK"})
}
}
)
</xsd:appinfo>

And the column name in the hibernate mapping finally turns out to be
MYEMAIL_ADDR. Can you tell me why it is modifying the name?

- Pavan

"Martin Taal" <mtaal@elver.org> wrote in message
news:ft4h7q$taa$1@build.eclipse.org...
> Hi Pavan,
> Can you post a small xsd sample so I can better understand what you try to
> do?
>
> btw, you can always replace the mapping context class with your own
> implementation which does what
> you want. See the extensions mechanism of Teneo.
>
> gr. Martin
>
> Pavan Tata wrote:
>> Hi,
>> This is regarding the column name restriction on inherited field from a
>> superclass. We have a parent class and subclass hierarchy as Email.xsd
>> and MyEmail.xsd respectively. A field name emailaddress is inherited from
>> Email class to MyEmail class and the attribute override column name is
>> EMAIL_ADDRESS. But teneo overrides the column name as MYEMAIL_ADDRES once
>> it identifies specified column name starts with parent class name. We
>> don't understand the need to override the column name when it counters
>> this situation. The specific class that is performing this is
>> ClassicMappingContext.class
>>
>> Can you throw some light on this funtionality? It is forcing us to
>> rename our class names to some other names which we really don't want to.
>>
>> - Pavan
>
>
> --
>
> 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: Column name for attribute override [message #116895 is a reply to message #116882] Fri, 04 April 2008 17:20 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Pavan,
This renaming is required for the case that an ereference is inherited from a mapped superclass, in
this case the join-column of the e-reference will be placed in another table. If one ereference is
inherited by multiple subtypes then this goes wrong because they then all share the same join column
with foreign keys relating it to different tables, and multiple foreign keys on one column can not
point to different directions.

Currently there are two things which are wrong with this behavior:
- the renaming is not required for eattributes (afaics)
- it ignores the attributeoverrides annotation

I will repair this for the next build (within a few days or earlier).

In the meantime to work around this you can create your own MappingContext.

gr. Martin

Pavan Tata wrote:
> Hi Martin,
> I wanted to confirm with you before I have my own implementation of
> mappingcontext. Here is what I am doing.
>
> The superclass annotation is
> <xsd:complexType name="Email">
> <xsd:annotation><xsd:appinfo source="teneo.jpa">@MappedSuperclass
> @Embeddable</xsd:appinfo></xsd:annotation>
> <xsd:sequence>
> <xsd:element default="" nillable="true" name="emailAddress"
> type="xsd:string">
> <xsd:annotation>
> <xsd:appinfo source="teneo.jpa">
> @Column(name=XXX,nullable="false")
> </xsd:appinfo>
> <xsd:documentation>
> Type of e-mail address [we need codes here]
> </xsd:documentation>
> </xsd:annotation>
> </xsd:element>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:schema>
>
> and subclass annotation is
> <xsd:complexType name="MyEMail">
> <xsd:annotation>
> <xsd:appinfo source="teneo.jpa">
> @AttributeOverrides({
> @AttributeOverride(name="emailAddress", @Transient
> column=@Column(name="EMAIL_ADDR", length="50")),
>
> })
> @Table(
> name="CMR3607T"
> uniqueConstraints = { @UniqueConstraint(columnNames={"EMAIL_SK"})
> }
> }
> )
> </xsd:appinfo>
>
> And the column name in the hibernate mapping finally turns out to be
> MYEMAIL_ADDR. Can you tell me why it is modifying the name?
>
> - Pavan
>
> "Martin Taal" <mtaal@elver.org> wrote in message
> news:ft4h7q$taa$1@build.eclipse.org...
>> Hi Pavan,
>> Can you post a small xsd sample so I can better understand what you try to
>> do?
>>
>> btw, you can always replace the mapping context class with your own
>> implementation which does what
>> you want. See the extensions mechanism of Teneo.
>>
>> gr. Martin
>>
>> Pavan Tata wrote:
>>> Hi,
>>> This is regarding the column name restriction on inherited field from a
>>> superclass. We have a parent class and subclass hierarchy as Email.xsd
>>> and MyEmail.xsd respectively. A field name emailaddress is inherited from
>>> Email class to MyEmail class and the attribute override column name is
>>> EMAIL_ADDRESS. But teneo overrides the column name as MYEMAIL_ADDRES once
>>> it identifies specified column name starts with parent class name. We
>>> don't understand the need to override the column name when it counters
>>> this situation. The specific class that is performing this is
>>> ClassicMappingContext.class
>>>
>>> Can you throw some light on this funtionality? It is forcing us to
>>> rename our class names to some other names which we really don't want to.
>>>
>>> - Pavan
>>
>> --
>>
>> 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
>
>


--

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: Column name for attribute override [message #117046 is a reply to message #116882] Sun, 06 April 2008 21:01 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Pavan,
The latest I-build (of today) should solve this issue. Can you check?

gr. Martin

Pavan Tata wrote:
> Hi Martin,
> I wanted to confirm with you before I have my own implementation of
> mappingcontext. Here is what I am doing.
>
> The superclass annotation is
> <xsd:complexType name="Email">
> <xsd:annotation><xsd:appinfo source="teneo.jpa">@MappedSuperclass
> @Embeddable</xsd:appinfo></xsd:annotation>
> <xsd:sequence>
> <xsd:element default="" nillable="true" name="emailAddress"
> type="xsd:string">
> <xsd:annotation>
> <xsd:appinfo source="teneo.jpa">
> @Column(name=XXX,nullable="false")
> </xsd:appinfo>
> <xsd:documentation>
> Type of e-mail address [we need codes here]
> </xsd:documentation>
> </xsd:annotation>
> </xsd:element>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:schema>
>
> and subclass annotation is
> <xsd:complexType name="MyEMail">
> <xsd:annotation>
> <xsd:appinfo source="teneo.jpa">
> @AttributeOverrides({
> @AttributeOverride(name="emailAddress", @Transient
> column=@Column(name="EMAIL_ADDR", length="50")),
>
> })
> @Table(
> name="CMR3607T"
> uniqueConstraints = { @UniqueConstraint(columnNames={"EMAIL_SK"})
> }
> }
> )
> </xsd:appinfo>
>
> And the column name in the hibernate mapping finally turns out to be
> MYEMAIL_ADDR. Can you tell me why it is modifying the name?
>
> - Pavan
>
> "Martin Taal" <mtaal@elver.org> wrote in message
> news:ft4h7q$taa$1@build.eclipse.org...
>> Hi Pavan,
>> Can you post a small xsd sample so I can better understand what you try to
>> do?
>>
>> btw, you can always replace the mapping context class with your own
>> implementation which does what
>> you want. See the extensions mechanism of Teneo.
>>
>> gr. Martin
>>
>> Pavan Tata wrote:
>>> Hi,
>>> This is regarding the column name restriction on inherited field from a
>>> superclass. We have a parent class and subclass hierarchy as Email.xsd
>>> and MyEmail.xsd respectively. A field name emailaddress is inherited from
>>> Email class to MyEmail class and the attribute override column name is
>>> EMAIL_ADDRESS. But teneo overrides the column name as MYEMAIL_ADDRES once
>>> it identifies specified column name starts with parent class name. We
>>> don't understand the need to override the column name when it counters
>>> this situation. The specific class that is performing this is
>>> ClassicMappingContext.class
>>>
>>> Can you throw some light on this funtionality? It is forcing us to
>>> rename our class names to some other names which we really don't want to.
>>>
>>> - Pavan
>>
>> --
>>
>> 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
>
>


--

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: Column name for attribute override [message #117141 is a reply to message #117046] Mon, 07 April 2008 18:52 Go to previous message
Eclipse UserFriend
Originally posted by: pavata.vsp.com

Martin,
Yep, that fixed it. I really appreciate the fact that you are so quick in
applying these solutions....such a pleasure working you.

- Pavan

"Martin Taal" <mtaal@elver.org> wrote in message
news:ftbdo2$ne1$1@build.eclipse.org...
> Hi Pavan,
> The latest I-build (of today) should solve this issue. Can you check?
>
> gr. Martin
>
> Pavan Tata wrote:
>> Hi Martin,
>> I wanted to confirm with you before I have my own implementation of
>> mappingcontext. Here is what I am doing.
>>
>> The superclass annotation is
>> <xsd:complexType name="Email">
>> <xsd:annotation><xsd:appinfo source="teneo.jpa">@MappedSuperclass
>> @Embeddable</xsd:appinfo></xsd:annotation>
>> <xsd:sequence>
>> <xsd:element default="" nillable="true" name="emailAddress"
>> type="xsd:string">
>> <xsd:annotation>
>> <xsd:appinfo source="teneo.jpa">
>> @Column(name=XXX,nullable="false")
>> </xsd:appinfo>
>> <xsd:documentation>
>> Type of e-mail address [we need codes here]
>> </xsd:documentation>
>> </xsd:annotation>
>> </xsd:element>
>> </xsd:sequence>
>> </xsd:complexType>
>> </xsd:schema>
>>
>> and subclass annotation is
>> <xsd:complexType name="MyEMail">
>> <xsd:annotation>
>> <xsd:appinfo source="teneo.jpa">
>> @AttributeOverrides({
>> @AttributeOverride(name="emailAddress", @Transient
>> column=@Column(name="EMAIL_ADDR", length="50")),
>>
>> })
>> @Table(
>> name="CMR3607T"
>> uniqueConstraints = { @UniqueConstraint(columnNames={"EMAIL_SK"})
>> }
>> }
>> )
>> </xsd:appinfo>
>>
>> And the column name in the hibernate mapping finally turns out to be
>> MYEMAIL_ADDR. Can you tell me why it is modifying the name?
>>
>> - Pavan
>>
>> "Martin Taal" <mtaal@elver.org> wrote in message
>> news:ft4h7q$taa$1@build.eclipse.org...
>>> Hi Pavan,
>>> Can you post a small xsd sample so I can better understand what you try
>>> to do?
>>>
>>> btw, you can always replace the mapping context class with your own
>>> implementation which does what
>>> you want. See the extensions mechanism of Teneo.
>>>
>>> gr. Martin
>>>
>>> Pavan Tata wrote:
>>>> Hi,
>>>> This is regarding the column name restriction on inherited field from
>>>> a superclass. We have a parent class and subclass hierarchy as
>>>> Email.xsd and MyEmail.xsd respectively. A field name emailaddress is
>>>> inherited from Email class to MyEmail class and the attribute override
>>>> column name is EMAIL_ADDRESS. But teneo overrides the column name as
>>>> MYEMAIL_ADDRES once it identifies specified column name starts with
>>>> parent class name. We don't understand the need to override the column
>>>> name when it counters this situation. The specific class that is
>>>> performing this is ClassicMappingContext.class
>>>>
>>>> Can you throw some light on this funtionality? It is forcing us to
>>>> rename our class names to some other names which we really don't want
>>>> to.
>>>>
>>>> - Pavan
>>>
>>> --
>>>
>>> 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
>>
>>
>
>
> --
>
> 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: Column name for attribute override [message #616071 is a reply to message #116797] Fri, 04 April 2008 06:18 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Pavan,
Can you post a small xsd sample so I can better understand what you try to do?

btw, you can always replace the mapping context class with your own implementation which does what
you want. See the extensions mechanism of Teneo.

gr. Martin

Pavan Tata wrote:
> Hi,
> This is regarding the column name restriction on inherited field from a
> superclass. We have a parent class and subclass hierarchy as Email.xsd and
> MyEmail.xsd respectively. A field name emailaddress is inherited from Email
> class to MyEmail class and the attribute override column name is
> EMAIL_ADDRESS. But teneo overrides the column name as MYEMAIL_ADDRES once it
> identifies specified column name starts with parent class name. We don't
> understand the need to override the column name when it counters this
> situation. The specific class that is performing this is
> ClassicMappingContext.class
>
> Can you throw some light on this funtionality? It is forcing us to rename
> our class names to some other names which we really don't want to.
>
> - Pavan
>
>


--

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: Column name for attribute override [message #616076 is a reply to message #116820] Fri, 04 April 2008 16:11 Go to previous message
Eclipse UserFriend
Originally posted by: pavata.vsp.com

Hi Martin,
I wanted to confirm with you before I have my own implementation of
mappingcontext. Here is what I am doing.

The superclass annotation is
<xsd:complexType name="Email">
<xsd:annotation><xsd:appinfo source="teneo.jpa">@MappedSuperclass
@Embeddable</xsd:appinfo></xsd:annotation>
<xsd:sequence>
<xsd:element default="" nillable="true" name="emailAddress"
type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="teneo.jpa">
@Column(name=XXX,nullable="false")
</xsd:appinfo>
<xsd:documentation>
Type of e-mail address [we need codes here]
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>

and subclass annotation is
<xsd:complexType name="MyEMail">
<xsd:annotation>
<xsd:appinfo source="teneo.jpa">
@AttributeOverrides({
@AttributeOverride(name="emailAddress", @Transient
column=@Column(name="EMAIL_ADDR", length="50")),

})
@Table(
name="CMR3607T"
uniqueConstraints = { @UniqueConstraint(columnNames={"EMAIL_SK"})
}
}
)
</xsd:appinfo>

And the column name in the hibernate mapping finally turns out to be
MYEMAIL_ADDR. Can you tell me why it is modifying the name?

- Pavan

"Martin Taal" <mtaal@elver.org> wrote in message
news:ft4h7q$taa$1@build.eclipse.org...
> Hi Pavan,
> Can you post a small xsd sample so I can better understand what you try to
> do?
>
> btw, you can always replace the mapping context class with your own
> implementation which does what
> you want. See the extensions mechanism of Teneo.
>
> gr. Martin
>
> Pavan Tata wrote:
>> Hi,
>> This is regarding the column name restriction on inherited field from a
>> superclass. We have a parent class and subclass hierarchy as Email.xsd
>> and MyEmail.xsd respectively. A field name emailaddress is inherited from
>> Email class to MyEmail class and the attribute override column name is
>> EMAIL_ADDRESS. But teneo overrides the column name as MYEMAIL_ADDRES once
>> it identifies specified column name starts with parent class name. We
>> don't understand the need to override the column name when it counters
>> this situation. The specific class that is performing this is
>> ClassicMappingContext.class
>>
>> Can you throw some light on this funtionality? It is forcing us to
>> rename our class names to some other names which we really don't want to.
>>
>> - Pavan
>
>
> --
>
> 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: Column name for attribute override [message #616077 is a reply to message #116882] Fri, 04 April 2008 17:20 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Pavan,
This renaming is required for the case that an ereference is inherited from a mapped superclass, in
this case the join-column of the e-reference will be placed in another table. If one ereference is
inherited by multiple subtypes then this goes wrong because they then all share the same join column
with foreign keys relating it to different tables, and multiple foreign keys on one column can not
point to different directions.

Currently there are two things which are wrong with this behavior:
- the renaming is not required for eattributes (afaics)
- it ignores the attributeoverrides annotation

I will repair this for the next build (within a few days or earlier).

In the meantime to work around this you can create your own MappingContext.

gr. Martin

Pavan Tata wrote:
> Hi Martin,
> I wanted to confirm with you before I have my own implementation of
> mappingcontext. Here is what I am doing.
>
> The superclass annotation is
> <xsd:complexType name="Email">
> <xsd:annotation><xsd:appinfo source="teneo.jpa">@MappedSuperclass
> @Embeddable</xsd:appinfo></xsd:annotation>
> <xsd:sequence>
> <xsd:element default="" nillable="true" name="emailAddress"
> type="xsd:string">
> <xsd:annotation>
> <xsd:appinfo source="teneo.jpa">
> @Column(name=XXX,nullable="false")
> </xsd:appinfo>
> <xsd:documentation>
> Type of e-mail address [we need codes here]
> </xsd:documentation>
> </xsd:annotation>
> </xsd:element>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:schema>
>
> and subclass annotation is
> <xsd:complexType name="MyEMail">
> <xsd:annotation>
> <xsd:appinfo source="teneo.jpa">
> @AttributeOverrides({
> @AttributeOverride(name="emailAddress", @Transient
> column=@Column(name="EMAIL_ADDR", length="50")),
>
> })
> @Table(
> name="CMR3607T"
> uniqueConstraints = { @UniqueConstraint(columnNames={"EMAIL_SK"})
> }
> }
> )
> </xsd:appinfo>
>
> And the column name in the hibernate mapping finally turns out to be
> MYEMAIL_ADDR. Can you tell me why it is modifying the name?
>
> - Pavan
>
> "Martin Taal" <mtaal@elver.org> wrote in message
> news:ft4h7q$taa$1@build.eclipse.org...
>> Hi Pavan,
>> Can you post a small xsd sample so I can better understand what you try to
>> do?
>>
>> btw, you can always replace the mapping context class with your own
>> implementation which does what
>> you want. See the extensions mechanism of Teneo.
>>
>> gr. Martin
>>
>> Pavan Tata wrote:
>>> Hi,
>>> This is regarding the column name restriction on inherited field from a
>>> superclass. We have a parent class and subclass hierarchy as Email.xsd
>>> and MyEmail.xsd respectively. A field name emailaddress is inherited from
>>> Email class to MyEmail class and the attribute override column name is
>>> EMAIL_ADDRESS. But teneo overrides the column name as MYEMAIL_ADDRES once
>>> it identifies specified column name starts with parent class name. We
>>> don't understand the need to override the column name when it counters
>>> this situation. The specific class that is performing this is
>>> ClassicMappingContext.class
>>>
>>> Can you throw some light on this funtionality? It is forcing us to
>>> rename our class names to some other names which we really don't want to.
>>>
>>> - Pavan
>>
>> --
>>
>> 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
>
>


--

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: Column name for attribute override [message #616089 is a reply to message #116882] Sun, 06 April 2008 21:01 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Pavan,
The latest I-build (of today) should solve this issue. Can you check?

gr. Martin

Pavan Tata wrote:
> Hi Martin,
> I wanted to confirm with you before I have my own implementation of
> mappingcontext. Here is what I am doing.
>
> The superclass annotation is
> <xsd:complexType name="Email">
> <xsd:annotation><xsd:appinfo source="teneo.jpa">@MappedSuperclass
> @Embeddable</xsd:appinfo></xsd:annotation>
> <xsd:sequence>
> <xsd:element default="" nillable="true" name="emailAddress"
> type="xsd:string">
> <xsd:annotation>
> <xsd:appinfo source="teneo.jpa">
> @Column(name=XXX,nullable="false")
> </xsd:appinfo>
> <xsd:documentation>
> Type of e-mail address [we need codes here]
> </xsd:documentation>
> </xsd:annotation>
> </xsd:element>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:schema>
>
> and subclass annotation is
> <xsd:complexType name="MyEMail">
> <xsd:annotation>
> <xsd:appinfo source="teneo.jpa">
> @AttributeOverrides({
> @AttributeOverride(name="emailAddress", @Transient
> column=@Column(name="EMAIL_ADDR", length="50")),
>
> })
> @Table(
> name="CMR3607T"
> uniqueConstraints = { @UniqueConstraint(columnNames={"EMAIL_SK"})
> }
> }
> )
> </xsd:appinfo>
>
> And the column name in the hibernate mapping finally turns out to be
> MYEMAIL_ADDR. Can you tell me why it is modifying the name?
>
> - Pavan
>
> "Martin Taal" <mtaal@elver.org> wrote in message
> news:ft4h7q$taa$1@build.eclipse.org...
>> Hi Pavan,
>> Can you post a small xsd sample so I can better understand what you try to
>> do?
>>
>> btw, you can always replace the mapping context class with your own
>> implementation which does what
>> you want. See the extensions mechanism of Teneo.
>>
>> gr. Martin
>>
>> Pavan Tata wrote:
>>> Hi,
>>> This is regarding the column name restriction on inherited field from a
>>> superclass. We have a parent class and subclass hierarchy as Email.xsd
>>> and MyEmail.xsd respectively. A field name emailaddress is inherited from
>>> Email class to MyEmail class and the attribute override column name is
>>> EMAIL_ADDRESS. But teneo overrides the column name as MYEMAIL_ADDRES once
>>> it identifies specified column name starts with parent class name. We
>>> don't understand the need to override the column name when it counters
>>> this situation. The specific class that is performing this is
>>> ClassicMappingContext.class
>>>
>>> Can you throw some light on this funtionality? It is forcing us to
>>> rename our class names to some other names which we really don't want to.
>>>
>>> - Pavan
>>
>> --
>>
>> 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
>
>


--

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: Column name for attribute override [message #616096 is a reply to message #117046] Mon, 07 April 2008 18:52 Go to previous message
Eclipse UserFriend
Originally posted by: pavata.vsp.com

Martin,
Yep, that fixed it. I really appreciate the fact that you are so quick in
applying these solutions....such a pleasure working you.

- Pavan

"Martin Taal" <mtaal@elver.org> wrote in message
news:ftbdo2$ne1$1@build.eclipse.org...
> Hi Pavan,
> The latest I-build (of today) should solve this issue. Can you check?
>
> gr. Martin
>
> Pavan Tata wrote:
>> Hi Martin,
>> I wanted to confirm with you before I have my own implementation of
>> mappingcontext. Here is what I am doing.
>>
>> The superclass annotation is
>> <xsd:complexType name="Email">
>> <xsd:annotation><xsd:appinfo source="teneo.jpa">@MappedSuperclass
>> @Embeddable</xsd:appinfo></xsd:annotation>
>> <xsd:sequence>
>> <xsd:element default="" nillable="true" name="emailAddress"
>> type="xsd:string">
>> <xsd:annotation>
>> <xsd:appinfo source="teneo.jpa">
>> @Column(name=XXX,nullable="false")
>> </xsd:appinfo>
>> <xsd:documentation>
>> Type of e-mail address [we need codes here]
>> </xsd:documentation>
>> </xsd:annotation>
>> </xsd:element>
>> </xsd:sequence>
>> </xsd:complexType>
>> </xsd:schema>
>>
>> and subclass annotation is
>> <xsd:complexType name="MyEMail">
>> <xsd:annotation>
>> <xsd:appinfo source="teneo.jpa">
>> @AttributeOverrides({
>> @AttributeOverride(name="emailAddress", @Transient
>> column=@Column(name="EMAIL_ADDR", length="50")),
>>
>> })
>> @Table(
>> name="CMR3607T"
>> uniqueConstraints = { @UniqueConstraint(columnNames={"EMAIL_SK"})
>> }
>> }
>> )
>> </xsd:appinfo>
>>
>> And the column name in the hibernate mapping finally turns out to be
>> MYEMAIL_ADDR. Can you tell me why it is modifying the name?
>>
>> - Pavan
>>
>> "Martin Taal" <mtaal@elver.org> wrote in message
>> news:ft4h7q$taa$1@build.eclipse.org...
>>> Hi Pavan,
>>> Can you post a small xsd sample so I can better understand what you try
>>> to do?
>>>
>>> btw, you can always replace the mapping context class with your own
>>> implementation which does what
>>> you want. See the extensions mechanism of Teneo.
>>>
>>> gr. Martin
>>>
>>> Pavan Tata wrote:
>>>> Hi,
>>>> This is regarding the column name restriction on inherited field from
>>>> a superclass. We have a parent class and subclass hierarchy as
>>>> Email.xsd and MyEmail.xsd respectively. A field name emailaddress is
>>>> inherited from Email class to MyEmail class and the attribute override
>>>> column name is EMAIL_ADDRESS. But teneo overrides the column name as
>>>> MYEMAIL_ADDRES once it identifies specified column name starts with
>>>> parent class name. We don't understand the need to override the column
>>>> name when it counters this situation. The specific class that is
>>>> performing this is ClassicMappingContext.class
>>>>
>>>> Can you throw some light on this funtionality? It is forcing us to
>>>> rename our class names to some other names which we really don't want
>>>> to.
>>>>
>>>> - Pavan
>>>
>>> --
>>>
>>> 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
>>
>>
>
>
> --
>
> 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:[CDO] Starting server code
Next Topic:[Announce] Texo project proposal: EMF technology for web application development environments
Goto Forum:
  


Current Time: Wed Jun 23 19:28:18 GMT 2021

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

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

Back to the top