|
|
|
@ -22,6 +22,8 @@ import com.fr.third.org.hibernate.dialect.identity.MySQLIdentityColumnSupport;
|
|
|
|
|
import com.fr.third.org.hibernate.dialect.pagination.AbstractLimitHandler; |
|
|
|
|
import com.fr.third.org.hibernate.dialect.pagination.LimitHandler; |
|
|
|
|
import com.fr.third.org.hibernate.dialect.pagination.LimitHelper; |
|
|
|
|
import com.fr.third.org.hibernate.dialect.unique.MySQLUniqueDelegate; |
|
|
|
|
import com.fr.third.org.hibernate.dialect.unique.UniqueDelegate; |
|
|
|
|
import com.fr.third.org.hibernate.engine.spi.RowSelection; |
|
|
|
|
import com.fr.third.org.hibernate.exception.LockAcquisitionException; |
|
|
|
|
import com.fr.third.org.hibernate.exception.LockTimeoutException; |
|
|
|
@ -43,6 +45,8 @@ import com.fr.third.org.hibernate.type.StandardBasicTypes;
|
|
|
|
|
@SuppressWarnings("deprecation") |
|
|
|
|
public class MySQLDialect extends Dialect { |
|
|
|
|
|
|
|
|
|
private final UniqueDelegate uniqueDelegate; |
|
|
|
|
|
|
|
|
|
private static final LimitHandler LIMIT_HANDLER = new AbstractLimitHandler() { |
|
|
|
|
@Override |
|
|
|
|
public String processSql(String sql, RowSelection selection) { |
|
|
|
@ -196,6 +200,8 @@ public class MySQLDialect extends Dialect {
|
|
|
|
|
|
|
|
|
|
getDefaultProperties().setProperty( Environment.MAX_FETCH_DEPTH, "2" ); |
|
|
|
|
getDefaultProperties().setProperty( Environment.STATEMENT_BATCH_SIZE, DEFAULT_BATCH_SIZE ); |
|
|
|
|
|
|
|
|
|
uniqueDelegate = new MySQLUniqueDelegate( this ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected void registerVarcharTypes() { |
|
|
|
@ -234,6 +240,11 @@ public class MySQLDialect extends Dialect {
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public String getDropPrimaryKeyConstraintString(String constraintName) { |
|
|
|
|
return " drop primary key "; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean supportsLimit() { |
|
|
|
|
return true; |
|
|
|
@ -244,11 +255,6 @@ public class MySQLDialect extends Dialect {
|
|
|
|
|
return " drop foreign key "; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public String getDropPrimaryKeyConstraintString(String constraintName) { |
|
|
|
|
return " drop primary key "; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public LimitHandler getLimitHandler() { |
|
|
|
|
return LIMIT_HANDLER; |
|
|
|
@ -427,6 +433,11 @@ public class MySQLDialect extends Dialect {
|
|
|
|
|
return ps.getResultSet(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public UniqueDelegate getUniqueDelegate() { |
|
|
|
|
return uniqueDelegate; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean supportsRowValueConstructorSyntax() { |
|
|
|
|
return true; |
|
|
|
|