mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-17 08:35:13 +00:00
HHH-7015 Remove PostgreSQLDialect
This commit is contained in:
parent
210fbd3fc8
commit
f1f4414266
@ -28,7 +28,6 @@
|
||||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.dialect.Dialect;
|
||||
import org.hibernate.dialect.PostgreSQL81Dialect;
|
||||
import org.hibernate.dialect.PostgreSQLDialect;
|
||||
import org.hibernate.engine.spi.TypedValue;
|
||||
|
||||
/**
|
||||
@ -58,7 +57,7 @@ public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery)
|
||||
if ( columns.length != 1 ) {
|
||||
throw new HibernateException( "ilike may only be used with single-column properties" );
|
||||
}
|
||||
if ( dialect instanceof PostgreSQLDialect || dialect instanceof PostgreSQL81Dialect) {
|
||||
if ( dialect instanceof PostgreSQL81Dialect) {
|
||||
return columns[0] + " ilike ?";
|
||||
}
|
||||
else {
|
||||
|
@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Hibernate, Relational Persistence for Idiomatic Java
|
||||
*
|
||||
* Copyright (c) 2010, Red Hat Inc. or third-party contributors as
|
||||
* indicated by the @author tags or express copyright attribution
|
||||
* statements applied by the authors. All third-party contributions are
|
||||
* distributed under license by Red Hat Inc.
|
||||
*
|
||||
* This copyrighted material is made available to anyone wishing to use, modify,
|
||||
* copy, or redistribute it subject to the terms and conditions of the GNU
|
||||
* Lesser General Public License, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
||||
* for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this distribution; if not, write to:
|
||||
* Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.dialect;
|
||||
|
||||
|
||||
/**
|
||||
* An SQL dialect for Postgres
|
||||
* <p/>
|
||||
* For discussion of BLOB support in Postgres, as of 8.4, have a peek at
|
||||
* <a href="http://jdbc.postgresql.org/documentation/84/binary-data.html">http://jdbc.postgresql.org/documentation/84/binary-data.html</a>.
|
||||
* For the effects in regards to Hibernate see <a href="http://in.relation.to/15492.lace">http://in.relation.to/15492.lace</a>
|
||||
*
|
||||
* @author Gavin King
|
||||
* @deprecated use {@link PostgreSQL82Dialect} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public class PostgreSQLDialect extends PostgreSQL82Dialect {
|
||||
}
|
@ -37,7 +37,7 @@
|
||||
*
|
||||
* @author Jim Mlodgenski
|
||||
*/
|
||||
public class PostgresPlusDialect extends PostgreSQLDialect {
|
||||
public class PostgresPlusDialect extends PostgreSQL82Dialect {
|
||||
|
||||
public PostgresPlusDialect() {
|
||||
super();
|
||||
|
@ -24,13 +24,17 @@
|
||||
*/
|
||||
package org.hibernate.test.annotations.query;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.MappingException;
|
||||
import org.hibernate.Query;
|
||||
import org.hibernate.SQLQuery;
|
||||
@ -38,7 +42,6 @@
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.cfg.Configuration;
|
||||
import org.hibernate.dialect.PostgreSQL81Dialect;
|
||||
import org.hibernate.dialect.PostgreSQLDialect;
|
||||
import org.hibernate.dialect.function.SQLFunction;
|
||||
import org.hibernate.stat.Statistics;
|
||||
import org.hibernate.test.annotations.A320;
|
||||
@ -48,12 +51,7 @@
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.SkipForDialect;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* Test named queries
|
||||
@ -357,7 +355,7 @@ public void testDiscriminator() throws Exception {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SkipForDialect(value = { PostgreSQL81Dialect.class, PostgreSQLDialect.class },
|
||||
@SkipForDialect(value = { PostgreSQL81Dialect.class },
|
||||
comment = "postgresql jdbc driver does not implement the setQueryTimeout method")
|
||||
public void testCache() throws Exception {
|
||||
Session s;
|
||||
|
@ -23,23 +23,21 @@
|
||||
*/
|
||||
package org.hibernate.test.annotations.xml.ejb3;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.dialect.PostgreSQL81Dialect;
|
||||
import org.hibernate.dialect.PostgreSQLDialect;
|
||||
import org.hibernate.persister.collection.BasicCollectionPersister;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.SkipForDialect;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author Emmanuel Bernard
|
||||
@ -47,7 +45,7 @@
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class Ejb3XmlTest extends BaseCoreFunctionalTestCase {
|
||||
@Test
|
||||
@SkipForDialect(value = { PostgreSQL81Dialect.class, PostgreSQLDialect.class },
|
||||
@SkipForDialect(value = { PostgreSQL81Dialect.class },
|
||||
comment = "postgresql jdbc driver does not implement the setQueryTimeout method")
|
||||
public void testEjb3Xml() throws Exception {
|
||||
Session s = openSession();
|
||||
|
@ -22,23 +22,21 @@
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.bidi;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.Hibernate;
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.dialect.PostgreSQL81Dialect;
|
||||
import org.hibernate.dialect.PostgreSQLDialect;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.SkipForDialect;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author Gavin King
|
||||
@ -52,7 +50,7 @@ public String[] getMappings() {
|
||||
|
||||
@Test
|
||||
@SuppressWarnings( {"unchecked"})
|
||||
@SkipForDialect( value = {PostgreSQL81Dialect.class, PostgreSQLDialect.class}, comment = "doesn't like boolean=1" )
|
||||
@SkipForDialect( value = {PostgreSQL81Dialect.class}, comment = "doesn't like boolean=1" )
|
||||
public void testLazy() {
|
||||
Session s = openSession();
|
||||
Transaction t = s.beginTransaction();
|
||||
|
@ -22,19 +22,17 @@
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.criteria;
|
||||
import java.util.List;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
import org.hibernate.dialect.MySQLDialect;
|
||||
import org.hibernate.dialect.PostgreSQL81Dialect;
|
||||
import org.hibernate.dialect.PostgreSQLDialect;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
public class LikeTest extends BaseCoreFunctionalTestCase {
|
||||
@ -68,7 +66,7 @@ public void testLike(){
|
||||
|
||||
assertEquals( 1, objects.size() );
|
||||
session.clear();
|
||||
if ( !( getDialect() instanceof MySQLDialect ) && ! ( getDialect() instanceof PostgreSQLDialect ) && ! ( getDialect() instanceof PostgreSQL81Dialect )) {
|
||||
if ( !( getDialect() instanceof MySQLDialect ) && ! ( getDialect() instanceof PostgreSQL81Dialect )) {
|
||||
// retrieve object - case insensitive via custom expression - works
|
||||
// ok
|
||||
objects = session.createCriteria( TestObject.class ).add(
|
||||
|
@ -22,19 +22,17 @@
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.formulajoin;
|
||||
import java.util.List;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.Test;
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.dialect.PostgreSQL81Dialect;
|
||||
import org.hibernate.dialect.PostgreSQLDialect;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author Gavin King
|
||||
@ -69,7 +67,7 @@ public void testFormulaJoin() {
|
||||
tx.commit();
|
||||
s.close();
|
||||
|
||||
if ( getDialect() instanceof PostgreSQLDialect || getDialect() instanceof PostgreSQL81Dialect ) return;
|
||||
if ( getDialect() instanceof PostgreSQL81Dialect ) return;
|
||||
|
||||
s = openSession();
|
||||
tx = s.beginTransaction();
|
||||
|
@ -23,6 +23,15 @@
|
||||
*/
|
||||
package org.hibernate.test.hql;
|
||||
|
||||
import static org.hibernate.testing.junit4.ExtraAssertions.assertClassAssignability;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.sql.Date;
|
||||
@ -35,9 +44,6 @@
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jboss.logging.Logger;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.Hibernate;
|
||||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.Query;
|
||||
@ -54,7 +60,6 @@
|
||||
import org.hibernate.dialect.MySQLDialect;
|
||||
import org.hibernate.dialect.Oracle8iDialect;
|
||||
import org.hibernate.dialect.PostgreSQL81Dialect;
|
||||
import org.hibernate.dialect.PostgreSQLDialect;
|
||||
import org.hibernate.dialect.SQLServer2008Dialect;
|
||||
import org.hibernate.dialect.SQLServerDialect;
|
||||
import org.hibernate.dialect.Sybase11Dialect;
|
||||
@ -86,15 +91,8 @@
|
||||
import org.hibernate.type.ComponentType;
|
||||
import org.hibernate.type.ManyToOneType;
|
||||
import org.hibernate.type.Type;
|
||||
|
||||
import static org.hibernate.testing.junit4.ExtraAssertions.assertClassAssignability;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
import org.jboss.logging.Logger;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* Tests the integration of the new AST parser into the loading of query results using
|
||||
@ -611,7 +609,7 @@ public void testExpressionWithParamInFunction() {
|
||||
else {
|
||||
s.createQuery( "from Animal where lower(upper('foo') || upper(:bar)) like 'f%'" ).setString( "bar", "xyz" ).list();
|
||||
}
|
||||
if ( ! ( getDialect() instanceof PostgreSQLDialect|| getDialect() instanceof PostgreSQL81Dialect || getDialect() instanceof MySQLDialect ) ) {
|
||||
if ( ! ( getDialect() instanceof PostgreSQL81Dialect || getDialect() instanceof MySQLDialect ) ) {
|
||||
s.createQuery( "from Animal where abs(cast(1 as float) - cast(:param as float)) = 1.0" ).setLong( "param", 1 ).list();
|
||||
}
|
||||
s.getTransaction().commit();
|
||||
@ -2923,7 +2921,7 @@ public void testEJBQLFunctions() throws Exception {
|
||||
* PostgreSQL >= 8.3.7 typecasts are no longer automatically allowed
|
||||
* <link>http://www.postgresql.org/docs/current/static/release-8-3.html</link>
|
||||
*/
|
||||
if(getDialect() instanceof PostgreSQLDialect || getDialect() instanceof PostgreSQL81Dialect || getDialect() instanceof HSQLDialect){
|
||||
if(getDialect() instanceof PostgreSQL81Dialect || getDialect() instanceof HSQLDialect){
|
||||
hql = "from Animal a where bit_length(str(a.bodyWeight)) = 24";
|
||||
}
|
||||
else{
|
||||
@ -2931,7 +2929,7 @@ public void testEJBQLFunctions() throws Exception {
|
||||
}
|
||||
|
||||
session.createQuery(hql).list();
|
||||
if(getDialect() instanceof PostgreSQLDialect || getDialect() instanceof PostgreSQL81Dialect || getDialect() instanceof HSQLDialect){
|
||||
if(getDialect() instanceof PostgreSQL81Dialect || getDialect() instanceof HSQLDialect){
|
||||
hql = "select bit_length(str(a.bodyWeight)) from Animal a";
|
||||
}else{
|
||||
hql = "select bit_length(a.bodyWeight) from Animal a";
|
||||
|
@ -22,6 +22,12 @@
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package org.hibernate.test.hql;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.util.ArrayList;
|
||||
@ -30,10 +36,6 @@
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import antlr.RecognitionException;
|
||||
import antlr.collections.AST;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.QueryException;
|
||||
import org.hibernate.dialect.DB2Dialect;
|
||||
import org.hibernate.dialect.H2Dialect;
|
||||
@ -42,7 +44,6 @@
|
||||
import org.hibernate.dialect.MySQLDialect;
|
||||
import org.hibernate.dialect.Oracle8iDialect;
|
||||
import org.hibernate.dialect.PostgreSQL81Dialect;
|
||||
import org.hibernate.dialect.PostgreSQLDialect;
|
||||
import org.hibernate.dialect.SQLServerDialect;
|
||||
import org.hibernate.dialect.Sybase11Dialect;
|
||||
import org.hibernate.dialect.SybaseASE15Dialect;
|
||||
@ -76,12 +77,10 @@
|
||||
import org.hibernate.type.CalendarDateType;
|
||||
import org.hibernate.type.DoubleType;
|
||||
import org.hibernate.type.StringType;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import antlr.RecognitionException;
|
||||
import antlr.collections.AST;
|
||||
|
||||
/**
|
||||
* Tests cases where the AST based query translator and the 'classic' query translator generate identical SQL.
|
||||
@ -357,7 +356,7 @@ public void testExpressionWithParamInFunction() {
|
||||
if ( !( getDialect() instanceof MySQLDialect ) && ! ( getDialect() instanceof SybaseDialect ) && ! ( getDialect() instanceof Sybase11Dialect ) && !( getDialect() instanceof SybaseASE15Dialect ) && ! ( getDialect() instanceof SybaseAnywhereDialect ) && ! ( getDialect() instanceof SQLServerDialect ) ) {
|
||||
assertTranslation("from Animal where lower(upper('foo') || upper(:bar)) like 'f%'");
|
||||
}
|
||||
if ( getDialect() instanceof PostgreSQLDialect || getDialect() instanceof PostgreSQL81Dialect ) {
|
||||
if ( getDialect() instanceof PostgreSQL81Dialect ) {
|
||||
return;
|
||||
}
|
||||
assertTranslation("from Animal where abs(cast(1 as float) - cast(:param as float)) = 1.0");
|
||||
@ -841,7 +840,7 @@ public void testOrderBy() throws Exception {
|
||||
@Test
|
||||
public void testGroupByFunction() {
|
||||
if ( getDialect() instanceof Oracle8iDialect ) return; // the new hiearchy...
|
||||
if ( getDialect() instanceof PostgreSQLDialect || getDialect() instanceof PostgreSQL81Dialect ) return;
|
||||
if ( getDialect() instanceof PostgreSQL81Dialect ) return;
|
||||
if ( ! H2Dialect.class.isInstance( getDialect() ) ) {
|
||||
// H2 has no year function
|
||||
assertTranslation( "select count(*) from Human h group by year(h.birthdate)" );
|
||||
|
@ -23,18 +23,16 @@
|
||||
*/
|
||||
package org.hibernate.test.inheritancediscriminator;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.dialect.PostgreSQL81Dialect;
|
||||
import org.hibernate.dialect.PostgreSQLDialect;
|
||||
import org.hibernate.testing.RequiresDialect;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author Pawel Stawicki
|
||||
*/
|
||||
@RequiresDialect( value = {PostgreSQL81Dialect.class, PostgreSQLDialect.class}, jiraKey = "HHH-6580" )
|
||||
@RequiresDialect( value = {PostgreSQL81Dialect.class}, jiraKey = "HHH-6580" )
|
||||
public class PersistChildEntitiesWithDiscriminatorTest extends BaseCoreFunctionalTestCase {
|
||||
@Override
|
||||
protected Class<?>[] getAnnotatedClasses() {
|
||||
|
@ -1,26 +1,24 @@
|
||||
//$Id: CustomSQLTest.java 10977 2006-12-12 23:28:04Z steve.ebersole@jboss.com $
|
||||
package org.hibernate.test.legacy;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.dialect.Dialect;
|
||||
import org.hibernate.dialect.PostgreSQL81Dialect;
|
||||
import org.hibernate.dialect.PostgreSQLDialect;
|
||||
import org.hibernate.id.PostInsertIdentifierGenerator;
|
||||
import org.hibernate.testing.DialectCheck;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.RequiresDialectFeature;
|
||||
import org.hibernate.testing.SkipForDialect;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author MAX
|
||||
@ -42,7 +40,7 @@ public boolean isMatch(Dialect dialect) {
|
||||
|
||||
@Test
|
||||
@RequiresDialectFeature( NonIdentityGeneratorChecker.class )
|
||||
@SkipForDialect( value = {PostgreSQL81Dialect.class, PostgreSQLDialect.class}, jiraKey = "HHH-6704")
|
||||
@SkipForDialect( value = {PostgreSQL81Dialect.class}, jiraKey = "HHH-6704")
|
||||
@SuppressWarnings( {"UnnecessaryBoxing"})
|
||||
public void testInsert() throws HibernateException, SQLException {
|
||||
Session s = openSession();
|
||||
|
@ -23,6 +23,13 @@
|
||||
*/
|
||||
package org.hibernate.test.legacy;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
@ -42,9 +49,6 @@
|
||||
import java.util.TreeMap;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import org.jboss.logging.Logger;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.FetchMode;
|
||||
import org.hibernate.FlushMode;
|
||||
@ -72,7 +76,6 @@
|
||||
import org.hibernate.dialect.Oracle8iDialect;
|
||||
import org.hibernate.dialect.PointbaseDialect;
|
||||
import org.hibernate.dialect.PostgreSQL81Dialect;
|
||||
import org.hibernate.dialect.PostgreSQLDialect;
|
||||
import org.hibernate.dialect.SAPDBDialect;
|
||||
import org.hibernate.dialect.Sybase11Dialect;
|
||||
import org.hibernate.dialect.SybaseASE15Dialect;
|
||||
@ -90,13 +93,8 @@
|
||||
import org.hibernate.testing.RequiresDialectFeature;
|
||||
import org.hibernate.testing.env.ConnectionProviderBuilder;
|
||||
import org.hibernate.type.StandardBasicTypes;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
import org.jboss.logging.Logger;
|
||||
import org.junit.Test;
|
||||
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class FooBarTest extends LegacyTestCase {
|
||||
@ -2295,7 +2293,7 @@ public void testCollectionsInSelect() throws Exception {
|
||||
s.createQuery( "select count(*) from Baz as baz where 1 in indices(baz.fooArray)" ).list();
|
||||
s.createQuery( "select count(*) from Bar as bar where 'abc' in elements(bar.baz.fooArray)" ).list();
|
||||
s.createQuery( "select count(*) from Bar as bar where 1 in indices(bar.baz.fooArray)" ).list();
|
||||
if ( !(getDialect() instanceof DB2Dialect) && !(getDialect() instanceof Oracle8iDialect ) && !( getDialect() instanceof SybaseDialect ) && !( getDialect() instanceof Sybase11Dialect ) && !( getDialect() instanceof SybaseASE15Dialect ) && !( getDialect() instanceof PostgreSQLDialect ) && !(getDialect() instanceof PostgreSQL81Dialect)) {
|
||||
if ( !(getDialect() instanceof DB2Dialect) && !(getDialect() instanceof Oracle8iDialect ) && !( getDialect() instanceof SybaseDialect ) && !( getDialect() instanceof Sybase11Dialect ) && !( getDialect() instanceof SybaseASE15Dialect ) && !(getDialect() instanceof PostgreSQL81Dialect)) {
|
||||
// SybaseAnywhereDialect supports implicit conversions from strings to ints
|
||||
s.createQuery(
|
||||
"select count(*) from Bar as bar, bar.component.glarch.proxyArray as g where g.id in indices(bar.baz.fooArray)"
|
||||
@ -2370,7 +2368,7 @@ public void testCollectionsInSelect() throws Exception {
|
||||
|
||||
s.delete(bar);
|
||||
|
||||
if ( getDialect() instanceof DB2Dialect || getDialect() instanceof PostgreSQLDialect || getDialect() instanceof PostgreSQL81Dialect ) {
|
||||
if ( getDialect() instanceof DB2Dialect || getDialect() instanceof PostgreSQL81Dialect ) {
|
||||
s.createQuery( "select one from One one join one.manies many group by one order by count(many)" ).iterate();
|
||||
s.createQuery( "select one from One one join one.manies many group by one having count(many) < 5" )
|
||||
.iterate();
|
||||
|
@ -25,8 +25,6 @@
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Before;
|
||||
|
||||
import org.hibernate.Query;
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.cfg.Configuration;
|
||||
@ -35,11 +33,11 @@
|
||||
import org.hibernate.dialect.DB2Dialect;
|
||||
import org.hibernate.dialect.Dialect;
|
||||
import org.hibernate.dialect.PostgreSQL81Dialect;
|
||||
import org.hibernate.dialect.PostgreSQLDialect;
|
||||
import org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory;
|
||||
import org.hibernate.internal.util.StringHelper;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
import org.hibernate.type.Type;
|
||||
import org.junit.Before;
|
||||
|
||||
/**
|
||||
* @author Steve Ebersole
|
||||
@ -57,7 +55,7 @@ public void checkAntlrParserSetting() {
|
||||
|
||||
protected boolean supportsLockingNullableSideOfJoin(Dialect dialect) {
|
||||
// db2 and pgsql do *NOT*
|
||||
return ! ( DB2Dialect.class.isInstance( dialect ) || PostgreSQL81Dialect.class.isInstance( dialect ) || PostgreSQLDialect.class.isInstance( dialect ));
|
||||
return ! ( DB2Dialect.class.isInstance( dialect ) || PostgreSQL81Dialect.class.isInstance( dialect ));
|
||||
}
|
||||
|
||||
protected static String extractFromSystem(String systemPropertyName) {
|
||||
|
@ -1,13 +1,17 @@
|
||||
//$Id: SQLLoaderTest.java 11383 2007-04-02 15:34:02Z steve.ebersole@jboss.com $
|
||||
package org.hibernate.test.legacy;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.hibernate.HibernateException;
|
||||
import org.hibernate.Query;
|
||||
import org.hibernate.SQLQuery;
|
||||
@ -16,18 +20,12 @@
|
||||
import org.hibernate.dialect.HSQLDialect;
|
||||
import org.hibernate.dialect.MySQLDialect;
|
||||
import org.hibernate.dialect.PostgreSQL81Dialect;
|
||||
import org.hibernate.dialect.PostgreSQLDialect;
|
||||
import org.hibernate.dialect.TimesTenDialect;
|
||||
import org.hibernate.testing.FailureExpected;
|
||||
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
|
||||
import org.hibernate.testing.SkipForDialect;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import org.junit.Test;
|
||||
|
||||
@FailureExpectedWithNewMetamodel
|
||||
public class SQLLoaderTest extends LegacyTestCase {
|
||||
@ -376,7 +374,7 @@ public void testFindBySQLParameters() throws HibernateException, SQLException {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SkipForDialect( { HSQLDialect.class, PostgreSQL81Dialect.class, PostgreSQLDialect.class } )
|
||||
@SkipForDialect( { HSQLDialect.class, PostgreSQL81Dialect.class } )
|
||||
public void testEscapedJDBC() throws HibernateException, SQLException {
|
||||
Session session = openSession();
|
||||
session.beginTransaction();
|
||||
|
@ -23,27 +23,25 @@
|
||||
*/
|
||||
package org.hibernate.test.tm;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotSame;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.TransactionException;
|
||||
import org.hibernate.dialect.PostgreSQL81Dialect;
|
||||
import org.hibernate.dialect.PostgreSQLDialect;
|
||||
import org.hibernate.engine.spi.SessionImplementor;
|
||||
import org.hibernate.test.jdbc.Person;
|
||||
import org.hibernate.testing.SkipForDialect;
|
||||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotSame;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author Lukasz Antoniak (lukasz dot antoniak at gmail dot com)
|
||||
*/
|
||||
@TestForIssue(jiraKey = "HHH-6780")
|
||||
@SkipForDialect( value ={ PostgreSQL81Dialect.class, PostgreSQLDialect.class}, comment = "PostgreSQL jdbc driver doesn't impl timeout method")
|
||||
@SkipForDialect( value ={ PostgreSQL81Dialect.class}, comment = "PostgreSQL jdbc driver doesn't impl timeout method")
|
||||
public class TransactionTimeoutTest extends BaseCoreFunctionalTestCase {
|
||||
@Override
|
||||
public String[] getMappings() {
|
||||
|
@ -23,13 +23,15 @@
|
||||
*/
|
||||
package org.hibernate.test.typeoverride;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotSame;
|
||||
import static org.junit.Assert.assertSame;
|
||||
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.cfg.Configuration;
|
||||
import org.hibernate.dialect.Dialect;
|
||||
import org.hibernate.dialect.PostgreSQL81Dialect;
|
||||
import org.hibernate.dialect.PostgreSQLDialect;
|
||||
import org.hibernate.dialect.SybaseASE15Dialect;
|
||||
import org.hibernate.testing.SkipForDialect;
|
||||
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
|
||||
@ -37,11 +39,7 @@
|
||||
import org.hibernate.type.descriptor.sql.IntegerTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.sql.SqlTypeDescriptor;
|
||||
import org.hibernate.type.descriptor.sql.VarcharTypeDescriptor;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotSame;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* @author Gail Badner
|
||||
@ -70,7 +68,7 @@ public void testStandardBasicSqlTypeDescriptor() {
|
||||
getDialect().remapSqlTypeDescriptor( BlobTypeDescriptor.DEFAULT )
|
||||
);
|
||||
}
|
||||
else if ( PostgreSQL81Dialect.class.isInstance( getDialect() ) || PostgreSQLDialect.class.isInstance( getDialect() ) ) {
|
||||
else if ( PostgreSQL81Dialect.class.isInstance( getDialect() ) ) {
|
||||
assertSame(
|
||||
BlobTypeDescriptor.BLOB_BINDING,
|
||||
getDialect().remapSqlTypeDescriptor( BlobTypeDescriptor.DEFAULT )
|
||||
|
Loading…
x
Reference in New Issue
Block a user