[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-886) hbm2ddl generating too long index on MySQL

James Carman (JIRA) noreply at atlassian.com
Fri Jan 18 11:42:55 EST 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_29374 ] 

James Carman commented on HHH-886:
----------------------------------

Would it be possible for someone to maybe add a URL where we can get more information on this?  I am running into the same problem.  Googling comes up with this issue as the first place to find information, so it could be useful to other folks in the future.

> hbm2ddl generating too long index on MySQL
> ------------------------------------------
>
>                 Key: HHH-886
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-886
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.0.5
>         Environment: MySQL 4.1.11-standard, MyISAMI, table with default charset utf8
>            Reporter: Oleg Marchuk
>
> SchemaExport log:
> alter table CountryLocal drop foreign key FK610C39952D58FB2F;
> drop table if exists CountryLocal;
> drop table if exists schedule;
> create table CountryLocal (
>     id varchar(255) not null,
>     name varchar(255) not null,
>     lang varchar(255) not null,
>     primary key (id, lang)
> );
> 17:19:59,997 ERROR SchemaExport:167 - Unsuccessful: create table CountryLocal (id varchar(255) not null, name varchar(255) not null, lang varchar(255) not null, primary key (id, lang))
> 17:20:00,003 ERROR SchemaExport:168 - Syntax error or access violation message from server: "Specified key was too long; max key length is 1000 bytes"
> create table schedule (
>     id varchar(255) not null,
>     primary key (id)
> );
> alter table CountryLocal 
>     add index FK610C39952D58FB2F (id), 
>     add constraint FK610C39952D58FB2F 
>     foreign key (id) 
>     references schedule (id);
> 17:20:00,014 ERROR SchemaExport:167 - Unsuccessful: alter table CountryLocal add index FK610C39952D58FB2F (id), add constraint FK610C39952D58FB2F foreign key (id) references schedule (id)
> 17:20:00,015 ERROR SchemaExport:168 - Base table or view not found message from server: "Table 'test_oleg.CountryLocal' doesn't exist"
> Mapping:
> <?xml version="1.0"?>
> <!DOCTYPE hibernate-mapping PUBLIC
> "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
> <hibernate-mapping package="com.softzonenet">
> 	<class name="Test" table="schedule" lazy="false">
> 		<id name="id" type="string">
> 			<generator class="assigned" />
> 		</id>
> 		<map name="names" lazy="false" table="CountryLocal"
> 			cascade="delete">
> 			<key column="id" not-null="true" />
> 			<map-key type="string" column="lang" />
> 			<element type="string" column="name" not-null="true" />
> 		</map>
> 	</class>
> </hibernate-mapping>
> Class:
> package com.softzonenet;
> public class Test  {
>     
>     private String id = null;
>     
>     Test() {
>         
>     }
>     public String getId() {
>         return id;
>     }
>     public void setId(String id) {
>         this.id = id;
>     }
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list