HHH-8191 cleanup

This commit is contained in:
Brett Meyer 2015-01-19 19:01:03 -05:00
parent 027840018b
commit 715544febe
5 changed files with 18 additions and 32 deletions

View File

@ -22,23 +22,20 @@
* Boston, MA 02110-1301 USA
*/
package org.hibernate.dialect;
import java.sql.CallableStatement;
import java.sql.ResultSet;
import java.sql.Types;
import org.hibernate.HibernateException;
import org.hibernate.JDBCException;
import org.hibernate.LockOptions;
import org.hibernate.cfg.Environment;
import org.hibernate.dialect.function.SQLFunctionTemplate;
import org.hibernate.dialect.function.VarArgsSQLFunction;
import org.hibernate.exception.spi.TemplatedViolatedConstraintNameExtracter;
import org.hibernate.exception.spi.ViolatedConstraintNameExtracter;
import org.hibernate.type.StandardBasicTypes;
import java.sql.SQLException;
import org.hibernate.LockOptions;
import java.util.Map;
import org.hibernate.sql.ForUpdateFragment;
import org.hibernate.type.StandardBasicTypes;
import java.sql.CallableStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Types;
import java.util.Map;
/**
* A dialect for the Teradata database
*
@ -47,7 +44,7 @@ public class Teradata14Dialect extends TeradataDialect {
/**
* Constructor
*/
public Teradata13Dialect() {
public Teradata14Dialect() {
super();
//registerColumnType data types
registerColumnType( Types.BIGINT, "BIGINT" );
@ -218,11 +215,6 @@ public class Teradata14Dialect extends TeradataDialect {
return true;
}
@Override
public boolean isLockAppended() {
return false;
}
@Override
public boolean supportsLockTimeouts() {
return false;

View File

@ -91,11 +91,8 @@ public class Select {
buf.append(" order by ").append(orderByClause);
}
if (lockOptions.getLockMode()!=LockMode.NONE) {
if (dialect.isLockAppended())
buf.append( dialect.getForUpdateString(lockOptions) );
else
buf.insert(0,dialect.getForUpdateString(lockOptions));
if (lockOptions.getLockMode() != LockMode.NONE) {
buf.append(dialect.getForUpdateString(lockOptions));
}
return dialect.transformSelectString( buf.toString() );

View File

@ -23,6 +23,10 @@
*
*/
package org.hibernate.sql;
import org.hibernate.LockMode;
import org.hibernate.LockOptions;
import org.hibernate.dialect.Dialect;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@ -31,10 +35,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.hibernate.LockMode;
import org.hibernate.LockOptions;
import org.hibernate.dialect.Dialect;
/**
* An SQL <tt>SELECT</tt> statement with no table joins
*
@ -187,10 +187,7 @@ public class SimpleSelect {
if (orderBy!=null) buf.append(orderBy);
if (lockOptions!=null) {
if (dialect.isLockAppended())
buf.append( dialect.getForUpdateString(lockOptions) );
else
buf.insert(0,dialect.getForUpdateString(lockOptions));
buf.append( dialect.getForUpdateString(lockOptions) );
}
return dialect.transformSelectString( buf.toString() );

View File

@ -11,7 +11,7 @@ import javax.persistence.Id;
@Entity
public class Clothes {
private Integer id;
@Column(name = "type")
@Column(name = "`type`")
private String type;
private String flavor;

View File

@ -619,7 +619,7 @@ public class FooBarTest extends LegacyTestCase {
s.save(bar);
s.save(baz);
list = s.createQuery(
" from Bar bar where bar.baz.count=667 and bar.baz.count<>123 and not bar.baz.name='1-E-1'"
" from Bar bar where bar.baz.count=667 and bar.baz.count!=123 and not bar.baz.name='1-E-1'"
).list();
assertTrue( "query many-to-one", list.size()==1 );
list = s.createQuery( " from Bar i where i.baz.name='Bazza'" ).list();