This commit is contained in:
Steve Ebersole 2011-04-05 10:26:58 -05:00
parent a67b6028c1
commit 5e8e49d3ae
5 changed files with 17 additions and 24 deletions

View File

@ -1858,4 +1858,8 @@ public interface HibernateLogger extends BasicLogger {
@LogMessage( level = WARN )
@Message( value = "Setting entity-identifier value binding where one already existed : %s.", id = 429 )
void entityIdentifierValueBindingExists(String name);
@LogMessage( level = WARN )
@Message( value = "The DerbyDialect dialect has been deprecated; use one of the version-specific dialects instead", id = 430 )
void deprecatedDerbyDialect();
}

View File

@ -40,7 +40,10 @@ import org.jboss.logging.Logger;
* http://www.jroller.com/comments/kenlars99/Weblog/cloudscape_soon_to_be_derby
*
* @author Simon Johnston
*
* @deprecated HHH-6073
*/
@Deprecated
public class DerbyDialect extends DB2Dialect {
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, DerbyDialect.class.getName());
@ -50,6 +53,7 @@ public class DerbyDialect extends DB2Dialect {
public DerbyDialect() {
super();
LOG.deprecatedDerbyDialect();
registerFunction( "concat", new DerbyConcatFunction() );
registerFunction( "trim", new AnsiTrimFunction() );
determineDriverVersion();

View File

@ -23,10 +23,8 @@
*/
package org.hibernate.dialect;
import org.hibernate.HibernateLogger;
import org.hibernate.dialect.function.AnsiTrimFunction;
import org.hibernate.dialect.function.DerbyConcatFunction;
import org.jboss.logging.Logger;
/**
@ -39,9 +37,6 @@ import org.jboss.logging.Logger;
* @author Scott Marlow
*/
public class DerbyTenFiveDialect extends DerbyDialect {
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, DerbyTenFiveDialect.class.getName());
public DerbyTenFiveDialect() {
super();
registerFunction( "concat", new DerbyConcatFunction() );

View File

@ -23,9 +23,6 @@
*/
package org.hibernate.dialect;
import org.hibernate.HibernateLogger;
import org.jboss.logging.Logger;
/**
* Hibernate Dialect for Cloudscape 10 - aka Derby. This implements both an
* override for the identity column generator as well as for the case statement
@ -36,19 +33,12 @@ import org.jboss.logging.Logger;
* @author Scott Marlow
*/
public class DerbyTenSixDialect extends DerbyTenFiveDialect {
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, DerbyTenSixDialect.class.getName());
public DerbyTenSixDialect() {
super();
}
private boolean isTenPointFiveReleaseOrNewer() {
return true;
}
@Override
public boolean supportsSequences() {
return true;
return true;
}
}

View File

@ -82,15 +82,15 @@ public class StandardDialectResolver extends AbstractDialectResolver {
if ( "Apache Derby".equals( databaseName ) ) {
int driverVersionMajor = metaData.getDriverMajorVersion();
int driverVersionMinor = metaData.getDriverMinorVersion();
if ( driverVersionMajor > 10 || ( driverVersionMajor == 10 && driverVersionMinor >= 5 ) ) {
if ( driverVersionMinor >= 6 ) {
return new DerbyTenSixDialect();
}
else {
return new DerbyTenFiveDialect();
}
if ( driverVersionMajor > 10 || ( driverVersionMajor == 10 && driverVersionMinor >= 6 ) ) {
return new DerbyTenSixDialect();
}
else if ( driverVersionMajor == 10 && driverVersionMinor == 5 ) {
return new DerbyTenFiveDialect();
}
else {
return new DerbyDialect();
}
return new DerbyDialect();
}
if ( "ingres".equalsIgnoreCase( databaseName ) ) {