Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Teneo] PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH and @Table or @Column
[Teneo] PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH and @Table or @Column [message #636818] Tue, 02 November 2010 22:59 Go to next message
Nikita Missing nameFriend
Messages: 32
Registered: October 2009
Member
I am using the Teneo option MAXIMUM_SQL_NAME_LENGTH to limit the length of the table/column names generated by Teneo. However, I realized that this option also truncates the names specified explicitly using the @Table and @Column JPA annotations. I was wondering if there is another option I can use to configure Teneo such that: when table/column names are calculated from the EClass name, truncation would apply, but when a name is specified explicitly via a JPA annoatation, it would be used as-is, without applying truncation?

Thank you!
Nikita
Re: [Teneo] PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH and @Table or @Column [message #636822 is a reply to message #636818] Tue, 02 November 2010 23:25 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Nikita,
Hmm, actually, if the manually entered name is not violating this maximum sql name length then this should not happen.
Can you confirm that the explicit names you use are shorter than this maximum sql length (then it is a bug)? Or are they
longer than this limit?

gr. Martin

On 11/02/2010 11:59 PM, Nikita wrote:
> I am using the Teneo option MAXIMUM_SQL_NAME_LENGTH to limit the length
> of the table/column names generated by Teneo. However, I realized that
> this option also truncates the names specified explicitly using the
> @Table and @Column JPA annotations. I was wondering if there is another
> option I can use to configure Teneo such that: when table/column names
> are calculated from the EClass name, truncation would apply, but when a
> name is specified explicitly via a JPA annoatation, it would be used
> as-is, without applying truncation?
>
> Thank you!
> Nikita


--

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: [Teneo] PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH and @Table or @Column [message #636833 is a reply to message #636822] Wed, 03 November 2010 03:26 Go to previous messageGo to next message
Nikita Missing nameFriend
Messages: 32
Registered: October 2009
Member
Hi Martin,

I think the option is working correctly, just not how I expected. When the manually entered name is shorter than the max length setting, Teneo does NOT truncate the name. When the manually entered name is longer than the max length, it does get truncated.

What I would like to do is apply truncation only when the name is generated, and use manually entered names as-is, without applying truncation even if the name is longer than the limit. In my case, I need to limit the length of auto-generated names, but still allow specifying any name (of any length) via the @Table or @Column annotation.

If there is no such option in Teneo, would you recommend extending the name strategy to implement this?

Thank you,
Nikita
Re: [Teneo] PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH and @Table or @Column [message #636855 is a reply to message #636833] Wed, 03 November 2010 06:55 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Nikita,
Hmm, the 'problem' is that at that point (in the sqlname strategy) in the mapping process it is not known anymore which
names have been generated and which names have been set manually. But if you can somehow detect this (on the basis of
the generated or manual name) then implementing your own sql name strategy works. You should extend the
TeneoSQLNameStrategy and override the trunc and or convert methods.

The reason that it currently works as it does is that the max sql name length is ment for the case were the name length
is really a very strong limit which applies to all names (manual or generated).

gr. Martin

On 11/03/2010 04:26 AM, Nikita wrote:
> Hi Martin,
>
> I think the option is working correctly, just not how I expected. When
> the manually entered name is shorter than the max length setting, Teneo
> does NOT truncate the name. When the manually entered name is longer
> than the max length, it does get truncated.
>
> What I would like to do is apply truncation only when the name is
> generated, and use manually entered names as-is, without applying
> truncation even if the name is longer than the limit. In my case, I need
> to limit the length of auto-generated names, but still allow specifying
> any name (of any length) via the @Table or @Column annotation.
>
> If there is no such option in Teneo, would you recommend extending the
> name strategy to implement this?
>
> Thank you,
> Nikita


--

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
Previous Topic:[CDO] bad performances for few objects
Next Topic:EDataType creation
Goto Forum:
  


Current Time: Sat Apr 20 03:10:30 GMT 2024

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

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

Back to the top