public class

MySQLDialect

extends MySQLDialect
java.lang.Object
   ↳ net.sf.hibernate.dialect.Dialect
     ↳ net.sf.hibernate.dialect.MySQLDialect
       ↳ com.atlassian.hibernate.dialect.MySQLDialect

Class Overview

Custom MySQLDialect that specifies the constraint name when calling "add index". This fixes the problem of multiple indexes and FK contraints being created for tables when they already exist (CONF-1204)

Summary

[Expand]
Inherited Constants
From class net.sf.hibernate.dialect.Dialect
Public Constructors
MySQLDialect()
Public Methods
String getAddForeignKeyConstraintString(String constraintName, String[] foreignKey, String referencedTable, String[] primaryKey)
note: previously, this string also included an 'add index' component (which meant that for MySQL users get an index added for each of their FK's).
[Expand]
Inherited Methods
From class net.sf.hibernate.dialect.MySQLDialect
From class net.sf.hibernate.dialect.Dialect
From class java.lang.Object

Public Constructors

public MySQLDialect ()

Public Methods

public String getAddForeignKeyConstraintString (String constraintName, String[] foreignKey, String referencedTable, String[] primaryKey)

note: previously, this string also included an 'add index' component (which meant that for MySQL users get an index added for each of their FK's). However, since we now specify the indexes explicitly in the hibernate mapping files, we need to comment this count to prevent duplicate indexes.