Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Generated identifier names too long
[Teneo] Generated identifier names too long [message #111871] Thu, 07 February 2008 10:56 Go to next message
David Wynter is currently offline David WynterFriend
Messages: 4624
Registered: July 2009
Senior Member
Hi,

The XSD (a standard over which I have no control, other than deviating
from the standard) I am working from has fairly long descriptive names.
Thus when Hibernate attempts to generate the various identifier they end
up too long for the database to accommodate. Is there a way to get it to
use abbreviated names?

here is an example of a generated identifier name

accretionbehaviorchildren_fractionhandlingtype_fractionhandl ingtype_e_id

Thx,

David
Re: [Teneo] Generated identifier names too long [message #111872 is a reply to message #111871] Thu, 07 February 2008 11:11 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi David,
Yes can set this option to a value which can be handled by the database:
props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH , "25");

Although Teneo tries to be smart you should watch for nameclashes.

You can also try to set the option:
SET_FOREIGN_KEY_NAME to false
setting this to false will use hibernate foreign key naming (resulting in unreadable fk names but
they should be unique).

gr. Martin

david wrote:
> Hi,
>
> The XSD (a standard over which I have no control, other than deviating
> from the standard) I am working from has fairly long descriptive names.
> Thus when Hibernate attempts to generate the various identifier they end
> up too long for the database to accommodate. Is there a way to get it to
> use abbreviated names?
>
> here is an example of a generated identifier name
>
> accretionbehaviorchildren_fractionhandlingtype_fractionhandl ingtype_e_id
>
> Thx,
>
> David


--

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] Generated identifier names too long [message #111874 is a reply to message #111872] Thu, 07 February 2008 14:13 Go to previous messageGo to next message
David Wynter is currently offline David WynterFriend
Messages: 4624
Registered: July 2009
Senior Member
Using

props.setProperty(Environment.DRIVER, "com.mysql.jdbc.Driver");
props.setProperty(Environment.USER, "tLoader");
props.setProperty(Environment.PASS, "pass34w0rd");
props.setProperty(Environment.URL, "jdbc:mysql://192.168.0.3:3306/" +
dbName);
props.setProperty(Environment.DIALECT,
org.hibernate.dialect.MySQLInnoDBDialect.class.getName());
props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH , "32");
props.setProperty(PersistenceOptions.JOIN_COLUMN_NAMING_STRA TEGY,
"simple");
props.setProperty(PersistenceOptions.ALSO_MAP_AS_CLASS, "false");
props.setProperty(PersistenceOptions.DEFAULT_TEMPORAL_VALUE, "DATE");
props.setProperty(PersistenceOptions.DISABLE_ECONTAINER_MAPP ING, "true");


I still get lots of of identifier too long errors.

E.g.

49672 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate -
Unsuccessful: create table `indexbasevalue_indexbasevaluechildren` (id
bigint not null auto_increment, e_version integer not null, fme_feature
varchar(255),
`indexbasevaluechildren_calculationtype_calculationtype_id`
varchar(255), `indexbasevaluechildren_datetime_datetime_id`
varchar(255), `indexbasevaluechildren_fraction_fraction_id`
varchar(255),
`indexbasevaluechildren_fractionhandlingtype_fractionhandlin gtype_id`
varchar(255),
`indexbasevaluechildren_indicatorstype_indicatorstype_e_id`
varchar(255), `indexbasevaluechildren_marketcenter_marketcenter_e_id`
varchar(255), `indexbasevaluechildren_multiplier_multiplier_e_id`
varchar(255),
`indexbasevaluechildren_previousdatetime_previousdatetime_e_ id`
varchar(255),
`indexbasevaluechildren_quantitydescriptiontype_quantitydesc riptiontype_e_id`
varchar(255), `indexbasevaluechildren_quantitytype_quantitytype_e_id`
varchar(255), `indexbasevaluechildren_valuationref_valuationref_e_id`
varchar(255), `indexbasevaluechildren_valuationtype_valuationtype_e_id`
varchar(255), `indexbasevaluechildren_unittype_unittype_e_id`
varchar(255), `mixed_indexbasevalue_indexbasevaluechildren_e_id` bigint,
`mixed_indexbasevalue_indexbasevaluechildren_idx` integer, primary key
(id)) type=InnoDB
49672 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - Identifier
name
'indexbasevaluechildren_fractionhandlingtype_fractionhandlin gtype_id' is
too long

Any other options I can change to control this, I'd prefer to have
meaningful names if possible. I initially tried
props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH , "64");
With the same result.

David

Martin Taal wrote:
> Hi David,
> Yes can set this option to a value which can be handled by the database:
> props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH , "25");
>
> Although Teneo tries to be smart you should watch for nameclashes.
>
> You can also try to set the option:
> SET_FOREIGN_KEY_NAME to false
> setting this to false will use hibernate foreign key naming (resulting
> in unreadable fk names but they should be unique).
>
> gr. Martin
>
> david wrote:
>> Hi,
>>
>> The XSD (a standard over which I have no control, other than deviating
>> from the standard) I am working from has fairly long descriptive
>> names. Thus when Hibernate attempts to generate the various identifier
>> they end up too long for the database to accommodate. Is there a way
>> to get it to use abbreviated names?
>>
>> here is an example of a generated identifier name
>>
>> accretionbehaviorchildren_fractionhandlingtype_fractionhandl ingtype_e_id
>>
>> Thx,
>>
>> David
>
>
Re: [Teneo] Generated identifier names too long [message #111875 is a reply to message #111874] Thu, 07 February 2008 14:15 Go to previous messageGo to next message
David Wynter is currently offline David WynterFriend
Messages: 4624
Registered: July 2009
Senior Member
Ignore this, I missed that I also need to load the Teneo persistance
properties separately.

david

david wrote:
> Using
>
> props.setProperty(Environment.DRIVER, "com.mysql.jdbc.Driver");
> props.setProperty(Environment.USER, "tLoader");
> props.setProperty(Environment.PASS, "pass34w0rd");
> props.setProperty(Environment.URL,
> "jdbc:mysql://192.168.0.3:3306/" + dbName);
> props.setProperty(Environment.DIALECT,
> org.hibernate.dialect.MySQLInnoDBDialect.class.getName());
> props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH ,
> "32");
>
> props.setProperty(PersistenceOptions.JOIN_COLUMN_NAMING_STRA TEGY,
> "simple");
> props.setProperty(PersistenceOptions.ALSO_MAP_AS_CLASS, "false");
> props.setProperty(PersistenceOptions.DEFAULT_TEMPORAL_VALUE,
> "DATE");
> props.setProperty(PersistenceOptions.DISABLE_ECONTAINER_MAPP ING,
> "true");
>
>
> I still get lots of of identifier too long errors.
>
> E.g.
>
> 49672 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate -
> Unsuccessful: create table `indexbasevalue_indexbasevaluechildren` (id
> bigint not null auto_increment, e_version integer not null, fme_feature
> varchar(255),
> `indexbasevaluechildren_calculationtype_calculationtype_id`
> varchar(255), `indexbasevaluechildren_datetime_datetime_id`
> varchar(255), `indexbasevaluechildren_fraction_fraction_id`
> varchar(255),
> `indexbasevaluechildren_fractionhandlingtype_fractionhandlin gtype_id`
> varchar(255),
> `indexbasevaluechildren_indicatorstype_indicatorstype_e_id`
> varchar(255), `indexbasevaluechildren_marketcenter_marketcenter_e_id`
> varchar(255), `indexbasevaluechildren_multiplier_multiplier_e_id`
> varchar(255),
> `indexbasevaluechildren_previousdatetime_previousdatetime_e_ id`
> varchar(255),
> `indexbasevaluechildren_quantitydescriptiontype_quantitydesc riptiontype_e_id`
> varchar(255), `indexbasevaluechildren_quantitytype_quantitytype_e_id`
> varchar(255), `indexbasevaluechildren_valuationref_valuationref_e_id`
> varchar(255), `indexbasevaluechildren_valuationtype_valuationtype_e_id`
> varchar(255), `indexbasevaluechildren_unittype_unittype_e_id`
> varchar(255), `mixed_indexbasevalue_indexbasevaluechildren_e_id` bigint,
> `mixed_indexbasevalue_indexbasevaluechildren_idx` integer, primary key
> (id)) type=InnoDB
> 49672 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - Identifier
> name
> 'indexbasevaluechildren_fractionhandlingtype_fractionhandlin gtype_id' is
> too long
>
> Any other options I can change to control this, I'd prefer to have
> meaningful names if possible. I initially tried
> props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH , "64");
> With the same result.
>
> David
>
> Martin Taal wrote:
>> Hi David,
>> Yes can set this option to a value which can be handled by the database:
>> props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH , "25");
>>
>> Although Teneo tries to be smart you should watch for nameclashes.
>>
>> You can also try to set the option:
>> SET_FOREIGN_KEY_NAME to false
>> setting this to false will use hibernate foreign key naming (resulting
>> in unreadable fk names but they should be unique).
>>
>> gr. Martin
>>
>> david wrote:
>>> Hi,
>>>
>>> The XSD (a standard over which I have no control, other than
>>> deviating from the standard) I am working from has fairly long
>>> descriptive names. Thus when Hibernate attempts to generate the
>>> various identifier they end up too long for the database to
>>> accommodate. Is there a way to get it to use abbreviated names?
>>>
>>> here is an example of a generated identifier name
>>>
>>> accretionbehaviorchildren_fractionhandlingtype_fractionhandl ingtype_e_id
>>>
>>> Thx,
>>>
>>> David
>>
>>
Re: [Teneo] Generated identifier names too long [message #111876 is a reply to message #111875] Thu, 07 February 2008 14:22 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi David,
I was just going to post this as a reply, your confusion is by the way not surprising, I think it
would be simpler to change this to one setProperty method.

gr. Martin

david wrote:
> Ignore this, I missed that I also need to load the Teneo persistance
> properties separately.
>
> david
>
> david wrote:
>> Using
>>
>> props.setProperty(Environment.DRIVER, "com.mysql.jdbc.Driver");
>> props.setProperty(Environment.USER, "tLoader");
>> props.setProperty(Environment.PASS, "pass34w0rd");
>> props.setProperty(Environment.URL,
>> "jdbc:mysql://192.168.0.3:3306/" + dbName);
>> props.setProperty(Environment.DIALECT,
>> org.hibernate.dialect.MySQLInnoDBDialect.class.getName());
>> props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH ,
>> "32");
>>
>> props.setProperty(PersistenceOptions.JOIN_COLUMN_NAMING_STRA TEGY,
>> "simple");
>> props.setProperty(PersistenceOptions.ALSO_MAP_AS_CLASS, "false");
>> props.setProperty(PersistenceOptions.DEFAULT_TEMPORAL_VALUE,
>> "DATE");
>>
>> props.setProperty(PersistenceOptions.DISABLE_ECONTAINER_MAPP ING, "true");
>>
>>
>> I still get lots of of identifier too long errors.
>>
>> E.g.
>>
>> 49672 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate -
>> Unsuccessful: create table `indexbasevalue_indexbasevaluechildren` (id
>> bigint not null auto_increment, e_version integer not null,
>> fme_feature varchar(255),
>> `indexbasevaluechildren_calculationtype_calculationtype_id`
>> varchar(255), `indexbasevaluechildren_datetime_datetime_id`
>> varchar(255), `indexbasevaluechildren_fraction_fraction_id`
>> varchar(255),
>> `indexbasevaluechildren_fractionhandlingtype_fractionhandlin gtype_id`
>> varchar(255),
>> `indexbasevaluechildren_indicatorstype_indicatorstype_e_id`
>> varchar(255), `indexbasevaluechildren_marketcenter_marketcenter_e_id`
>> varchar(255), `indexbasevaluechildren_multiplier_multiplier_e_id`
>> varchar(255),
>> `indexbasevaluechildren_previousdatetime_previousdatetime_e_ id`
>> varchar(255),
>> `indexbasevaluechildren_quantitydescriptiontype_quantitydesc riptiontype_e_id`
>> varchar(255), `indexbasevaluechildren_quantitytype_quantitytype_e_id`
>> varchar(255), `indexbasevaluechildren_valuationref_valuationref_e_id`
>> varchar(255),
>> `indexbasevaluechildren_valuationtype_valuationtype_e_id`
>> varchar(255), `indexbasevaluechildren_unittype_unittype_e_id`
>> varchar(255), `mixed_indexbasevalue_indexbasevaluechildren_e_id`
>> bigint, `mixed_indexbasevalue_indexbasevaluechildren_idx` integer,
>> primary key (id)) type=InnoDB
>> 49672 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate -
>> Identifier name
>> 'indexbasevaluechildren_fractionhandlingtype_fractionhandlin gtype_id'
>> is too long
>>
>> Any other options I can change to control this, I'd prefer to have
>> meaningful names if possible. I initially tried
>> props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH , "64");
>> With the same result.
>>
>> David
>>
>> Martin Taal wrote:
>>> Hi David,
>>> Yes can set this option to a value which can be handled by the database:
>>> props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH , "25");
>>>
>>> Although Teneo tries to be smart you should watch for nameclashes.
>>>
>>> You can also try to set the option:
>>> SET_FOREIGN_KEY_NAME to false
>>> setting this to false will use hibernate foreign key naming
>>> (resulting in unreadable fk names but they should be unique).
>>>
>>> gr. Martin
>>>
>>> david wrote:
>>>> Hi,
>>>>
>>>> The XSD (a standard over which I have no control, other than
>>>> deviating from the standard) I am working from has fairly long
>>>> descriptive names. Thus when Hibernate attempts to generate the
>>>> various identifier they end up too long for the database to
>>>> accommodate. Is there a way to get it to use abbreviated names?
>>>>
>>>> here is an example of a generated identifier name
>>>>
>>>> accretionbehaviorchildren_fractionhandlingtype_fractionhandl ingtype_e_id
>>>>
>>>>
>>>> Thx,
>>>>
>>>> David
>>>
>>>


--

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] Generated identifier names too long [message #615422 is a reply to message #111871] Thu, 07 February 2008 11:11 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi David,
Yes can set this option to a value which can be handled by the database:
props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH , "25");

Although Teneo tries to be smart you should watch for nameclashes.

You can also try to set the option:
SET_FOREIGN_KEY_NAME to false
setting this to false will use hibernate foreign key naming (resulting in unreadable fk names but
they should be unique).

gr. Martin

david wrote:
> Hi,
>
> The XSD (a standard over which I have no control, other than deviating
> from the standard) I am working from has fairly long descriptive names.
> Thus when Hibernate attempts to generate the various identifier they end
> up too long for the database to accommodate. Is there a way to get it to
> use abbreviated names?
>
> here is an example of a generated identifier name
>
> accretionbehaviorchildren_fractionhandlingtype_fractionhandl ingtype_e_id
>
> Thx,
>
> David


--

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] Generated identifier names too long [message #615424 is a reply to message #111872] Thu, 07 February 2008 14:13 Go to previous message
David Wynter is currently offline David WynterFriend
Messages: 4624
Registered: July 2009
Senior Member
Using

props.setProperty(Environment.DRIVER, "com.mysql.jdbc.Driver");
props.setProperty(Environment.USER, "tLoader");
props.setProperty(Environment.PASS, "pass34w0rd");
props.setProperty(Environment.URL, "jdbc:mysql://192.168.0.3:3306/" +
dbName);
props.setProperty(Environment.DIALECT,
org.hibernate.dialect.MySQLInnoDBDialect.class.getName());
props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH , "32");
props.setProperty(PersistenceOptions.JOIN_COLUMN_NAMING_STRA TEGY,
"simple");
props.setProperty(PersistenceOptions.ALSO_MAP_AS_CLASS, "false");
props.setProperty(PersistenceOptions.DEFAULT_TEMPORAL_VALUE, "DATE");
props.setProperty(PersistenceOptions.DISABLE_ECONTAINER_MAPP ING, "true");


I still get lots of of identifier too long errors.

E.g.

49672 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate -
Unsuccessful: create table `indexbasevalue_indexbasevaluechildren` (id
bigint not null auto_increment, e_version integer not null, fme_feature
varchar(255),
`indexbasevaluechildren_calculationtype_calculationtype_id`
varchar(255), `indexbasevaluechildren_datetime_datetime_id`
varchar(255), `indexbasevaluechildren_fraction_fraction_id`
varchar(255),
`indexbasevaluechildren_fractionhandlingtype_fractionhandlin gtype_id`
varchar(255),
`indexbasevaluechildren_indicatorstype_indicatorstype_e_id`
varchar(255), `indexbasevaluechildren_marketcenter_marketcenter_e_id`
varchar(255), `indexbasevaluechildren_multiplier_multiplier_e_id`
varchar(255),
`indexbasevaluechildren_previousdatetime_previousdatetime_e_ id`
varchar(255),
`indexbasevaluechildren_quantitydescriptiontype_quantitydesc riptiontype_e_id`
varchar(255), `indexbasevaluechildren_quantitytype_quantitytype_e_id`
varchar(255), `indexbasevaluechildren_valuationref_valuationref_e_id`
varchar(255), `indexbasevaluechildren_valuationtype_valuationtype_e_id`
varchar(255), `indexbasevaluechildren_unittype_unittype_e_id`
varchar(255), `mixed_indexbasevalue_indexbasevaluechildren_e_id` bigint,
`mixed_indexbasevalue_indexbasevaluechildren_idx` integer, primary key
(id)) type=InnoDB
49672 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - Identifier
name
'indexbasevaluechildren_fractionhandlingtype_fractionhandlin gtype_id' is
too long

Any other options I can change to control this, I'd prefer to have
meaningful names if possible. I initially tried
props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH , "64");
With the same result.

David

Martin Taal wrote:
> Hi David,
> Yes can set this option to a value which can be handled by the database:
> props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH , "25");
>
> Although Teneo tries to be smart you should watch for nameclashes.
>
> You can also try to set the option:
> SET_FOREIGN_KEY_NAME to false
> setting this to false will use hibernate foreign key naming (resulting
> in unreadable fk names but they should be unique).
>
> gr. Martin
>
> david wrote:
>> Hi,
>>
>> The XSD (a standard over which I have no control, other than deviating
>> from the standard) I am working from has fairly long descriptive
>> names. Thus when Hibernate attempts to generate the various identifier
>> they end up too long for the database to accommodate. Is there a way
>> to get it to use abbreviated names?
>>
>> here is an example of a generated identifier name
>>
>> accretionbehaviorchildren_fractionhandlingtype_fractionhandl ingtype_e_id
>>
>> Thx,
>>
>> David
>
>
Re: [Teneo] Generated identifier names too long [message #615425 is a reply to message #111874] Thu, 07 February 2008 14:15 Go to previous message
David Wynter is currently offline David WynterFriend
Messages: 4624
Registered: July 2009
Senior Member
Ignore this, I missed that I also need to load the Teneo persistance
properties separately.

david

david wrote:
> Using
>
> props.setProperty(Environment.DRIVER, "com.mysql.jdbc.Driver");
> props.setProperty(Environment.USER, "tLoader");
> props.setProperty(Environment.PASS, "pass34w0rd");
> props.setProperty(Environment.URL,
> "jdbc:mysql://192.168.0.3:3306/" + dbName);
> props.setProperty(Environment.DIALECT,
> org.hibernate.dialect.MySQLInnoDBDialect.class.getName());
> props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH ,
> "32");
>
> props.setProperty(PersistenceOptions.JOIN_COLUMN_NAMING_STRA TEGY,
> "simple");
> props.setProperty(PersistenceOptions.ALSO_MAP_AS_CLASS, "false");
> props.setProperty(PersistenceOptions.DEFAULT_TEMPORAL_VALUE,
> "DATE");
> props.setProperty(PersistenceOptions.DISABLE_ECONTAINER_MAPP ING,
> "true");
>
>
> I still get lots of of identifier too long errors.
>
> E.g.
>
> 49672 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate -
> Unsuccessful: create table `indexbasevalue_indexbasevaluechildren` (id
> bigint not null auto_increment, e_version integer not null, fme_feature
> varchar(255),
> `indexbasevaluechildren_calculationtype_calculationtype_id`
> varchar(255), `indexbasevaluechildren_datetime_datetime_id`
> varchar(255), `indexbasevaluechildren_fraction_fraction_id`
> varchar(255),
> `indexbasevaluechildren_fractionhandlingtype_fractionhandlin gtype_id`
> varchar(255),
> `indexbasevaluechildren_indicatorstype_indicatorstype_e_id`
> varchar(255), `indexbasevaluechildren_marketcenter_marketcenter_e_id`
> varchar(255), `indexbasevaluechildren_multiplier_multiplier_e_id`
> varchar(255),
> `indexbasevaluechildren_previousdatetime_previousdatetime_e_ id`
> varchar(255),
> `indexbasevaluechildren_quantitydescriptiontype_quantitydesc riptiontype_e_id`
> varchar(255), `indexbasevaluechildren_quantitytype_quantitytype_e_id`
> varchar(255), `indexbasevaluechildren_valuationref_valuationref_e_id`
> varchar(255), `indexbasevaluechildren_valuationtype_valuationtype_e_id`
> varchar(255), `indexbasevaluechildren_unittype_unittype_e_id`
> varchar(255), `mixed_indexbasevalue_indexbasevaluechildren_e_id` bigint,
> `mixed_indexbasevalue_indexbasevaluechildren_idx` integer, primary key
> (id)) type=InnoDB
> 49672 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate - Identifier
> name
> 'indexbasevaluechildren_fractionhandlingtype_fractionhandlin gtype_id' is
> too long
>
> Any other options I can change to control this, I'd prefer to have
> meaningful names if possible. I initially tried
> props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH , "64");
> With the same result.
>
> David
>
> Martin Taal wrote:
>> Hi David,
>> Yes can set this option to a value which can be handled by the database:
>> props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH , "25");
>>
>> Although Teneo tries to be smart you should watch for nameclashes.
>>
>> You can also try to set the option:
>> SET_FOREIGN_KEY_NAME to false
>> setting this to false will use hibernate foreign key naming (resulting
>> in unreadable fk names but they should be unique).
>>
>> gr. Martin
>>
>> david wrote:
>>> Hi,
>>>
>>> The XSD (a standard over which I have no control, other than
>>> deviating from the standard) I am working from has fairly long
>>> descriptive names. Thus when Hibernate attempts to generate the
>>> various identifier they end up too long for the database to
>>> accommodate. Is there a way to get it to use abbreviated names?
>>>
>>> here is an example of a generated identifier name
>>>
>>> accretionbehaviorchildren_fractionhandlingtype_fractionhandl ingtype_e_id
>>>
>>> Thx,
>>>
>>> David
>>
>>
Re: [Teneo] Generated identifier names too long [message #615426 is a reply to message #111875] Thu, 07 February 2008 14:22 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi David,
I was just going to post this as a reply, your confusion is by the way not surprising, I think it
would be simpler to change this to one setProperty method.

gr. Martin

david wrote:
> Ignore this, I missed that I also need to load the Teneo persistance
> properties separately.
>
> david
>
> david wrote:
>> Using
>>
>> props.setProperty(Environment.DRIVER, "com.mysql.jdbc.Driver");
>> props.setProperty(Environment.USER, "tLoader");
>> props.setProperty(Environment.PASS, "pass34w0rd");
>> props.setProperty(Environment.URL,
>> "jdbc:mysql://192.168.0.3:3306/" + dbName);
>> props.setProperty(Environment.DIALECT,
>> org.hibernate.dialect.MySQLInnoDBDialect.class.getName());
>> props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH ,
>> "32");
>>
>> props.setProperty(PersistenceOptions.JOIN_COLUMN_NAMING_STRA TEGY,
>> "simple");
>> props.setProperty(PersistenceOptions.ALSO_MAP_AS_CLASS, "false");
>> props.setProperty(PersistenceOptions.DEFAULT_TEMPORAL_VALUE,
>> "DATE");
>>
>> props.setProperty(PersistenceOptions.DISABLE_ECONTAINER_MAPP ING, "true");
>>
>>
>> I still get lots of of identifier too long errors.
>>
>> E.g.
>>
>> 49672 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate -
>> Unsuccessful: create table `indexbasevalue_indexbasevaluechildren` (id
>> bigint not null auto_increment, e_version integer not null,
>> fme_feature varchar(255),
>> `indexbasevaluechildren_calculationtype_calculationtype_id`
>> varchar(255), `indexbasevaluechildren_datetime_datetime_id`
>> varchar(255), `indexbasevaluechildren_fraction_fraction_id`
>> varchar(255),
>> `indexbasevaluechildren_fractionhandlingtype_fractionhandlin gtype_id`
>> varchar(255),
>> `indexbasevaluechildren_indicatorstype_indicatorstype_e_id`
>> varchar(255), `indexbasevaluechildren_marketcenter_marketcenter_e_id`
>> varchar(255), `indexbasevaluechildren_multiplier_multiplier_e_id`
>> varchar(255),
>> `indexbasevaluechildren_previousdatetime_previousdatetime_e_ id`
>> varchar(255),
>> `indexbasevaluechildren_quantitydescriptiontype_quantitydesc riptiontype_e_id`
>> varchar(255), `indexbasevaluechildren_quantitytype_quantitytype_e_id`
>> varchar(255), `indexbasevaluechildren_valuationref_valuationref_e_id`
>> varchar(255),
>> `indexbasevaluechildren_valuationtype_valuationtype_e_id`
>> varchar(255), `indexbasevaluechildren_unittype_unittype_e_id`
>> varchar(255), `mixed_indexbasevalue_indexbasevaluechildren_e_id`
>> bigint, `mixed_indexbasevalue_indexbasevaluechildren_idx` integer,
>> primary key (id)) type=InnoDB
>> 49672 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate -
>> Identifier name
>> 'indexbasevaluechildren_fractionhandlingtype_fractionhandlin gtype_id'
>> is too long
>>
>> Any other options I can change to control this, I'd prefer to have
>> meaningful names if possible. I initially tried
>> props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH , "64");
>> With the same result.
>>
>> David
>>
>> Martin Taal wrote:
>>> Hi David,
>>> Yes can set this option to a value which can be handled by the database:
>>> props.setProperty(PersistenceOptions.MAXIMUM_SQL_NAME_LENGTH , "25");
>>>
>>> Although Teneo tries to be smart you should watch for nameclashes.
>>>
>>> You can also try to set the option:
>>> SET_FOREIGN_KEY_NAME to false
>>> setting this to false will use hibernate foreign key naming
>>> (resulting in unreadable fk names but they should be unique).
>>>
>>> gr. Martin
>>>
>>> david wrote:
>>>> Hi,
>>>>
>>>> The XSD (a standard over which I have no control, other than
>>>> deviating from the standard) I am working from has fairly long
>>>> descriptive names. Thus when Hibernate attempts to generate the
>>>> various identifier they end up too long for the database to
>>>> accommodate. Is there a way to get it to use abbreviated names?
>>>>
>>>> here is an example of a generated identifier name
>>>>
>>>> accretionbehaviorchildren_fractionhandlingtype_fractionhandl ingtype_e_id
>>>>
>>>>
>>>> Thx,
>>>>
>>>> David
>>>
>>>


--

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:[EMF Compare] version number for EMF 2.3
Next Topic:Hibernate: driver not found com.mysql.JDBC.driver
Goto Forum:
  


Current Time: Wed Apr 24 16:49:03 GMT 2024

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

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

Back to the top