HHH-6098 - Slight naming changes in regards to new logging classes
This commit is contained in:
parent
a616a83d8e
commit
6504cb6d78
|
@ -1774,7 +1774,7 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect</programlisting>
|
||||||
|
|
||||||
<!-- Second-level caching -->
|
<!-- Second-level caching -->
|
||||||
<attribute name="SecondLevelCacheEnabled">true</attribute>
|
<attribute name="SecondLevelCacheEnabled">true</attribute>
|
||||||
<attribute name="CacheProviderClass">org.hibernate.cache.EhCacheProvider</attribute>
|
<attribute name="CacheProviderClass">org.hibernate.cache.internal.EhCacheProvider</attribute>
|
||||||
<attribute name="QueryCacheEnabled">true</attribute>
|
<attribute name="QueryCacheEnabled">true</attribute>
|
||||||
|
|
||||||
<!-- Logging -->
|
<!-- Logging -->
|
||||||
|
|
|
@ -764,7 +764,7 @@ Customer customer = (Customer) session.get( Customer.class, customerId );
|
||||||
<row>
|
<row>
|
||||||
<entry>EHCache</entry>
|
<entry>EHCache</entry>
|
||||||
|
|
||||||
<entry><literal>org.hibernate.cache.EhCacheProvider</literal></entry>
|
<entry><literal>org.hibernate.cache.internal.EhCacheProvider</literal></entry>
|
||||||
|
|
||||||
<entry>memory, disk</entry>
|
<entry>memory, disk</entry>
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ import com.mchange.v2.c3p0.DataSources;
|
||||||
*/
|
*/
|
||||||
public class C3P0ConnectionProvider implements ConnectionProvider {
|
public class C3P0ConnectionProvider implements ConnectionProvider {
|
||||||
|
|
||||||
private static final C3P0Logger LOG = Logger.getMessageLogger(C3P0Logger.class, C3P0ConnectionProvider.class.getName());
|
private static final C3P0MessageLogger LOG = Logger.getMessageLogger(C3P0MessageLogger.class, C3P0ConnectionProvider.class.getName());
|
||||||
|
|
||||||
//swaldman 2006-08-28: define c3p0-style configuration parameters for properties with
|
//swaldman 2006-08-28: define c3p0-style configuration parameters for properties with
|
||||||
// hibernate-specific overrides to detect and warn about conflicting
|
// hibernate-specific overrides to detect and warn about conflicting
|
||||||
|
@ -123,7 +123,7 @@ public class C3P0ConnectionProvider implements ConnectionProvider {
|
||||||
LOG.connectionProperties(ConfigurationHelper.maskOut(connectionProps, "password"));
|
LOG.connectionProperties(ConfigurationHelper.maskOut(connectionProps, "password"));
|
||||||
|
|
||||||
autocommit = ConfigurationHelper.getBoolean( Environment.AUTOCOMMIT, props );
|
autocommit = ConfigurationHelper.getBoolean( Environment.AUTOCOMMIT, props );
|
||||||
LOG.autoCommitMode(autocommit);
|
LOG.autoCommitMode( autocommit );
|
||||||
|
|
||||||
if (jdbcDriverClass == null) LOG.jdbcDriverNotSpecified(Environment.DRIVER);
|
if (jdbcDriverClass == null) LOG.jdbcDriverNotSpecified(Environment.DRIVER);
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -26,18 +26,22 @@ package org.hibernate.service.jdbc.connections.internal;
|
||||||
import static org.jboss.logging.Logger.Level.INFO;
|
import static org.jboss.logging.Logger.Level.INFO;
|
||||||
import static org.jboss.logging.Logger.Level.WARN;
|
import static org.jboss.logging.Logger.Level.WARN;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
|
|
||||||
import org.jboss.logging.Cause;
|
import org.jboss.logging.Cause;
|
||||||
import org.jboss.logging.LogMessage;
|
import org.jboss.logging.LogMessage;
|
||||||
import org.jboss.logging.Message;
|
import org.jboss.logging.Message;
|
||||||
import org.jboss.logging.MessageLogger;
|
import org.jboss.logging.MessageLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines internationalized messages for this hibernate-c3p0, with IDs ranging from 10001 to 15000 inclusively. New messages must
|
* The jboss-logging {@link MessageLogger} for the hibernate-c3p0 module. It reserves message ids ranging from
|
||||||
* be added after the last message defined to ensure message codes are unique.
|
* 10001 to 15000 inclusively.
|
||||||
|
* <p/>
|
||||||
|
* New messages must be added after the last message defined to ensure message codes are unique.
|
||||||
*/
|
*/
|
||||||
@MessageLogger( projectCode = "HHH" )
|
@MessageLogger( projectCode = "HHH" )
|
||||||
public interface C3P0Logger extends HibernateLogger {
|
public interface C3P0MessageLogger extends CoreMessageLogger {
|
||||||
|
|
||||||
@LogMessage( level = WARN )
|
@LogMessage( level = WARN )
|
||||||
@Message( value = "Both hibernate-style property '%s' and c3p0-style property '%s' have been set in hibernate.properties. "
|
@Message( value = "Both hibernate-style property '%s' and c3p0-style property '%s' have been set in hibernate.properties. "
|
|
@ -1,9 +1,8 @@
|
||||||
header
|
header
|
||||||
{
|
{
|
||||||
// $Id: hql-sql.g 10001 2006-06-08 21:08:04Z steve.ebersole@jboss.com $
|
|
||||||
package org.hibernate.hql.antlr;
|
package org.hibernate.hql.antlr;
|
||||||
|
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +55,7 @@ tokens
|
||||||
|
|
||||||
// -- Declarations --
|
// -- Declarations --
|
||||||
{
|
{
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, HqlSqlBaseWalker.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, HqlSqlBaseWalker.class.getName());
|
||||||
|
|
||||||
private int level = 0;
|
private int level = 0;
|
||||||
private boolean inSelect = false;
|
private boolean inSelect = false;
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Hibernate, Relational Persistence for Idiomatic Java
|
* Hibernate, Relational Persistence for Idiomatic Java
|
||||||
*
|
*
|
||||||
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
|
* Copyright (c) 2011, Red Hat Inc. or third-party contributors as
|
||||||
* indicated by the @author tags or express copyright attribution
|
* indicated by the @author tags or express copyright attribution
|
||||||
* statements applied by the authors. All third-party contributions are
|
* statements applied by the authors. All third-party contributions are
|
||||||
* distributed under license by Red Hat Middleware LLC.
|
* distributed under license by Red Hat Inc.
|
||||||
*
|
*
|
||||||
* This copyrighted material is made available to anyone wishing to use, modify,
|
* 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
|
* copy, or redistribute it subject to the terms and conditions of the GNU
|
||||||
|
@ -20,11 +20,13 @@
|
||||||
* Free Software Foundation, Inc.
|
* Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor
|
* 51 Franklin Street, Fifth Floor
|
||||||
* Boston, MA 02110-1301 USA
|
* Boston, MA 02110-1301 USA
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
package org.hibernate;
|
package org.hibernate;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates failure of an assertion: a possible bug in Hibernate.
|
* Indicates failure of an assertion: a possible bug in Hibernate.
|
||||||
*
|
*
|
||||||
|
@ -34,7 +36,7 @@ public class AssertionFailure extends RuntimeException {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, AssertionFailure.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, AssertionFailure.class.getName());
|
||||||
|
|
||||||
public AssertionFailure( String s ) {
|
public AssertionFailure( String s ) {
|
||||||
super(s);
|
super(s);
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
package org.hibernate;
|
package org.hibernate;
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates access to unfetched data outside of a session context.
|
* Indicates access to unfetched data outside of a session context.
|
||||||
* For example, when an uninitialized proxy or collection is accessed
|
* For example, when an uninitialized proxy or collection is accessed
|
||||||
|
@ -36,7 +38,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class LazyInitializationException extends HibernateException {
|
public class LazyInitializationException extends HibernateException {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
|
||||||
LazyInitializationException.class.getName());
|
LazyInitializationException.class.getName());
|
||||||
|
|
||||||
public LazyInitializationException(String msg) {
|
public LazyInitializationException(String msg) {
|
||||||
|
|
|
@ -27,7 +27,7 @@ import java.lang.reflect.Modifier;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.bytecode.buildtime.spi.ClassFilter;
|
import org.hibernate.bytecode.buildtime.spi.ClassFilter;
|
||||||
import org.hibernate.bytecode.buildtime.spi.FieldFilter;
|
import org.hibernate.bytecode.buildtime.spi.FieldFilter;
|
||||||
import org.hibernate.bytecode.spi.BytecodeProvider;
|
import org.hibernate.bytecode.spi.BytecodeProvider;
|
||||||
|
@ -43,7 +43,7 @@ import org.hibernate.internal.util.StringHelper;
|
||||||
*/
|
*/
|
||||||
public class BytecodeProviderImpl implements BytecodeProvider {
|
public class BytecodeProviderImpl implements BytecodeProvider {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, BytecodeProviderImpl.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, BytecodeProviderImpl.class.getName());
|
||||||
|
|
||||||
public ProxyFactoryFactory getProxyFactoryFactory() {
|
public ProxyFactoryFactory getProxyFactoryFactory() {
|
||||||
return new ProxyFactoryFactoryImpl();
|
return new ProxyFactoryFactoryImpl();
|
||||||
|
|
|
@ -34,7 +34,7 @@ import javassist.bytecode.ClassFile;
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.bytecode.buildtime.spi.ClassFilter;
|
import org.hibernate.bytecode.buildtime.spi.ClassFilter;
|
||||||
import org.hibernate.bytecode.spi.AbstractClassTransformerImpl;
|
import org.hibernate.bytecode.spi.AbstractClassTransformerImpl;
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ import org.hibernate.bytecode.spi.AbstractClassTransformerImpl;
|
||||||
*/
|
*/
|
||||||
public class JavassistClassTransformer extends AbstractClassTransformerImpl {
|
public class JavassistClassTransformer extends AbstractClassTransformerImpl {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
|
||||||
JavassistClassTransformer.class.getName());
|
JavassistClassTransformer.class.getName());
|
||||||
|
|
||||||
public JavassistClassTransformer(ClassFilter classFilter, org.hibernate.bytecode.buildtime.spi.FieldFilter fieldFilter) {
|
public JavassistClassTransformer(ClassFilter classFilter, org.hibernate.bytecode.buildtime.spi.FieldFilter fieldFilter) {
|
||||||
|
|
|
@ -28,10 +28,12 @@ import java.util.Properties;
|
||||||
import javax.naming.Context;
|
import javax.naming.Context;
|
||||||
import javax.naming.InitialContext;
|
import javax.naming.InitialContext;
|
||||||
import javax.naming.NamingException;
|
import javax.naming.NamingException;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.cfg.Environment;
|
import org.hibernate.cfg.Environment;
|
||||||
import org.hibernate.internal.util.StringHelper;
|
import org.hibernate.internal.util.StringHelper;
|
||||||
import org.hibernate.internal.util.jndi.JndiHelper;
|
import org.hibernate.internal.util.jndi.JndiHelper;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -42,7 +44,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractJndiBoundCacheProvider implements CacheProvider {
|
public abstract class AbstractJndiBoundCacheProvider implements CacheProvider {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
|
||||||
AbstractJndiBoundCacheProvider.class.getName());
|
AbstractJndiBoundCacheProvider.class.getName());
|
||||||
|
|
||||||
private Object cache;
|
private Object cache;
|
||||||
|
|
|
@ -24,8 +24,10 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.cache;
|
package org.hibernate.cache;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.cache.access.SoftLock;
|
import org.hibernate.cache.access.SoftLock;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,7 +42,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class NonstrictReadWriteCache implements CacheConcurrencyStrategy {
|
public class NonstrictReadWriteCache implements CacheConcurrencyStrategy {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
|
||||||
NonstrictReadWriteCache.class.getName());
|
NonstrictReadWriteCache.class.getName());
|
||||||
|
|
||||||
private Cache cache;
|
private Cache cache;
|
||||||
|
|
|
@ -24,8 +24,9 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.cache;
|
package org.hibernate.cache;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.cache.access.SoftLock;
|
import org.hibernate.cache.access.SoftLock;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -34,7 +35,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class ReadOnlyCache implements CacheConcurrencyStrategy {
|
public class ReadOnlyCache implements CacheConcurrencyStrategy {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, ReadOnlyCache.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, ReadOnlyCache.class.getName());
|
||||||
|
|
||||||
private Cache cache;
|
private Cache cache;
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,10 @@
|
||||||
package org.hibernate.cache;
|
package org.hibernate.cache;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.cache.access.SoftLock;
|
import org.hibernate.cache.access.SoftLock;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -47,7 +49,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class ReadWriteCache implements CacheConcurrencyStrategy {
|
public class ReadWriteCache implements CacheConcurrencyStrategy {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, ReadWriteCache.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, ReadWriteCache.class.getName());
|
||||||
|
|
||||||
private Cache cache;
|
private Cache cache;
|
||||||
private int nextLockId;
|
private int nextLockId;
|
||||||
|
|
|
@ -29,7 +29,7 @@ import java.util.Properties;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.persistence.EntityNotFoundException;
|
import javax.persistence.EntityNotFoundException;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.UnresolvableObjectException;
|
import org.hibernate.UnresolvableObjectException;
|
||||||
import org.hibernate.cfg.Settings;
|
import org.hibernate.cfg.Settings;
|
||||||
import org.hibernate.engine.SessionImplementor;
|
import org.hibernate.engine.SessionImplementor;
|
||||||
|
@ -48,7 +48,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class StandardQueryCache implements QueryCache {
|
public class StandardQueryCache implements QueryCache {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, StandardQueryCache.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, StandardQueryCache.class.getName());
|
||||||
|
|
||||||
private QueryResultsRegion cacheRegion;
|
private QueryResultsRegion cacheRegion;
|
||||||
private UpdateTimestampsCache updateTimestampsCache;
|
private UpdateTimestampsCache updateTimestampsCache;
|
||||||
|
|
|
@ -24,8 +24,10 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.cache;
|
package org.hibernate.cache;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.cache.access.SoftLock;
|
import org.hibernate.cache.access.SoftLock;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -38,7 +40,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class TransactionalCache implements CacheConcurrencyStrategy {
|
public class TransactionalCache implements CacheConcurrencyStrategy {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, TransactionalCache.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, TransactionalCache.class.getName());
|
||||||
|
|
||||||
private Cache cache;
|
private Cache cache;
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,9 @@ import java.util.Properties;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.cfg.Settings;
|
import org.hibernate.cfg.Settings;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -44,7 +45,7 @@ import org.jboss.logging.Logger;
|
||||||
public class UpdateTimestampsCache {
|
public class UpdateTimestampsCache {
|
||||||
|
|
||||||
public static final String REGION_NAME = UpdateTimestampsCache.class.getName();
|
public static final String REGION_NAME = UpdateTimestampsCache.class.getName();
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
|
||||||
UpdateTimestampsCache.class.getName());
|
UpdateTimestampsCache.class.getName());
|
||||||
|
|
||||||
private ReentrantReadWriteLock readWriteLock = new ReentrantReadWriteLock();
|
private ReentrantReadWriteLock readWriteLock = new ReentrantReadWriteLock();
|
||||||
|
|
|
@ -1,80 +1,81 @@
|
||||||
/*
|
/*
|
||||||
* Hibernate, Relational Persistence for Idiomatic Java
|
* Hibernate, Relational Persistence for Idiomatic Java
|
||||||
*
|
*
|
||||||
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
|
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
|
||||||
* indicated by the @author tags or express copyright attribution
|
* indicated by the @author tags or express copyright attribution
|
||||||
* statements applied by the authors. All third-party contributions are
|
* statements applied by the authors. All third-party contributions are
|
||||||
* distributed under license by Red Hat Middleware LLC.
|
* distributed under license by Red Hat Middleware LLC.
|
||||||
*
|
*
|
||||||
* This copyrighted material is made available to anyone wishing to use, modify,
|
* 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
|
* copy, or redistribute it subject to the terms and conditions of the GNU
|
||||||
* Lesser General Public License, as published by the Free Software Foundation.
|
* Lesser General Public License, as published by the Free Software Foundation.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
||||||
* for more details.
|
* for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
* along with this distribution; if not, write to:
|
* along with this distribution; if not, write to:
|
||||||
* Free Software Foundation, Inc.
|
* Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor
|
* 51 Franklin Street, Fifth Floor
|
||||||
* Boston, MA 02110-1301 USA
|
* Boston, MA 02110-1301 USA
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.hibernate.cache.impl.bridge;
|
package org.hibernate.cache.impl.bridge;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.cache.Cache;
|
import org.hibernate.cache.Cache;
|
||||||
import org.hibernate.cache.CacheConcurrencyStrategy;
|
import org.hibernate.cache.CacheConcurrencyStrategy;
|
||||||
import org.hibernate.cache.CacheDataDescription;
|
import org.hibernate.cache.CacheDataDescription;
|
||||||
import org.hibernate.cache.CacheException;
|
import org.hibernate.cache.CacheException;
|
||||||
import org.hibernate.cache.CollectionRegion;
|
import org.hibernate.cache.CollectionRegion;
|
||||||
import org.hibernate.cache.NonstrictReadWriteCache;
|
import org.hibernate.cache.NonstrictReadWriteCache;
|
||||||
import org.hibernate.cache.OptimisticCache;
|
import org.hibernate.cache.OptimisticCache;
|
||||||
import org.hibernate.cache.ReadOnlyCache;
|
import org.hibernate.cache.ReadOnlyCache;
|
||||||
import org.hibernate.cache.ReadWriteCache;
|
import org.hibernate.cache.ReadWriteCache;
|
||||||
import org.hibernate.cache.TransactionalCache;
|
import org.hibernate.cache.TransactionalCache;
|
||||||
import org.hibernate.cache.access.AccessType;
|
import org.hibernate.cache.access.AccessType;
|
||||||
import org.hibernate.cache.access.CollectionRegionAccessStrategy;
|
import org.hibernate.cache.access.CollectionRegionAccessStrategy;
|
||||||
import org.hibernate.cfg.Settings;
|
import org.hibernate.cfg.Settings;
|
||||||
import org.jboss.logging.Logger;
|
|
||||||
|
import org.jboss.logging.Logger;
|
||||||
/**
|
|
||||||
* Adapter specifically bridging {@link CollectionRegion} to {@link Cache}.
|
/**
|
||||||
*
|
* Adapter specifically bridging {@link CollectionRegion} to {@link Cache}.
|
||||||
* @author Steve Ebersole
|
*
|
||||||
*/
|
* @author Steve Ebersole
|
||||||
public class CollectionRegionAdapter extends BaseTransactionalDataRegionAdapter implements CollectionRegion {
|
*/
|
||||||
|
public class CollectionRegionAdapter extends BaseTransactionalDataRegionAdapter implements CollectionRegion {
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
|
|
||||||
CollectionRegionAdapter.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
|
||||||
|
CollectionRegionAdapter.class.getName());
|
||||||
public CollectionRegionAdapter(Cache underlyingCache, Settings settings, CacheDataDescription metadata) {
|
|
||||||
super( underlyingCache, settings, metadata );
|
public CollectionRegionAdapter(Cache underlyingCache, Settings settings, CacheDataDescription metadata) {
|
||||||
if ( underlyingCache instanceof OptimisticCache ) {
|
super( underlyingCache, settings, metadata );
|
||||||
( ( OptimisticCache ) underlyingCache ).setSource( new OptimisticCacheSourceAdapter( metadata ) );
|
if ( underlyingCache instanceof OptimisticCache ) {
|
||||||
}
|
( ( OptimisticCache ) underlyingCache ).setSource( new OptimisticCacheSourceAdapter( metadata ) );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
public CollectionRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
|
|
||||||
CacheConcurrencyStrategy ccs;
|
public CollectionRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
|
||||||
if ( AccessType.READ_ONLY.equals( accessType ) ) {
|
CacheConcurrencyStrategy ccs;
|
||||||
if (metadata.isMutable()) LOG.readOnlyCacheConfiguredForMutableCollection(getName());
|
if ( AccessType.READ_ONLY.equals( accessType ) ) {
|
||||||
ccs = new ReadOnlyCache();
|
if (metadata.isMutable()) LOG.readOnlyCacheConfiguredForMutableCollection(getName());
|
||||||
}
|
ccs = new ReadOnlyCache();
|
||||||
else if ( AccessType.READ_WRITE.equals( accessType ) ) {
|
}
|
||||||
ccs = new ReadWriteCache();
|
else if ( AccessType.READ_WRITE.equals( accessType ) ) {
|
||||||
}
|
ccs = new ReadWriteCache();
|
||||||
else if ( AccessType.NONSTRICT_READ_WRITE.equals( accessType ) ) {
|
}
|
||||||
ccs = new NonstrictReadWriteCache();
|
else if ( AccessType.NONSTRICT_READ_WRITE.equals( accessType ) ) {
|
||||||
}
|
ccs = new NonstrictReadWriteCache();
|
||||||
else if ( AccessType.TRANSACTIONAL.equals( accessType ) ) {
|
}
|
||||||
ccs = new TransactionalCache();
|
else if ( AccessType.TRANSACTIONAL.equals( accessType ) ) {
|
||||||
}
|
ccs = new TransactionalCache();
|
||||||
else {
|
}
|
||||||
throw new IllegalArgumentException( "unrecognized access strategy type [" + accessType + "]" );
|
else {
|
||||||
}
|
throw new IllegalArgumentException( "unrecognized access strategy type [" + accessType + "]" );
|
||||||
ccs.setCache( underlyingCache );
|
}
|
||||||
return new CollectionAccessStrategyAdapter( this, ccs, settings );
|
ccs.setCache( underlyingCache );
|
||||||
}
|
return new CollectionAccessStrategyAdapter( this, ccs, settings );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,79 +1,80 @@
|
||||||
/*
|
/*
|
||||||
* Hibernate, Relational Persistence for Idiomatic Java
|
* Hibernate, Relational Persistence for Idiomatic Java
|
||||||
*
|
*
|
||||||
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
|
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
|
||||||
* indicated by the @author tags or express copyright attribution
|
* indicated by the @author tags or express copyright attribution
|
||||||
* statements applied by the authors. All third-party contributions are
|
* statements applied by the authors. All third-party contributions are
|
||||||
* distributed under license by Red Hat Middleware LLC.
|
* distributed under license by Red Hat Middleware LLC.
|
||||||
*
|
*
|
||||||
* This copyrighted material is made available to anyone wishing to use, modify,
|
* 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
|
* copy, or redistribute it subject to the terms and conditions of the GNU
|
||||||
* Lesser General Public License, as published by the Free Software Foundation.
|
* Lesser General Public License, as published by the Free Software Foundation.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
||||||
* for more details.
|
* for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
* along with this distribution; if not, write to:
|
* along with this distribution; if not, write to:
|
||||||
* Free Software Foundation, Inc.
|
* Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor
|
* 51 Franklin Street, Fifth Floor
|
||||||
* Boston, MA 02110-1301 USA
|
* Boston, MA 02110-1301 USA
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.hibernate.cache.impl.bridge;
|
package org.hibernate.cache.impl.bridge;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.cache.Cache;
|
import org.hibernate.cache.Cache;
|
||||||
import org.hibernate.cache.CacheConcurrencyStrategy;
|
import org.hibernate.cache.CacheConcurrencyStrategy;
|
||||||
import org.hibernate.cache.CacheDataDescription;
|
import org.hibernate.cache.CacheDataDescription;
|
||||||
import org.hibernate.cache.CacheException;
|
import org.hibernate.cache.CacheException;
|
||||||
import org.hibernate.cache.EntityRegion;
|
import org.hibernate.cache.EntityRegion;
|
||||||
import org.hibernate.cache.NonstrictReadWriteCache;
|
import org.hibernate.cache.NonstrictReadWriteCache;
|
||||||
import org.hibernate.cache.OptimisticCache;
|
import org.hibernate.cache.OptimisticCache;
|
||||||
import org.hibernate.cache.ReadOnlyCache;
|
import org.hibernate.cache.ReadOnlyCache;
|
||||||
import org.hibernate.cache.ReadWriteCache;
|
import org.hibernate.cache.ReadWriteCache;
|
||||||
import org.hibernate.cache.TransactionalCache;
|
import org.hibernate.cache.TransactionalCache;
|
||||||
import org.hibernate.cache.access.AccessType;
|
import org.hibernate.cache.access.AccessType;
|
||||||
import org.hibernate.cache.access.EntityRegionAccessStrategy;
|
import org.hibernate.cache.access.EntityRegionAccessStrategy;
|
||||||
import org.hibernate.cfg.Settings;
|
import org.hibernate.cfg.Settings;
|
||||||
import org.jboss.logging.Logger;
|
|
||||||
|
import org.jboss.logging.Logger;
|
||||||
/**
|
|
||||||
* Adapter specifically bridging {@link EntityRegion} to {@link Cache}.
|
/**
|
||||||
*
|
* Adapter specifically bridging {@link EntityRegion} to {@link Cache}.
|
||||||
* @author Steve Ebersole
|
*
|
||||||
*/
|
* @author Steve Ebersole
|
||||||
public class EntityRegionAdapter extends BaseTransactionalDataRegionAdapter implements EntityRegion {
|
*/
|
||||||
|
public class EntityRegionAdapter extends BaseTransactionalDataRegionAdapter implements EntityRegion {
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, EntityRegionAdapter.class.getName());
|
|
||||||
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, EntityRegionAdapter.class.getName());
|
||||||
public EntityRegionAdapter(Cache underlyingCache, Settings settings, CacheDataDescription metadata) {
|
|
||||||
super( underlyingCache, settings, metadata );
|
public EntityRegionAdapter(Cache underlyingCache, Settings settings, CacheDataDescription metadata) {
|
||||||
if ( underlyingCache instanceof OptimisticCache ) {
|
super( underlyingCache, settings, metadata );
|
||||||
( ( OptimisticCache ) underlyingCache ).setSource( new OptimisticCacheSourceAdapter( metadata ) );
|
if ( underlyingCache instanceof OptimisticCache ) {
|
||||||
}
|
( ( OptimisticCache ) underlyingCache ).setSource( new OptimisticCacheSourceAdapter( metadata ) );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
public EntityRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
|
|
||||||
CacheConcurrencyStrategy ccs;
|
public EntityRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
|
||||||
if ( AccessType.READ_ONLY.equals( accessType ) ) {
|
CacheConcurrencyStrategy ccs;
|
||||||
if (metadata.isMutable()) LOG.readOnlyCacheConfiguredForMutableCollection(getName());
|
if ( AccessType.READ_ONLY.equals( accessType ) ) {
|
||||||
ccs = new ReadOnlyCache();
|
if (metadata.isMutable()) LOG.readOnlyCacheConfiguredForMutableCollection(getName());
|
||||||
}
|
ccs = new ReadOnlyCache();
|
||||||
else if ( AccessType.READ_WRITE.equals( accessType ) ) {
|
}
|
||||||
ccs = new ReadWriteCache();
|
else if ( AccessType.READ_WRITE.equals( accessType ) ) {
|
||||||
}
|
ccs = new ReadWriteCache();
|
||||||
else if ( AccessType.NONSTRICT_READ_WRITE.equals( accessType ) ) {
|
}
|
||||||
ccs = new NonstrictReadWriteCache();
|
else if ( AccessType.NONSTRICT_READ_WRITE.equals( accessType ) ) {
|
||||||
}
|
ccs = new NonstrictReadWriteCache();
|
||||||
else if ( AccessType.TRANSACTIONAL.equals( accessType ) ) {
|
}
|
||||||
ccs = new TransactionalCache();
|
else if ( AccessType.TRANSACTIONAL.equals( accessType ) ) {
|
||||||
}
|
ccs = new TransactionalCache();
|
||||||
else {
|
}
|
||||||
throw new IllegalArgumentException( "unrecognized access strategy type [" + accessType + "]" );
|
else {
|
||||||
}
|
throw new IllegalArgumentException( "unrecognized access strategy type [" + accessType + "]" );
|
||||||
ccs.setCache( underlyingCache );
|
}
|
||||||
return new EntityAccessStrategyAdapter( this, ccs, settings );
|
ccs.setCache( underlyingCache );
|
||||||
}
|
return new EntityAccessStrategyAdapter( this, ccs, settings );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -24,7 +24,8 @@
|
||||||
package org.hibernate.cache.impl.bridge;
|
package org.hibernate.cache.impl.bridge;
|
||||||
|
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.cache.CacheDataDescription;
|
import org.hibernate.cache.CacheDataDescription;
|
||||||
import org.hibernate.cache.CacheException;
|
import org.hibernate.cache.CacheException;
|
||||||
import org.hibernate.cache.CacheProvider;
|
import org.hibernate.cache.CacheProvider;
|
||||||
|
@ -50,7 +51,7 @@ import org.jboss.logging.Logger;
|
||||||
public class RegionFactoryCacheProviderBridge implements RegionFactory {
|
public class RegionFactoryCacheProviderBridge implements RegionFactory {
|
||||||
public static final String DEF_PROVIDER = NoCacheProvider.class.getName();
|
public static final String DEF_PROVIDER = NoCacheProvider.class.getName();
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
|
||||||
RegionFactoryCacheProviderBridge.class.getName());
|
RegionFactoryCacheProviderBridge.class.getName());
|
||||||
|
|
||||||
private CacheProvider cacheProvider;
|
private CacheProvider cacheProvider;
|
||||||
|
|
|
@ -82,7 +82,7 @@ import org.hibernate.AnnotationException;
|
||||||
import org.hibernate.AssertionFailure;
|
import org.hibernate.AssertionFailure;
|
||||||
import org.hibernate.EntityMode;
|
import org.hibernate.EntityMode;
|
||||||
import org.hibernate.FetchMode;
|
import org.hibernate.FetchMode;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.MappingException;
|
import org.hibernate.MappingException;
|
||||||
import org.hibernate.annotations.BatchSize;
|
import org.hibernate.annotations.BatchSize;
|
||||||
import org.hibernate.annotations.Cache;
|
import org.hibernate.annotations.Cache;
|
||||||
|
@ -182,7 +182,7 @@ import org.jboss.logging.Logger;
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final class AnnotationBinder {
|
public final class AnnotationBinder {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, AnnotationBinder.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, AnnotationBinder.class.getName());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Some design description
|
* Some design description
|
||||||
|
@ -517,7 +517,7 @@ public final class AnnotationBinder {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG.bindingEntityFromClass(clazzToProcess.getName());
|
LOG.bindingEntityFromClass( clazzToProcess.getName() );
|
||||||
|
|
||||||
PersistentClass superEntity = getSuperEntity(
|
PersistentClass superEntity = getSuperEntity(
|
||||||
clazzToProcess, inheritanceStatePerClass, mappings, inheritanceState
|
clazzToProcess, inheritanceStatePerClass, mappings, inheritanceState
|
||||||
|
@ -1234,7 +1234,7 @@ public final class AnnotationBinder {
|
||||||
params.put( param.name(), mappings.getTypeResolver().heuristicType( param.type() ) );
|
params.put( param.name(), mappings.getTypeResolver().heuristicType( param.type() ) );
|
||||||
}
|
}
|
||||||
FilterDefinition def = new FilterDefinition( defAnn.name(), defAnn.defaultCondition(), params );
|
FilterDefinition def = new FilterDefinition( defAnn.name(), defAnn.defaultCondition(), params );
|
||||||
LOG.bindingFilterDefinition(def.getFilterName());
|
LOG.bindingFilterDefinition( def.getFilterName() );
|
||||||
mappings.addFilterDefinition( def );
|
mappings.addFilterDefinition( def );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1290,11 +1290,11 @@ public final class AnnotationBinder {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !BinderHelper.isEmptyAnnotationValue( defAnn.name() ) ) {
|
if ( !BinderHelper.isEmptyAnnotationValue( defAnn.name() ) ) {
|
||||||
LOG.bindingTypeDefinition(defAnn.name());
|
LOG.bindingTypeDefinition( defAnn.name() );
|
||||||
mappings.addTypeDef( defAnn.name(), defAnn.typeClass().getName(), params );
|
mappings.addTypeDef( defAnn.name(), defAnn.typeClass().getName(), params );
|
||||||
}
|
}
|
||||||
if ( !defAnn.defaultForType().equals( void.class ) ) {
|
if ( !defAnn.defaultForType().equals( void.class ) ) {
|
||||||
LOG.bindingTypeDefinition(defAnn.defaultForType().getName());
|
LOG.bindingTypeDefinition( defAnn.defaultForType().getName() );
|
||||||
mappings.addTypeDef( defAnn.defaultForType().getName(), defAnn.typeClass().getName(), params );
|
mappings.addTypeDef( defAnn.defaultForType().getName(), defAnn.typeClass().getName(), params );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ import java.util.Set;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
import org.hibernate.AnnotationException;
|
import org.hibernate.AnnotationException;
|
||||||
import org.hibernate.AssertionFailure;
|
import org.hibernate.AssertionFailure;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.MappingException;
|
import org.hibernate.MappingException;
|
||||||
import org.hibernate.annotations.AnyMetaDef;
|
import org.hibernate.annotations.AnyMetaDef;
|
||||||
import org.hibernate.annotations.AnyMetaDefs;
|
import org.hibernate.annotations.AnyMetaDefs;
|
||||||
|
@ -62,6 +62,7 @@ import org.hibernate.mapping.SyntheticProperty;
|
||||||
import org.hibernate.mapping.Table;
|
import org.hibernate.mapping.Table;
|
||||||
import org.hibernate.mapping.ToOne;
|
import org.hibernate.mapping.ToOne;
|
||||||
import org.hibernate.mapping.Value;
|
import org.hibernate.mapping.Value;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -71,7 +72,7 @@ public class BinderHelper {
|
||||||
|
|
||||||
public static final String ANNOTATION_STRING_DEFAULT = "";
|
public static final String ANNOTATION_STRING_DEFAULT = "";
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, BinderHelper.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, BinderHelper.class.getName());
|
||||||
|
|
||||||
private BinderHelper() {
|
private BinderHelper() {
|
||||||
}
|
}
|
||||||
|
@ -637,7 +638,7 @@ public class BinderHelper {
|
||||||
|
|
||||||
private static void bindAnyMetaDef(AnyMetaDef defAnn, Mappings mappings) {
|
private static void bindAnyMetaDef(AnyMetaDef defAnn, Mappings mappings) {
|
||||||
if ( isEmptyAnnotationValue( defAnn.name() ) ) return; //don't map not named definitions
|
if ( isEmptyAnnotationValue( defAnn.name() ) ) return; //don't map not named definitions
|
||||||
LOG.bindingAnyMetaDefinition(defAnn.name());
|
LOG.bindingAnyMetaDefinition( defAnn.name() );
|
||||||
mappings.addAnyMetaDef( defAnn );
|
mappings.addAnyMetaDef( defAnn );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,8 @@ package org.hibernate.cfg;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.MappingException;
|
import org.hibernate.MappingException;
|
||||||
import org.hibernate.mapping.Collection;
|
import org.hibernate.mapping.Collection;
|
||||||
import org.hibernate.mapping.IndexedCollection;
|
import org.hibernate.mapping.IndexedCollection;
|
||||||
|
@ -41,7 +42,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public abstract class CollectionSecondPass implements SecondPass {
|
public abstract class CollectionSecondPass implements SecondPass {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, CollectionSecondPass.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, CollectionSecondPass.class.getName());
|
||||||
|
|
||||||
Mappings mappings;
|
Mappings mappings;
|
||||||
Collection collection;
|
Collection collection;
|
||||||
|
|
|
@ -66,7 +66,7 @@ import org.hibernate.AnnotationException;
|
||||||
import org.hibernate.DuplicateMappingException;
|
import org.hibernate.DuplicateMappingException;
|
||||||
import org.hibernate.EmptyInterceptor;
|
import org.hibernate.EmptyInterceptor;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.Interceptor;
|
import org.hibernate.Interceptor;
|
||||||
import org.hibernate.InvalidMappingException;
|
import org.hibernate.InvalidMappingException;
|
||||||
import org.hibernate.MappingException;
|
import org.hibernate.MappingException;
|
||||||
|
@ -161,7 +161,7 @@ import org.hibernate.usertype.UserType;
|
||||||
*/
|
*/
|
||||||
public class Configuration implements Serializable {
|
public class Configuration implements Serializable {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, Configuration.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, Configuration.class.getName());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setting used to give the name of the default {@link org.hibernate.annotations.CacheConcurrencyStrategy}
|
* Setting used to give the name of the default {@link org.hibernate.annotations.CacheConcurrencyStrategy}
|
||||||
|
@ -526,7 +526,7 @@ public class Configuration implements Serializable {
|
||||||
LOG.unableToDeserializeCache(cachedFile.getPath(), e);
|
LOG.unableToDeserializeCache(cachedFile.getPath(), e);
|
||||||
}
|
}
|
||||||
catch ( FileNotFoundException e ) {
|
catch ( FileNotFoundException e ) {
|
||||||
LOG.cachedFileNotFound(cachedFile.getPath(), e);
|
LOG.cachedFileNotFound( cachedFile.getPath(), e );
|
||||||
}
|
}
|
||||||
|
|
||||||
final String name = xmlFile.getAbsolutePath();
|
final String name = xmlFile.getAbsolutePath();
|
||||||
|
|
|
@ -1,109 +1,111 @@
|
||||||
/*
|
/*
|
||||||
* Hibernate, Relational Persistence for Idiomatic Java
|
* Hibernate, Relational Persistence for Idiomatic Java
|
||||||
*
|
*
|
||||||
* Copyright (c) 2010, Red Hat Inc. or third-party contributors as
|
* Copyright (c) 2010, Red Hat Inc. or third-party contributors as
|
||||||
* indicated by the @author tags or express copyright attribution
|
* indicated by the @author tags or express copyright attribution
|
||||||
* statements applied by the authors. All third-party contributions are
|
* statements applied by the authors. All third-party contributions are
|
||||||
* distributed under license by Red Hat Inc.
|
* distributed under license by Red Hat Inc.
|
||||||
*
|
*
|
||||||
* This copyrighted material is made available to anyone wishing to use, modify,
|
* 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
|
* copy, or redistribute it subject to the terms and conditions of the GNU
|
||||||
* Lesser General Public License, as published by the Free Software Foundation.
|
* Lesser General Public License, as published by the Free Software Foundation.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
||||||
* for more details.
|
* for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
* along with this distribution; if not, write to:
|
* along with this distribution; if not, write to:
|
||||||
* Free Software Foundation, Inc.
|
* Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor
|
* 51 Franklin Street, Fifth Floor
|
||||||
* Boston, MA 02110-1301 USA
|
* Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
package org.hibernate.cfg;
|
package org.hibernate.cfg;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
import org.hibernate.internal.util.xml.DTDEntityResolver;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.jboss.logging.Logger;
|
import org.hibernate.internal.util.xml.DTDEntityResolver;
|
||||||
import org.xml.sax.EntityResolver;
|
|
||||||
import org.xml.sax.InputSource;
|
import org.jboss.logging.Logger;
|
||||||
|
import org.xml.sax.EntityResolver;
|
||||||
/**
|
import org.xml.sax.InputSource;
|
||||||
* Resolve JPA xsd files locally
|
|
||||||
* Hibernate OGM uses this class, consider this some kind of exposed service at the SPI level
|
/**
|
||||||
*
|
* Resolve JPA xsd files locally
|
||||||
* @author Emmanuel Bernard
|
* Hibernate OGM uses this class, consider this some kind of exposed service at the SPI level
|
||||||
*/
|
*
|
||||||
public class EJB3DTDEntityResolver extends DTDEntityResolver {
|
* @author Emmanuel Bernard
|
||||||
public static final EntityResolver INSTANCE = new EJB3DTDEntityResolver();
|
*/
|
||||||
|
public class EJB3DTDEntityResolver extends DTDEntityResolver {
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, EJB3DTDEntityResolver.class.getName());
|
public static final EntityResolver INSTANCE = new EJB3DTDEntityResolver();
|
||||||
|
|
||||||
boolean resolved = false;
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, EJB3DTDEntityResolver.class.getName());
|
||||||
|
|
||||||
/**
|
boolean resolved = false;
|
||||||
* Persistence.xml has been resolved locally
|
|
||||||
* @return true if it has
|
/**
|
||||||
*/
|
* Persistence.xml has been resolved locally
|
||||||
public boolean isResolved() {
|
* @return true if it has
|
||||||
return resolved;
|
*/
|
||||||
}
|
public boolean isResolved() {
|
||||||
|
return resolved;
|
||||||
@Override
|
}
|
||||||
public InputSource resolveEntity(String publicId, String systemId) {
|
|
||||||
LOG.trace("Resolving XML entity " + publicId + " : " + systemId);
|
@Override
|
||||||
InputSource is = super.resolveEntity( publicId, systemId );
|
public InputSource resolveEntity(String publicId, String systemId) {
|
||||||
if ( is == null ) {
|
LOG.trace("Resolving XML entity " + publicId + " : " + systemId);
|
||||||
if ( systemId != null ) {
|
InputSource is = super.resolveEntity( publicId, systemId );
|
||||||
if ( systemId.endsWith( "orm_1_0.xsd" ) ) {
|
if ( is == null ) {
|
||||||
InputStream dtdStream = getStreamFromClasspath( "orm_1_0.xsd" );
|
if ( systemId != null ) {
|
||||||
final InputSource source = buildInputSource( publicId, systemId, dtdStream, false );
|
if ( systemId.endsWith( "orm_1_0.xsd" ) ) {
|
||||||
if (source != null) return source;
|
InputStream dtdStream = getStreamFromClasspath( "orm_1_0.xsd" );
|
||||||
}
|
final InputSource source = buildInputSource( publicId, systemId, dtdStream, false );
|
||||||
else if ( systemId.endsWith( "orm_2_0.xsd" ) ) {
|
if (source != null) return source;
|
||||||
InputStream dtdStream = getStreamFromClasspath( "orm_2_0.xsd" );
|
}
|
||||||
final InputSource source = buildInputSource( publicId, systemId, dtdStream, false );
|
else if ( systemId.endsWith( "orm_2_0.xsd" ) ) {
|
||||||
if (source != null) return source;
|
InputStream dtdStream = getStreamFromClasspath( "orm_2_0.xsd" );
|
||||||
}
|
final InputSource source = buildInputSource( publicId, systemId, dtdStream, false );
|
||||||
else if ( systemId.endsWith( "persistence_1_0.xsd" ) ) {
|
if (source != null) return source;
|
||||||
InputStream dtdStream = getStreamFromClasspath( "persistence_1_0.xsd" );
|
}
|
||||||
final InputSource source = buildInputSource( publicId, systemId, dtdStream, true );
|
else if ( systemId.endsWith( "persistence_1_0.xsd" ) ) {
|
||||||
if (source != null) return source;
|
InputStream dtdStream = getStreamFromClasspath( "persistence_1_0.xsd" );
|
||||||
}
|
final InputSource source = buildInputSource( publicId, systemId, dtdStream, true );
|
||||||
else if ( systemId.endsWith( "persistence_2_0.xsd" ) ) {
|
if (source != null) return source;
|
||||||
InputStream dtdStream = getStreamFromClasspath( "persistence_2_0.xsd" );
|
}
|
||||||
final InputSource source = buildInputSource( publicId, systemId, dtdStream, true );
|
else if ( systemId.endsWith( "persistence_2_0.xsd" ) ) {
|
||||||
if (source != null) return source;
|
InputStream dtdStream = getStreamFromClasspath( "persistence_2_0.xsd" );
|
||||||
}
|
final InputSource source = buildInputSource( publicId, systemId, dtdStream, true );
|
||||||
}
|
if (source != null) return source;
|
||||||
}
|
}
|
||||||
else {
|
}
|
||||||
resolved = true;
|
}
|
||||||
return is;
|
else {
|
||||||
}
|
resolved = true;
|
||||||
//use the default behavior
|
return is;
|
||||||
return null;
|
}
|
||||||
}
|
//use the default behavior
|
||||||
|
return null;
|
||||||
private InputSource buildInputSource(String publicId, String systemId, InputStream dtdStream, boolean resolved) {
|
}
|
||||||
if ( dtdStream == null ) {
|
|
||||||
LOG.trace("Unable to locate [" + systemId + "] on classpath");
|
private InputSource buildInputSource(String publicId, String systemId, InputStream dtdStream, boolean resolved) {
|
||||||
return null;
|
if ( dtdStream == null ) {
|
||||||
}
|
LOG.trace("Unable to locate [" + systemId + "] on classpath");
|
||||||
LOG.trace("Located [" + systemId + "] in classpath");
|
return null;
|
||||||
InputSource source = new InputSource(dtdStream);
|
}
|
||||||
source.setPublicId(publicId);
|
LOG.trace("Located [" + systemId + "] in classpath");
|
||||||
source.setSystemId(systemId);
|
InputSource source = new InputSource(dtdStream);
|
||||||
this.resolved = resolved;
|
source.setPublicId(publicId);
|
||||||
return source;
|
source.setSystemId(systemId);
|
||||||
}
|
this.resolved = resolved;
|
||||||
|
return source;
|
||||||
private InputStream getStreamFromClasspath(String fileName) {
|
}
|
||||||
LOG.trace("Recognized JPA ORM namespace; attempting to resolve on classpath under org/hibernate/ejb");
|
|
||||||
String path = "org/hibernate/ejb/" + fileName;
|
private InputStream getStreamFromClasspath(String fileName) {
|
||||||
InputStream dtdStream = resolveInHibernateNamespace( path );
|
LOG.trace("Recognized JPA ORM namespace; attempting to resolve on classpath under org/hibernate/ejb");
|
||||||
return dtdStream;
|
String path = "org/hibernate/ejb/" + fileName;
|
||||||
}
|
InputStream dtdStream = resolveInHibernateNamespace( path );
|
||||||
}
|
return dtdStream;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ package org.hibernate.cfg;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.hibernate.AnnotationException;
|
import org.hibernate.AnnotationException;
|
||||||
import org.hibernate.AssertionFailure;
|
import org.hibernate.AssertionFailure;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.annotations.ColumnTransformer;
|
import org.hibernate.annotations.ColumnTransformer;
|
||||||
import org.hibernate.annotations.ColumnTransformers;
|
import org.hibernate.annotations.ColumnTransformers;
|
||||||
import org.hibernate.annotations.Index;
|
import org.hibernate.annotations.Index;
|
||||||
|
@ -38,6 +38,7 @@ import org.hibernate.mapping.Formula;
|
||||||
import org.hibernate.mapping.Join;
|
import org.hibernate.mapping.Join;
|
||||||
import org.hibernate.mapping.SimpleValue;
|
import org.hibernate.mapping.SimpleValue;
|
||||||
import org.hibernate.mapping.Table;
|
import org.hibernate.mapping.Table;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -48,7 +49,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class Ejb3Column {
|
public class Ejb3Column {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, Ejb3Column.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, Ejb3Column.class.getName());
|
||||||
|
|
||||||
private Column mappingColumn;
|
private Column mappingColumn;
|
||||||
private boolean insertable = true;
|
private boolean insertable = true;
|
||||||
|
|
|
@ -33,11 +33,12 @@ import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.Version;
|
import org.hibernate.Version;
|
||||||
import org.hibernate.bytecode.spi.BytecodeProvider;
|
import org.hibernate.bytecode.spi.BytecodeProvider;
|
||||||
import org.hibernate.internal.util.ConfigHelper;
|
import org.hibernate.internal.util.ConfigHelper;
|
||||||
import org.hibernate.internal.util.config.ConfigurationHelper;
|
import org.hibernate.internal.util.config.ConfigurationHelper;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
|
|
||||||
|
@ -570,7 +571,7 @@ public final class Environment {
|
||||||
private static final Map OBSOLETE_PROPERTIES = new HashMap();
|
private static final Map OBSOLETE_PROPERTIES = new HashMap();
|
||||||
private static final Map RENAMED_PROPERTIES = new HashMap();
|
private static final Map RENAMED_PROPERTIES = new HashMap();
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, Environment.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, Environment.class.getName());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Issues warnings to the user when any obsolete or renamed property names are used.
|
* Issues warnings to the user when any obsolete or renamed property names are used.
|
||||||
|
|
|
@ -36,7 +36,7 @@ import org.hibernate.CacheMode;
|
||||||
import org.hibernate.EntityMode;
|
import org.hibernate.EntityMode;
|
||||||
import org.hibernate.FetchMode;
|
import org.hibernate.FetchMode;
|
||||||
import org.hibernate.FlushMode;
|
import org.hibernate.FlushMode;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.MappingException;
|
import org.hibernate.MappingException;
|
||||||
import org.hibernate.engine.ExecuteUpdateResultCheckStyle;
|
import org.hibernate.engine.ExecuteUpdateResultCheckStyle;
|
||||||
import org.hibernate.engine.FilterDefinition;
|
import org.hibernate.engine.FilterDefinition;
|
||||||
|
@ -107,7 +107,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public final class HbmBinder {
|
public final class HbmBinder {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, HbmBinder.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, HbmBinder.class.getName());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Private constructor to disallow instantiation.
|
* Private constructor to disallow instantiation.
|
||||||
|
|
|
@ -28,11 +28,13 @@ import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.dom4j.Attribute;
|
import org.dom4j.Attribute;
|
||||||
import org.dom4j.Element;
|
import org.dom4j.Element;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.MappingException;
|
import org.hibernate.MappingException;
|
||||||
import org.hibernate.engine.NamedSQLQueryDefinition;
|
import org.hibernate.engine.NamedSQLQueryDefinition;
|
||||||
import org.hibernate.engine.ResultSetMappingDefinition;
|
import org.hibernate.engine.ResultSetMappingDefinition;
|
||||||
import org.hibernate.internal.util.StringHelper;
|
import org.hibernate.internal.util.StringHelper;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,7 +42,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class NamedSQLQuerySecondPass extends ResultSetMappingBinder implements QuerySecondPass {
|
public class NamedSQLQuerySecondPass extends ResultSetMappingBinder implements QuerySecondPass {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
|
||||||
NamedSQLQuerySecondPass.class.getName());
|
NamedSQLQuerySecondPass.class.getName());
|
||||||
|
|
||||||
private Element queryElem;
|
private Element queryElem;
|
||||||
|
|
|
@ -38,7 +38,7 @@ import javax.persistence.OneToMany;
|
||||||
import javax.persistence.OneToOne;
|
import javax.persistence.OneToOne;
|
||||||
import javax.persistence.Transient;
|
import javax.persistence.Transient;
|
||||||
import org.hibernate.AnnotationException;
|
import org.hibernate.AnnotationException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.MappingException;
|
import org.hibernate.MappingException;
|
||||||
import org.hibernate.annotations.ManyToAny;
|
import org.hibernate.annotations.ManyToAny;
|
||||||
import org.hibernate.annotations.Target;
|
import org.hibernate.annotations.Target;
|
||||||
|
@ -46,6 +46,7 @@ import org.hibernate.annotations.Type;
|
||||||
import org.hibernate.annotations.common.reflection.XClass;
|
import org.hibernate.annotations.common.reflection.XClass;
|
||||||
import org.hibernate.annotations.common.reflection.XProperty;
|
import org.hibernate.annotations.common.reflection.XProperty;
|
||||||
import org.hibernate.internal.util.StringHelper;
|
import org.hibernate.internal.util.StringHelper;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -59,7 +60,7 @@ class PropertyContainer {
|
||||||
System.setProperty("jboss.i18n.generate-proxies", "true");
|
System.setProperty("jboss.i18n.generate-proxies", "true");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, PropertyContainer.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, PropertyContainer.class.getName());
|
||||||
|
|
||||||
private final AccessType explicitClassDefinedAccessType;
|
private final AccessType explicitClassDefinedAccessType;
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ import java.util.Properties;
|
||||||
import org.hibernate.ConnectionReleaseMode;
|
import org.hibernate.ConnectionReleaseMode;
|
||||||
import org.hibernate.EntityMode;
|
import org.hibernate.EntityMode;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.MultiTenancyStrategy;
|
import org.hibernate.MultiTenancyStrategy;
|
||||||
import org.hibernate.cache.QueryCacheFactory;
|
import org.hibernate.cache.QueryCacheFactory;
|
||||||
import org.hibernate.cache.RegionFactory;
|
import org.hibernate.cache.RegionFactory;
|
||||||
|
@ -44,6 +44,7 @@ import org.hibernate.internal.util.StringHelper;
|
||||||
import org.hibernate.internal.util.config.ConfigurationHelper;
|
import org.hibernate.internal.util.config.ConfigurationHelper;
|
||||||
import org.hibernate.service.jta.platform.spi.JtaPlatform;
|
import org.hibernate.service.jta.platform.spi.JtaPlatform;
|
||||||
import org.hibernate.service.ServiceRegistry;
|
import org.hibernate.service.ServiceRegistry;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,7 +56,7 @@ public class SettingsFactory implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -1194386144994524825L;
|
private static final long serialVersionUID = -1194386144994524825L;
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, SettingsFactory.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, SettingsFactory.class.getName());
|
||||||
|
|
||||||
public static final String DEF_CACHE_REG_FACTORY = NoCachingRegionFactory.class.getName();
|
public static final String DEF_CACHE_REG_FACTORY = NoCachingRegionFactory.class.getName();
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ import javax.persistence.MapKeyColumn;
|
||||||
import javax.persistence.OneToMany;
|
import javax.persistence.OneToMany;
|
||||||
import org.hibernate.AnnotationException;
|
import org.hibernate.AnnotationException;
|
||||||
import org.hibernate.FetchMode;
|
import org.hibernate.FetchMode;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.MappingException;
|
import org.hibernate.MappingException;
|
||||||
import org.hibernate.annotations.BatchSize;
|
import org.hibernate.annotations.BatchSize;
|
||||||
import org.hibernate.annotations.Cache;
|
import org.hibernate.annotations.Cache;
|
||||||
|
@ -109,6 +109,7 @@ import org.hibernate.mapping.Selectable;
|
||||||
import org.hibernate.mapping.SimpleValue;
|
import org.hibernate.mapping.SimpleValue;
|
||||||
import org.hibernate.mapping.SingleTableSubclass;
|
import org.hibernate.mapping.SingleTableSubclass;
|
||||||
import org.hibernate.mapping.Table;
|
import org.hibernate.mapping.Table;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -119,7 +120,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({"unchecked", "serial"})
|
@SuppressWarnings({"unchecked", "serial"})
|
||||||
public abstract class CollectionBinder {
|
public abstract class CollectionBinder {
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, CollectionBinder.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, CollectionBinder.class.getName());
|
||||||
|
|
||||||
protected Collection collection;
|
protected Collection collection;
|
||||||
protected String propertyName;
|
protected String propertyName;
|
||||||
|
|
|
@ -40,7 +40,7 @@ import org.jboss.logging.Logger;
|
||||||
import org.hibernate.AnnotationException;
|
import org.hibernate.AnnotationException;
|
||||||
import org.hibernate.AssertionFailure;
|
import org.hibernate.AssertionFailure;
|
||||||
import org.hibernate.EntityMode;
|
import org.hibernate.EntityMode;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.MappingException;
|
import org.hibernate.MappingException;
|
||||||
import org.hibernate.annotations.BatchSize;
|
import org.hibernate.annotations.BatchSize;
|
||||||
import org.hibernate.annotations.Cache;
|
import org.hibernate.annotations.Cache;
|
||||||
|
@ -96,7 +96,7 @@ import org.hibernate.mapping.Value;
|
||||||
* @author Emmanuel Bernard
|
* @author Emmanuel Bernard
|
||||||
*/
|
*/
|
||||||
public class EntityBinder {
|
public class EntityBinder {
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, EntityBinder.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, EntityBinder.class.getName());
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
private XClass annotatedClass;
|
private XClass annotatedClass;
|
||||||
|
@ -516,7 +516,7 @@ public class EntityBinder {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( persistentClass instanceof TableOwner ) {
|
if ( persistentClass instanceof TableOwner ) {
|
||||||
LOG.bindEntityOnTable(persistentClass.getEntityName(), table.getName());
|
LOG.bindEntityOnTable( persistentClass.getEntityName(), table.getName() );
|
||||||
( (TableOwner) persistentClass ).setTable( table );
|
( (TableOwner) persistentClass ).setTable( table );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -746,7 +746,7 @@ public class EntityBinder {
|
||||||
|
|
||||||
//somehow keep joins() for later.
|
//somehow keep joins() for later.
|
||||||
//Has to do the work later because it needs persistentClass id!
|
//Has to do the work later because it needs persistentClass id!
|
||||||
LOG.addingSecondaryTableToEntity(persistentClass.getEntityName(), join.getTable().getName());
|
LOG.addingSecondaryTableToEntity( persistentClass.getEntityName(), join.getTable().getName() );
|
||||||
org.hibernate.annotations.Table matchingTable = findMatchingComplimentTableAnnotation( join );
|
org.hibernate.annotations.Table matchingTable = findMatchingComplimentTableAnnotation( join );
|
||||||
if ( matchingTable != null ) {
|
if ( matchingTable != null ) {
|
||||||
join.setSequentialSelect( FetchMode.JOIN != matchingTable.fetch() );
|
join.setSequentialSelect( FetchMode.JOIN != matchingTable.fetch() );
|
||||||
|
|
|
@ -25,7 +25,7 @@ package org.hibernate.cfg.annotations;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.hibernate.AnnotationException;
|
import org.hibernate.AnnotationException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.MappingException;
|
import org.hibernate.MappingException;
|
||||||
import org.hibernate.annotations.OrderBy;
|
import org.hibernate.annotations.OrderBy;
|
||||||
import org.hibernate.annotations.Sort;
|
import org.hibernate.annotations.Sort;
|
||||||
|
@ -55,7 +55,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({"unchecked", "serial"})
|
@SuppressWarnings({"unchecked", "serial"})
|
||||||
public class ListBinder extends CollectionBinder {
|
public class ListBinder extends CollectionBinder {
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, ListBinder.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, ListBinder.class.getName());
|
||||||
|
|
||||||
public ListBinder() {
|
public ListBinder() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ import java.util.Map;
|
||||||
import javax.persistence.EmbeddedId;
|
import javax.persistence.EmbeddedId;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
import org.hibernate.AnnotationException;
|
import org.hibernate.AnnotationException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.annotations.Generated;
|
import org.hibernate.annotations.Generated;
|
||||||
import org.hibernate.annotations.GenerationTime;
|
import org.hibernate.annotations.GenerationTime;
|
||||||
import org.hibernate.annotations.Immutable;
|
import org.hibernate.annotations.Immutable;
|
||||||
|
@ -52,13 +52,14 @@ import org.hibernate.mapping.PropertyGeneration;
|
||||||
import org.hibernate.mapping.RootClass;
|
import org.hibernate.mapping.RootClass;
|
||||||
import org.hibernate.mapping.SimpleValue;
|
import org.hibernate.mapping.SimpleValue;
|
||||||
import org.hibernate.mapping.Value;
|
import org.hibernate.mapping.Value;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Emmanuel Bernard
|
* @author Emmanuel Bernard
|
||||||
*/
|
*/
|
||||||
public class PropertyBinder {
|
public class PropertyBinder {
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, PropertyBinder.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, PropertyBinder.class.getName());
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
private String returnedClassName;
|
private String returnedClassName;
|
||||||
|
|
|
@ -34,7 +34,7 @@ import org.hibernate.AnnotationException;
|
||||||
import org.hibernate.AssertionFailure;
|
import org.hibernate.AssertionFailure;
|
||||||
import org.hibernate.CacheMode;
|
import org.hibernate.CacheMode;
|
||||||
import org.hibernate.FlushMode;
|
import org.hibernate.FlushMode;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.LockMode;
|
import org.hibernate.LockMode;
|
||||||
import org.hibernate.annotations.CacheModeType;
|
import org.hibernate.annotations.CacheModeType;
|
||||||
import org.hibernate.annotations.FlushModeType;
|
import org.hibernate.annotations.FlushModeType;
|
||||||
|
@ -45,6 +45,7 @@ import org.hibernate.engine.NamedQueryDefinition;
|
||||||
import org.hibernate.engine.NamedSQLQueryDefinition;
|
import org.hibernate.engine.NamedSQLQueryDefinition;
|
||||||
import org.hibernate.engine.query.sql.NativeSQLQueryReturn;
|
import org.hibernate.engine.query.sql.NativeSQLQueryReturn;
|
||||||
import org.hibernate.engine.query.sql.NativeSQLQueryRootReturn;
|
import org.hibernate.engine.query.sql.NativeSQLQueryRootReturn;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -53,7 +54,7 @@ import org.jboss.logging.Logger;
|
||||||
* @author Emmanuel Bernard
|
* @author Emmanuel Bernard
|
||||||
*/
|
*/
|
||||||
public abstract class QueryBinder {
|
public abstract class QueryBinder {
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, QueryBinder.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, QueryBinder.class.getName());
|
||||||
|
|
||||||
public static void bindQuery(NamedQuery queryAnn, Mappings mappings, boolean isDefault) {
|
public static void bindQuery(NamedQuery queryAnn, Mappings mappings, boolean isDefault) {
|
||||||
if ( queryAnn == null ) return;
|
if ( queryAnn == null ) return;
|
||||||
|
@ -80,7 +81,7 @@ public abstract class QueryBinder {
|
||||||
else {
|
else {
|
||||||
mappings.addQuery( queryAnn.name(), query );
|
mappings.addQuery( queryAnn.name(), query );
|
||||||
}
|
}
|
||||||
LOG.bindingNamedQuery(queryAnn.name(), queryAnn.query());
|
LOG.bindingNamedQuery( queryAnn.name(), queryAnn.query() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -141,7 +142,7 @@ public abstract class QueryBinder {
|
||||||
else {
|
else {
|
||||||
mappings.addSQLQuery( queryAnn.name(), query );
|
mappings.addSQLQuery( queryAnn.name(), query );
|
||||||
}
|
}
|
||||||
LOG.bindingNamedNativeQuery(queryAnn.name(), queryAnn.query());
|
LOG.bindingNamedNativeQuery( queryAnn.name(), queryAnn.query() );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void bindNativeQuery(org.hibernate.annotations.NamedNativeQuery queryAnn, Mappings mappings) {
|
public static void bindNativeQuery(org.hibernate.annotations.NamedNativeQuery queryAnn, Mappings mappings) {
|
||||||
|
@ -194,7 +195,7 @@ public abstract class QueryBinder {
|
||||||
throw new NotYetImplementedException( "Pure native scalar queries are not yet supported" );
|
throw new NotYetImplementedException( "Pure native scalar queries are not yet supported" );
|
||||||
}
|
}
|
||||||
mappings.addSQLQuery( queryAnn.name(), query );
|
mappings.addSQLQuery( queryAnn.name(), query );
|
||||||
LOG.bindingNamedNativeQuery(queryAnn.name(), queryAnn.query());
|
LOG.bindingNamedNativeQuery( queryAnn.name(), queryAnn.query() );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void bindQueries(NamedQueries queriesAnn, Mappings mappings, boolean isDefault) {
|
public static void bindQueries(NamedQueries queriesAnn, Mappings mappings, boolean isDefault) {
|
||||||
|
@ -241,7 +242,7 @@ public abstract class QueryBinder {
|
||||||
);
|
);
|
||||||
|
|
||||||
mappings.addQuery( queryAnn.name(), query );
|
mappings.addQuery( queryAnn.name(), query );
|
||||||
LOG.bindingNamedQuery(queryAnn.name(), queryAnn.query());
|
LOG.bindingNamedQuery( queryAnn.name(), queryAnn.query() );
|
||||||
}
|
}
|
||||||
|
|
||||||
private static FlushMode getFlushMode(FlushModeType flushModeType) {
|
private static FlushMode getFlushMode(FlushModeType flushModeType) {
|
||||||
|
|
|
@ -34,7 +34,8 @@ import javax.persistence.ColumnResult;
|
||||||
import javax.persistence.EntityResult;
|
import javax.persistence.EntityResult;
|
||||||
import javax.persistence.FieldResult;
|
import javax.persistence.FieldResult;
|
||||||
import javax.persistence.SqlResultSetMapping;
|
import javax.persistence.SqlResultSetMapping;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.LockMode;
|
import org.hibernate.LockMode;
|
||||||
import org.hibernate.MappingException;
|
import org.hibernate.MappingException;
|
||||||
import org.hibernate.cfg.BinderHelper;
|
import org.hibernate.cfg.BinderHelper;
|
||||||
|
@ -55,7 +56,7 @@ import org.jboss.logging.Logger;
|
||||||
* @author Emmanuel Bernard
|
* @author Emmanuel Bernard
|
||||||
*/
|
*/
|
||||||
public class ResultsetMappingSecondPass implements QuerySecondPass {
|
public class ResultsetMappingSecondPass implements QuerySecondPass {
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
|
||||||
ResultsetMappingSecondPass.class.getName());
|
ResultsetMappingSecondPass.class.getName());
|
||||||
|
|
||||||
private SqlResultSetMapping ann;
|
private SqlResultSetMapping ann;
|
||||||
|
@ -72,7 +73,7 @@ public class ResultsetMappingSecondPass implements QuerySecondPass {
|
||||||
//TODO add parameters checkings
|
//TODO add parameters checkings
|
||||||
if ( ann == null ) return;
|
if ( ann == null ) return;
|
||||||
ResultSetMappingDefinition definition = new ResultSetMappingDefinition( ann.name() );
|
ResultSetMappingDefinition definition = new ResultSetMappingDefinition( ann.name() );
|
||||||
LOG.bindingResultSetMapping(definition.getName());
|
LOG.bindingResultSetMapping( definition.getName() );
|
||||||
|
|
||||||
int entityAliasIndex = 0;
|
int entityAliasIndex = 0;
|
||||||
|
|
||||||
|
|
|
@ -22,11 +22,12 @@
|
||||||
* Boston, MA 02110-1301 USA
|
* Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
package org.hibernate.cfg.annotations;
|
package org.hibernate.cfg.annotations;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.annotations.OrderBy;
|
import org.hibernate.annotations.OrderBy;
|
||||||
import org.hibernate.cfg.Environment;
|
import org.hibernate.cfg.Environment;
|
||||||
import org.hibernate.mapping.Collection;
|
import org.hibernate.mapping.Collection;
|
||||||
import org.hibernate.mapping.PersistentClass;
|
import org.hibernate.mapping.PersistentClass;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -35,7 +36,7 @@ import org.jboss.logging.Logger;
|
||||||
* @author Matthew Inger
|
* @author Matthew Inger
|
||||||
*/
|
*/
|
||||||
public class SetBinder extends CollectionBinder {
|
public class SetBinder extends CollectionBinder {
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, SetBinder.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, SetBinder.class.getName());
|
||||||
|
|
||||||
public SetBinder() {
|
public SetBinder() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ import javax.persistence.TemporalType;
|
||||||
import org.hibernate.AnnotationException;
|
import org.hibernate.AnnotationException;
|
||||||
import org.hibernate.AssertionFailure;
|
import org.hibernate.AssertionFailure;
|
||||||
import org.hibernate.Hibernate;
|
import org.hibernate.Hibernate;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.annotations.Parameter;
|
import org.hibernate.annotations.Parameter;
|
||||||
import org.hibernate.annotations.Type;
|
import org.hibernate.annotations.Type;
|
||||||
import org.hibernate.annotations.common.reflection.XClass;
|
import org.hibernate.annotations.common.reflection.XClass;
|
||||||
|
@ -63,7 +63,7 @@ import org.jboss.logging.Logger;
|
||||||
* @author Emmanuel Bernard
|
* @author Emmanuel Bernard
|
||||||
*/
|
*/
|
||||||
public class SimpleValueBinder {
|
public class SimpleValueBinder {
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, SimpleValueBinder.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, SimpleValueBinder.class.getName());
|
||||||
|
|
||||||
private String propertyName;
|
private String propertyName;
|
||||||
private String returnedClassName;
|
private String returnedClassName;
|
||||||
|
|
|
@ -29,7 +29,7 @@ import java.util.List;
|
||||||
import javax.persistence.UniqueConstraint;
|
import javax.persistence.UniqueConstraint;
|
||||||
import org.hibernate.AnnotationException;
|
import org.hibernate.AnnotationException;
|
||||||
import org.hibernate.AssertionFailure;
|
import org.hibernate.AssertionFailure;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.annotations.Index;
|
import org.hibernate.annotations.Index;
|
||||||
import org.hibernate.cfg.BinderHelper;
|
import org.hibernate.cfg.BinderHelper;
|
||||||
import org.hibernate.cfg.Ejb3JoinColumn;
|
import org.hibernate.cfg.Ejb3JoinColumn;
|
||||||
|
@ -51,6 +51,7 @@ import org.hibernate.mapping.SimpleValue;
|
||||||
import org.hibernate.mapping.Table;
|
import org.hibernate.mapping.Table;
|
||||||
import org.hibernate.mapping.ToOne;
|
import org.hibernate.mapping.ToOne;
|
||||||
import org.hibernate.mapping.Value;
|
import org.hibernate.mapping.Value;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -61,7 +62,7 @@ import org.jboss.logging.Logger;
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public class TableBinder {
|
public class TableBinder {
|
||||||
//TODO move it to a getter/setter strategy
|
//TODO move it to a getter/setter strategy
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, TableBinder.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, TableBinder.class.getName());
|
||||||
|
|
||||||
private String schema;
|
private String schema;
|
||||||
private String catalog;
|
private String catalog;
|
||||||
|
|
|
@ -118,7 +118,7 @@ import javax.persistence.Version;
|
||||||
import org.dom4j.Attribute;
|
import org.dom4j.Attribute;
|
||||||
import org.dom4j.Element;
|
import org.dom4j.Element;
|
||||||
import org.hibernate.AnnotationException;
|
import org.hibernate.AnnotationException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.annotations.Cascade;
|
import org.hibernate.annotations.Cascade;
|
||||||
import org.hibernate.annotations.CollectionOfElements;
|
import org.hibernate.annotations.CollectionOfElements;
|
||||||
import org.hibernate.annotations.Columns;
|
import org.hibernate.annotations.Columns;
|
||||||
|
@ -142,7 +142,7 @@ import org.jboss.logging.Logger;
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public class JPAOverridenAnnotationReader implements AnnotationReader {
|
public class JPAOverridenAnnotationReader implements AnnotationReader {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
|
||||||
JPAOverridenAnnotationReader.class.getName());
|
JPAOverridenAnnotationReader.class.getName());
|
||||||
private static final Map<Class, String> annotationToXml;
|
private static final Map<Class, String> annotationToXml;
|
||||||
private static final String SCHEMA_VALIDATION = "Activate schema validation for more information";
|
private static final String SCHEMA_VALIDATION = "Activate schema validation for more information";
|
||||||
|
|
|
@ -1,307 +1,307 @@
|
||||||
/*
|
/*
|
||||||
* Hibernate, Relational Persistence for Idiomatic Java
|
* Hibernate, Relational Persistence for Idiomatic Java
|
||||||
*
|
*
|
||||||
* Copyright (c) 2010, Red Hat Inc. or third-party contributors as
|
* Copyright (c) 2010, Red Hat Inc. or third-party contributors as
|
||||||
* indicated by the @author tags or express copyright attribution
|
* indicated by the @author tags or express copyright attribution
|
||||||
* statements applied by the authors. All third-party contributions are
|
* statements applied by the authors. All third-party contributions are
|
||||||
* distributed under license by Red Hat Inc.
|
* distributed under license by Red Hat Inc.
|
||||||
*
|
*
|
||||||
* This copyrighted material is made available to anyone wishing to use, modify,
|
* 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
|
* copy, or redistribute it subject to the terms and conditions of the GNU
|
||||||
* Lesser General Public License, as published by the Free Software Foundation.
|
* Lesser General Public License, as published by the Free Software Foundation.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
||||||
* for more details.
|
* for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
* along with this distribution; if not, write to:
|
* along with this distribution; if not, write to:
|
||||||
* Free Software Foundation, Inc.
|
* Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor
|
* 51 Franklin Street, Fifth Floor
|
||||||
* Boston, MA 02110-1301 USA
|
* Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
package org.hibernate.cfg.annotations.reflection;
|
package org.hibernate.cfg.annotations.reflection;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.persistence.AccessType;
|
import javax.persistence.AccessType;
|
||||||
import org.dom4j.Document;
|
import org.dom4j.Document;
|
||||||
import org.dom4j.Element;
|
import org.dom4j.Element;
|
||||||
import org.hibernate.AnnotationException;
|
import org.hibernate.AnnotationException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.internal.util.StringHelper;
|
import org.hibernate.internal.util.StringHelper;
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Emmanuel Bernard
|
* @author Emmanuel Bernard
|
||||||
*/
|
*/
|
||||||
public class XMLContext implements Serializable {
|
public class XMLContext implements Serializable {
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, XMLContext.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, XMLContext.class.getName());
|
||||||
private Default globalDefaults;
|
private Default globalDefaults;
|
||||||
private Map<String, Element> classOverriding = new HashMap<String, Element>();
|
private Map<String, Element> classOverriding = new HashMap<String, Element>();
|
||||||
private Map<String, Default> defaultsOverriding = new HashMap<String, Default>();
|
private Map<String, Default> defaultsOverriding = new HashMap<String, Default>();
|
||||||
private List<Element> defaultElements = new ArrayList<Element>();
|
private List<Element> defaultElements = new ArrayList<Element>();
|
||||||
private List<String> defaultEntityListeners = new ArrayList<String>();
|
private List<String> defaultEntityListeners = new ArrayList<String>();
|
||||||
private boolean hasContext = false;
|
private boolean hasContext = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param doc The xml document to add
|
* @param doc The xml document to add
|
||||||
* @return Add a xml document to this context and return the list of added class names.
|
* @return Add a xml document to this context and return the list of added class names.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings( "unchecked" )
|
@SuppressWarnings( "unchecked" )
|
||||||
public List<String> addDocument(Document doc) {
|
public List<String> addDocument(Document doc) {
|
||||||
hasContext = true;
|
hasContext = true;
|
||||||
List<String> addedClasses = new ArrayList<String>();
|
List<String> addedClasses = new ArrayList<String>();
|
||||||
Element root = doc.getRootElement();
|
Element root = doc.getRootElement();
|
||||||
//global defaults
|
//global defaults
|
||||||
Element metadata = root.element( "persistence-unit-metadata" );
|
Element metadata = root.element( "persistence-unit-metadata" );
|
||||||
if ( metadata != null ) {
|
if ( metadata != null ) {
|
||||||
if ( globalDefaults == null ) {
|
if ( globalDefaults == null ) {
|
||||||
globalDefaults = new Default();
|
globalDefaults = new Default();
|
||||||
globalDefaults.setMetadataComplete(
|
globalDefaults.setMetadataComplete(
|
||||||
metadata.element( "xml-mapping-metadata-complete" ) != null ?
|
metadata.element( "xml-mapping-metadata-complete" ) != null ?
|
||||||
Boolean.TRUE :
|
Boolean.TRUE :
|
||||||
null
|
null
|
||||||
);
|
);
|
||||||
Element defaultElement = metadata.element( "persistence-unit-defaults" );
|
Element defaultElement = metadata.element( "persistence-unit-defaults" );
|
||||||
if ( defaultElement != null ) {
|
if ( defaultElement != null ) {
|
||||||
Element unitElement = defaultElement.element( "schema" );
|
Element unitElement = defaultElement.element( "schema" );
|
||||||
globalDefaults.setSchema( unitElement != null ? unitElement.getTextTrim() : null );
|
globalDefaults.setSchema( unitElement != null ? unitElement.getTextTrim() : null );
|
||||||
unitElement = defaultElement.element( "catalog" );
|
unitElement = defaultElement.element( "catalog" );
|
||||||
globalDefaults.setCatalog( unitElement != null ? unitElement.getTextTrim() : null );
|
globalDefaults.setCatalog( unitElement != null ? unitElement.getTextTrim() : null );
|
||||||
unitElement = defaultElement.element( "access" );
|
unitElement = defaultElement.element( "access" );
|
||||||
setAccess( unitElement, globalDefaults );
|
setAccess( unitElement, globalDefaults );
|
||||||
unitElement = defaultElement.element( "cascade-persist" );
|
unitElement = defaultElement.element( "cascade-persist" );
|
||||||
globalDefaults.setCascadePersist( unitElement != null ? Boolean.TRUE : null );
|
globalDefaults.setCascadePersist( unitElement != null ? Boolean.TRUE : null );
|
||||||
unitElement = defaultElement.element( "delimited-identifiers" );
|
unitElement = defaultElement.element( "delimited-identifiers" );
|
||||||
globalDefaults.setDelimitedIdentifiers( unitElement != null ? Boolean.TRUE : null );
|
globalDefaults.setDelimitedIdentifiers( unitElement != null ? Boolean.TRUE : null );
|
||||||
defaultEntityListeners.addAll( addEntityListenerClasses( defaultElement, null, addedClasses ) );
|
defaultEntityListeners.addAll( addEntityListenerClasses( defaultElement, null, addedClasses ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LOG.duplicateMetadata();
|
LOG.duplicateMetadata();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//entity mapping default
|
//entity mapping default
|
||||||
Default entityMappingDefault = new Default();
|
Default entityMappingDefault = new Default();
|
||||||
Element unitElement = root.element( "package" );
|
Element unitElement = root.element( "package" );
|
||||||
String packageName = unitElement != null ? unitElement.getTextTrim() : null;
|
String packageName = unitElement != null ? unitElement.getTextTrim() : null;
|
||||||
entityMappingDefault.setPackageName( packageName );
|
entityMappingDefault.setPackageName( packageName );
|
||||||
unitElement = root.element( "schema" );
|
unitElement = root.element( "schema" );
|
||||||
entityMappingDefault.setSchema( unitElement != null ? unitElement.getTextTrim() : null );
|
entityMappingDefault.setSchema( unitElement != null ? unitElement.getTextTrim() : null );
|
||||||
unitElement = root.element( "catalog" );
|
unitElement = root.element( "catalog" );
|
||||||
entityMappingDefault.setCatalog( unitElement != null ? unitElement.getTextTrim() : null );
|
entityMappingDefault.setCatalog( unitElement != null ? unitElement.getTextTrim() : null );
|
||||||
unitElement = root.element( "access" );
|
unitElement = root.element( "access" );
|
||||||
setAccess( unitElement, entityMappingDefault );
|
setAccess( unitElement, entityMappingDefault );
|
||||||
defaultElements.add( root );
|
defaultElements.add( root );
|
||||||
|
|
||||||
List<Element> entities = root.elements( "entity" );
|
List<Element> entities = root.elements( "entity" );
|
||||||
addClass( entities, packageName, entityMappingDefault, addedClasses );
|
addClass( entities, packageName, entityMappingDefault, addedClasses );
|
||||||
|
|
||||||
entities = root.elements( "mapped-superclass" );
|
entities = root.elements( "mapped-superclass" );
|
||||||
addClass( entities, packageName, entityMappingDefault, addedClasses );
|
addClass( entities, packageName, entityMappingDefault, addedClasses );
|
||||||
|
|
||||||
entities = root.elements( "embeddable" );
|
entities = root.elements( "embeddable" );
|
||||||
addClass( entities, packageName, entityMappingDefault, addedClasses );
|
addClass( entities, packageName, entityMappingDefault, addedClasses );
|
||||||
return addedClasses;
|
return addedClasses;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setAccess(Element unitElement, Default defaultType) {
|
private void setAccess(Element unitElement, Default defaultType) {
|
||||||
if ( unitElement != null ) {
|
if ( unitElement != null ) {
|
||||||
String access = unitElement.getTextTrim();
|
String access = unitElement.getTextTrim();
|
||||||
setAccess( access, defaultType );
|
setAccess( access, defaultType );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setAccess( String access, Default defaultType) {
|
private void setAccess( String access, Default defaultType) {
|
||||||
AccessType type;
|
AccessType type;
|
||||||
if ( access != null ) {
|
if ( access != null ) {
|
||||||
try {
|
try {
|
||||||
type = AccessType.valueOf( access );
|
type = AccessType.valueOf( access );
|
||||||
}
|
}
|
||||||
catch ( IllegalArgumentException e ) {
|
catch ( IllegalArgumentException e ) {
|
||||||
throw new AnnotationException( "Invalid access type " + access + " (check your xml configuration)" );
|
throw new AnnotationException( "Invalid access type " + access + " (check your xml configuration)" );
|
||||||
}
|
}
|
||||||
defaultType.setAccess( type );
|
defaultType.setAccess( type );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addClass(List<Element> entities, String packageName, Default defaults, List<String> addedClasses) {
|
private void addClass(List<Element> entities, String packageName, Default defaults, List<String> addedClasses) {
|
||||||
for (Element element : entities) {
|
for (Element element : entities) {
|
||||||
String className = buildSafeClassName( element.attributeValue( "class" ), packageName );
|
String className = buildSafeClassName( element.attributeValue( "class" ), packageName );
|
||||||
if ( classOverriding.containsKey( className ) ) {
|
if ( classOverriding.containsKey( className ) ) {
|
||||||
//maybe switch it to warn?
|
//maybe switch it to warn?
|
||||||
throw new IllegalStateException( "Duplicate XML entry for " + className );
|
throw new IllegalStateException( "Duplicate XML entry for " + className );
|
||||||
}
|
}
|
||||||
addedClasses.add( className );
|
addedClasses.add( className );
|
||||||
classOverriding.put( className, element );
|
classOverriding.put( className, element );
|
||||||
Default localDefault = new Default();
|
Default localDefault = new Default();
|
||||||
localDefault.override( defaults );
|
localDefault.override( defaults );
|
||||||
String metadataCompleteString = element.attributeValue( "metadata-complete" );
|
String metadataCompleteString = element.attributeValue( "metadata-complete" );
|
||||||
if ( metadataCompleteString != null ) {
|
if ( metadataCompleteString != null ) {
|
||||||
localDefault.setMetadataComplete( Boolean.parseBoolean( metadataCompleteString ) );
|
localDefault.setMetadataComplete( Boolean.parseBoolean( metadataCompleteString ) );
|
||||||
}
|
}
|
||||||
String access = element.attributeValue( "access" );
|
String access = element.attributeValue( "access" );
|
||||||
setAccess( access, localDefault );
|
setAccess( access, localDefault );
|
||||||
defaultsOverriding.put( className, localDefault );
|
defaultsOverriding.put( className, localDefault );
|
||||||
|
|
||||||
LOG.debugf("Adding XML overriding information for %s", className);
|
LOG.debugf("Adding XML overriding information for %s", className);
|
||||||
addEntityListenerClasses( element, packageName, addedClasses );
|
addEntityListenerClasses( element, packageName, addedClasses );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<String> addEntityListenerClasses(Element element, String packageName, List<String> addedClasses) {
|
private List<String> addEntityListenerClasses(Element element, String packageName, List<String> addedClasses) {
|
||||||
List<String> localAddedClasses = new ArrayList<String>();
|
List<String> localAddedClasses = new ArrayList<String>();
|
||||||
Element listeners = element.element( "entity-listeners" );
|
Element listeners = element.element( "entity-listeners" );
|
||||||
if ( listeners != null ) {
|
if ( listeners != null ) {
|
||||||
@SuppressWarnings( "unchecked" )
|
@SuppressWarnings( "unchecked" )
|
||||||
List<Element> elements = listeners.elements( "entity-listener" );
|
List<Element> elements = listeners.elements( "entity-listener" );
|
||||||
for (Element listener : elements) {
|
for (Element listener : elements) {
|
||||||
String listenerClassName = buildSafeClassName( listener.attributeValue( "class" ), packageName );
|
String listenerClassName = buildSafeClassName( listener.attributeValue( "class" ), packageName );
|
||||||
if ( classOverriding.containsKey( listenerClassName ) ) {
|
if ( classOverriding.containsKey( listenerClassName ) ) {
|
||||||
//maybe switch it to warn?
|
//maybe switch it to warn?
|
||||||
if ( "entity-listener".equals( classOverriding.get( listenerClassName ).getName() ) ) {
|
if ( "entity-listener".equals( classOverriding.get( listenerClassName ).getName() ) ) {
|
||||||
LOG.duplicateListener(listenerClassName);
|
LOG.duplicateListener(listenerClassName);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
throw new IllegalStateException("Duplicate XML entry for " + listenerClassName);
|
throw new IllegalStateException("Duplicate XML entry for " + listenerClassName);
|
||||||
}
|
}
|
||||||
localAddedClasses.add( listenerClassName );
|
localAddedClasses.add( listenerClassName );
|
||||||
classOverriding.put( listenerClassName, listener );
|
classOverriding.put( listenerClassName, listener );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOG.debugf("Adding XML overriding information for listeners: %s", localAddedClasses);
|
LOG.debugf("Adding XML overriding information for listeners: %s", localAddedClasses);
|
||||||
addedClasses.addAll( localAddedClasses );
|
addedClasses.addAll( localAddedClasses );
|
||||||
return localAddedClasses;
|
return localAddedClasses;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String buildSafeClassName(String className, String defaultPackageName) {
|
public static String buildSafeClassName(String className, String defaultPackageName) {
|
||||||
if ( className.indexOf( '.' ) < 0 && StringHelper.isNotEmpty( defaultPackageName ) ) {
|
if ( className.indexOf( '.' ) < 0 && StringHelper.isNotEmpty( defaultPackageName ) ) {
|
||||||
className = StringHelper.qualify( defaultPackageName, className );
|
className = StringHelper.qualify( defaultPackageName, className );
|
||||||
}
|
}
|
||||||
return className;
|
return className;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String buildSafeClassName(String className, XMLContext.Default defaults) {
|
public static String buildSafeClassName(String className, XMLContext.Default defaults) {
|
||||||
return buildSafeClassName( className, defaults.getPackageName() );
|
return buildSafeClassName( className, defaults.getPackageName() );
|
||||||
}
|
}
|
||||||
|
|
||||||
public Default getDefault(String className) {
|
public Default getDefault(String className) {
|
||||||
Default xmlDefault = new Default();
|
Default xmlDefault = new Default();
|
||||||
xmlDefault.override( globalDefaults );
|
xmlDefault.override( globalDefaults );
|
||||||
if ( className != null ) {
|
if ( className != null ) {
|
||||||
Default entityMappingOverriding = defaultsOverriding.get( className );
|
Default entityMappingOverriding = defaultsOverriding.get( className );
|
||||||
xmlDefault.override( entityMappingOverriding );
|
xmlDefault.override( entityMappingOverriding );
|
||||||
}
|
}
|
||||||
return xmlDefault;
|
return xmlDefault;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Element getXMLTree(String className ) {
|
public Element getXMLTree(String className ) {
|
||||||
return classOverriding.get( className );
|
return classOverriding.get( className );
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Element> getAllDocuments() {
|
public List<Element> getAllDocuments() {
|
||||||
return defaultElements;
|
return defaultElements;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasContext() {
|
public boolean hasContext() {
|
||||||
return hasContext;
|
return hasContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Default implements Serializable {
|
public static class Default implements Serializable {
|
||||||
private AccessType access;
|
private AccessType access;
|
||||||
private String packageName;
|
private String packageName;
|
||||||
private String schema;
|
private String schema;
|
||||||
private String catalog;
|
private String catalog;
|
||||||
private Boolean metadataComplete;
|
private Boolean metadataComplete;
|
||||||
private Boolean cascadePersist;
|
private Boolean cascadePersist;
|
||||||
private Boolean delimitedIdentifier;
|
private Boolean delimitedIdentifier;
|
||||||
|
|
||||||
public AccessType getAccess() {
|
public AccessType getAccess() {
|
||||||
return access;
|
return access;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setAccess(AccessType access) {
|
protected void setAccess(AccessType access) {
|
||||||
this.access = access;
|
this.access = access;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCatalog() {
|
public String getCatalog() {
|
||||||
return catalog;
|
return catalog;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setCatalog(String catalog) {
|
protected void setCatalog(String catalog) {
|
||||||
this.catalog = catalog;
|
this.catalog = catalog;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPackageName() {
|
public String getPackageName() {
|
||||||
return packageName;
|
return packageName;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setPackageName(String packageName) {
|
protected void setPackageName(String packageName) {
|
||||||
this.packageName = packageName;
|
this.packageName = packageName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSchema() {
|
public String getSchema() {
|
||||||
return schema;
|
return schema;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setSchema(String schema) {
|
protected void setSchema(String schema) {
|
||||||
this.schema = schema;
|
this.schema = schema;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean getMetadataComplete() {
|
public Boolean getMetadataComplete() {
|
||||||
return metadataComplete;
|
return metadataComplete;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseJavaAnnotations() {
|
public boolean canUseJavaAnnotations() {
|
||||||
return metadataComplete == null || !metadataComplete;
|
return metadataComplete == null || !metadataComplete;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setMetadataComplete(Boolean metadataComplete) {
|
protected void setMetadataComplete(Boolean metadataComplete) {
|
||||||
this.metadataComplete = metadataComplete;
|
this.metadataComplete = metadataComplete;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean getCascadePersist() {
|
public Boolean getCascadePersist() {
|
||||||
return cascadePersist;
|
return cascadePersist;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setCascadePersist(Boolean cascadePersist) {
|
void setCascadePersist(Boolean cascadePersist) {
|
||||||
this.cascadePersist = cascadePersist;
|
this.cascadePersist = cascadePersist;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void override(Default globalDefault) {
|
public void override(Default globalDefault) {
|
||||||
if ( globalDefault != null ) {
|
if ( globalDefault != null ) {
|
||||||
if ( globalDefault.getAccess() != null ) access = globalDefault.getAccess();
|
if ( globalDefault.getAccess() != null ) access = globalDefault.getAccess();
|
||||||
if ( globalDefault.getPackageName() != null ) packageName = globalDefault.getPackageName();
|
if ( globalDefault.getPackageName() != null ) packageName = globalDefault.getPackageName();
|
||||||
if ( globalDefault.getSchema() != null ) schema = globalDefault.getSchema();
|
if ( globalDefault.getSchema() != null ) schema = globalDefault.getSchema();
|
||||||
if ( globalDefault.getCatalog() != null ) catalog = globalDefault.getCatalog();
|
if ( globalDefault.getCatalog() != null ) catalog = globalDefault.getCatalog();
|
||||||
if ( globalDefault.getDelimitedIdentifier() != null ) delimitedIdentifier = globalDefault.getDelimitedIdentifier();
|
if ( globalDefault.getDelimitedIdentifier() != null ) delimitedIdentifier = globalDefault.getDelimitedIdentifier();
|
||||||
if ( globalDefault.getMetadataComplete() != null ) {
|
if ( globalDefault.getMetadataComplete() != null ) {
|
||||||
metadataComplete = globalDefault.getMetadataComplete();
|
metadataComplete = globalDefault.getMetadataComplete();
|
||||||
}
|
}
|
||||||
//TODO fix that in stone if cascade-persist is set already?
|
//TODO fix that in stone if cascade-persist is set already?
|
||||||
if ( globalDefault.getCascadePersist() != null ) cascadePersist = globalDefault.getCascadePersist();
|
if ( globalDefault.getCascadePersist() != null ) cascadePersist = globalDefault.getCascadePersist();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDelimitedIdentifiers(Boolean delimitedIdentifier) {
|
public void setDelimitedIdentifiers(Boolean delimitedIdentifier) {
|
||||||
this.delimitedIdentifier = delimitedIdentifier;
|
this.delimitedIdentifier = delimitedIdentifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean getDelimitedIdentifier() {
|
public Boolean getDelimitedIdentifier() {
|
||||||
return delimitedIdentifier;
|
return delimitedIdentifier;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getDefaultEntityListeners() {
|
public List<String> getDefaultEntityListeners() {
|
||||||
return defaultEntityListeners;
|
return defaultEntityListeners;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ import javax.validation.Validation;
|
||||||
import javax.validation.Validator;
|
import javax.validation.Validator;
|
||||||
import javax.validation.ValidatorFactory;
|
import javax.validation.ValidatorFactory;
|
||||||
import org.hibernate.EntityMode;
|
import org.hibernate.EntityMode;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.cfg.Configuration;
|
import org.hibernate.cfg.Configuration;
|
||||||
import org.hibernate.engine.SessionFactoryImplementor;
|
import org.hibernate.engine.SessionFactoryImplementor;
|
||||||
import org.hibernate.event.Initializable;
|
import org.hibernate.event.Initializable;
|
||||||
|
@ -44,6 +44,7 @@ import org.hibernate.event.PreInsertEventListener;
|
||||||
import org.hibernate.event.PreUpdateEvent;
|
import org.hibernate.event.PreUpdateEvent;
|
||||||
import org.hibernate.event.PreUpdateEventListener;
|
import org.hibernate.event.PreUpdateEventListener;
|
||||||
import org.hibernate.persister.entity.EntityPersister;
|
import org.hibernate.persister.entity.EntityPersister;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -56,7 +57,7 @@ import org.jboss.logging.Logger;
|
||||||
public class BeanValidationEventListener implements
|
public class BeanValidationEventListener implements
|
||||||
PreInsertEventListener, PreUpdateEventListener, PreDeleteEventListener, Initializable {
|
PreInsertEventListener, PreUpdateEventListener, PreDeleteEventListener, Initializable {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
|
||||||
BeanValidationEventListener.class.getName());
|
BeanValidationEventListener.class.getName());
|
||||||
|
|
||||||
private ValidatorFactory factory;
|
private ValidatorFactory factory;
|
||||||
|
|
|
@ -33,7 +33,7 @@ import java.util.Set;
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.cfg.Configuration;
|
import org.hibernate.cfg.Configuration;
|
||||||
import org.hibernate.cfg.Environment;
|
import org.hibernate.cfg.Environment;
|
||||||
import org.hibernate.engine.SessionFactoryImplementor;
|
import org.hibernate.engine.SessionFactoryImplementor;
|
||||||
|
@ -47,7 +47,7 @@ import org.hibernate.service.spi.SessionFactoryServiceRegistry;
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
public class BeanValidationIntegrator implements Integrator {
|
public class BeanValidationIntegrator implements Integrator {
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, BeanValidationIntegrator.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, BeanValidationIntegrator.class.getName());
|
||||||
|
|
||||||
public static final String APPLY_CONSTRAINTS = "hibernate.validator.apply_to_ddl";
|
public static final String APPLY_CONSTRAINTS = "hibernate.validator.apply_to_ddl";
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ import org.jboss.logging.Logger;
|
||||||
|
|
||||||
import org.hibernate.AssertionFailure;
|
import org.hibernate.AssertionFailure;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.MappingException;
|
import org.hibernate.MappingException;
|
||||||
import org.hibernate.event.EventType;
|
import org.hibernate.event.EventType;
|
||||||
import org.hibernate.internal.util.ReflectHelper;
|
import org.hibernate.internal.util.ReflectHelper;
|
||||||
|
@ -65,7 +65,7 @@ import org.hibernate.service.event.spi.EventListenerRegistry;
|
||||||
*/
|
*/
|
||||||
class TypeSafeActivator {
|
class TypeSafeActivator {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, TypeSafeActivator.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, TypeSafeActivator.class.getName());
|
||||||
|
|
||||||
private static final String FACTORY_PROPERTY = "javax.persistence.validation.factory";
|
private static final String FACTORY_PROPERTY = "javax.persistence.validation.factory";
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ package org.hibernate.cfg.search;
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
import org.hibernate.AnnotationException;
|
import org.hibernate.AnnotationException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.cfg.Configuration;
|
import org.hibernate.cfg.Configuration;
|
||||||
import org.hibernate.engine.SessionFactoryImplementor;
|
import org.hibernate.engine.SessionFactoryImplementor;
|
||||||
import org.hibernate.event.EventType;
|
import org.hibernate.event.EventType;
|
||||||
|
@ -54,7 +54,7 @@ import org.hibernate.service.spi.SessionFactoryServiceRegistry;
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
public class HibernateSearchIntegrator implements Integrator {
|
public class HibernateSearchIntegrator implements Integrator {
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, HibernateSearchIntegrator.class.getName() );
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, HibernateSearchIntegrator.class.getName() );
|
||||||
|
|
||||||
public static final String AUTO_REGISTER = "hibernate.search.autoregister_listeners";
|
public static final String AUTO_REGISTER = "hibernate.search.autoregister_listeners";
|
||||||
public static final String LISTENER_CLASS = "org.hibernate.search.event.FullTextIndexEventListener";
|
public static final String LISTENER_CLASS = "org.hibernate.search.event.FullTextIndexEventListener";
|
||||||
|
|
|
@ -32,7 +32,7 @@ import java.util.Collection;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import org.hibernate.EntityMode;
|
import org.hibernate.EntityMode;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.engine.SessionImplementor;
|
import org.hibernate.engine.SessionImplementor;
|
||||||
import org.hibernate.loader.CollectionAliases;
|
import org.hibernate.loader.CollectionAliases;
|
||||||
import org.hibernate.persister.collection.CollectionPersister;
|
import org.hibernate.persister.collection.CollectionPersister;
|
||||||
|
@ -49,7 +49,7 @@ import org.jboss.logging.Logger;
|
||||||
public class PersistentArrayHolder extends AbstractPersistentCollection {
|
public class PersistentArrayHolder extends AbstractPersistentCollection {
|
||||||
protected Object array;
|
protected Object array;
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, PersistentArrayHolder.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, PersistentArrayHolder.class.getName());
|
||||||
|
|
||||||
//just to help out during the load (ugly, i know)
|
//just to help out during the load (ugly, i know)
|
||||||
private transient Class elementClass;
|
private transient Class elementClass;
|
||||||
|
|
|
@ -33,7 +33,7 @@ import org.jboss.logging.Logger;
|
||||||
|
|
||||||
import org.hibernate.ConnectionReleaseMode;
|
import org.hibernate.ConnectionReleaseMode;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.engine.SessionFactoryImplementor;
|
import org.hibernate.engine.SessionFactoryImplementor;
|
||||||
import org.hibernate.engine.transaction.internal.jta.JtaStatusHelper;
|
import org.hibernate.engine.transaction.internal.jta.JtaStatusHelper;
|
||||||
|
@ -63,7 +63,7 @@ import org.hibernate.service.jta.platform.spi.JtaPlatform;
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
public class JTASessionContext implements CurrentSessionContext {
|
public class JTASessionContext implements CurrentSessionContext {
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, JTASessionContext.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, JTASessionContext.class.getName());
|
||||||
|
|
||||||
protected final SessionFactoryImplementor factory;
|
protected final SessionFactoryImplementor factory;
|
||||||
private transient Map currentSessionMap = new Hashtable();
|
private transient Map currentSessionMap = new Hashtable();
|
||||||
|
|
|
@ -39,7 +39,7 @@ import org.jboss.logging.Logger;
|
||||||
|
|
||||||
import org.hibernate.ConnectionReleaseMode;
|
import org.hibernate.ConnectionReleaseMode;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
||||||
import org.hibernate.engine.SessionFactoryImplementor;
|
import org.hibernate.engine.SessionFactoryImplementor;
|
||||||
|
@ -76,7 +76,7 @@ import org.hibernate.event.EventSource;
|
||||||
*/
|
*/
|
||||||
public class ThreadLocalSessionContext implements CurrentSessionContext {
|
public class ThreadLocalSessionContext implements CurrentSessionContext {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
|
||||||
ThreadLocalSessionContext.class.getName());
|
ThreadLocalSessionContext.class.getName());
|
||||||
private static final Class[] SESSION_PROXY_INTERFACES = new Class[] {
|
private static final Class[] SESSION_PROXY_INTERFACES = new Class[] {
|
||||||
Session.class,
|
Session.class,
|
||||||
|
|
|
@ -24,7 +24,8 @@
|
||||||
package org.hibernate.dialect;
|
package org.hibernate.dialect;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.MappingException;
|
import org.hibernate.MappingException;
|
||||||
import org.hibernate.dialect.function.AnsiTrimFunction;
|
import org.hibernate.dialect.function.AnsiTrimFunction;
|
||||||
import org.hibernate.dialect.function.DerbyConcatFunction;
|
import org.hibernate.dialect.function.DerbyConcatFunction;
|
||||||
|
@ -46,7 +47,7 @@ import org.jboss.logging.Logger;
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public class DerbyDialect extends DB2Dialect {
|
public class DerbyDialect extends DB2Dialect {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, DerbyDialect.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, DerbyDialect.class.getName());
|
||||||
|
|
||||||
private int driverVersionMajor;
|
private int driverVersionMajor;
|
||||||
private int driverVersionMinor;
|
private int driverVersionMinor;
|
||||||
|
|
|
@ -38,7 +38,7 @@ import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.LockMode;
|
import org.hibernate.LockMode;
|
||||||
import org.hibernate.LockOptions;
|
import org.hibernate.LockOptions;
|
||||||
import org.hibernate.MappingException;
|
import org.hibernate.MappingException;
|
||||||
|
@ -93,7 +93,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public abstract class Dialect {
|
public abstract class Dialect {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, Dialect.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, Dialect.class.getName());
|
||||||
|
|
||||||
public static final String DEFAULT_BATCH_SIZE = "15";
|
public static final String DEFAULT_BATCH_SIZE = "15";
|
||||||
public static final String NO_BATCH = "0";
|
public static final String NO_BATCH = "0";
|
||||||
|
|
|
@ -25,7 +25,7 @@ package org.hibernate.dialect;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.sql.Types;
|
import java.sql.Types;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.cfg.Environment;
|
import org.hibernate.cfg.Environment;
|
||||||
import org.hibernate.dialect.function.AvgWithArgumentCastFunction;
|
import org.hibernate.dialect.function.AvgWithArgumentCastFunction;
|
||||||
import org.hibernate.dialect.function.NoArgSQLFunction;
|
import org.hibernate.dialect.function.NoArgSQLFunction;
|
||||||
|
@ -44,7 +44,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class H2Dialect extends Dialect {
|
public class H2Dialect extends Dialect {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, H2Dialect.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, H2Dialect.class.getName());
|
||||||
|
|
||||||
private final String querySequenceString;
|
private final String querySequenceString;
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,8 @@ package org.hibernate.dialect;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.sql.Types;
|
import java.sql.Types;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.JDBCException;
|
import org.hibernate.JDBCException;
|
||||||
import org.hibernate.LockMode;
|
import org.hibernate.LockMode;
|
||||||
import org.hibernate.StaleObjectStateException;
|
import org.hibernate.StaleObjectStateException;
|
||||||
|
@ -66,7 +67,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class HSQLDialect extends Dialect {
|
public class HSQLDialect extends Dialect {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, HSQLDialect.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, HSQLDialect.class.getName());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* version is 18 for 1.8 or 20 for 2.0
|
* version is 18 for 1.8 or 20 for 2.0
|
||||||
|
|
|
@ -28,7 +28,7 @@ import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.sql.Types;
|
import java.sql.Types;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.cfg.Environment;
|
import org.hibernate.cfg.Environment;
|
||||||
import org.hibernate.dialect.function.NoArgSQLFunction;
|
import org.hibernate.dialect.function.NoArgSQLFunction;
|
||||||
import org.hibernate.dialect.function.NvlFunction;
|
import org.hibernate.dialect.function.NvlFunction;
|
||||||
|
@ -51,7 +51,7 @@ import org.jboss.logging.Logger;
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public class Oracle9Dialect extends Dialect {
|
public class Oracle9Dialect extends Dialect {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, Oracle9Dialect.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, Oracle9Dialect.class.getName());
|
||||||
|
|
||||||
public Oracle9Dialect() {
|
public Oracle9Dialect() {
|
||||||
super();
|
super();
|
||||||
|
|
|
@ -23,7 +23,8 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.dialect;
|
package org.hibernate.dialect;
|
||||||
import java.sql.Types;
|
import java.sql.Types;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.sql.CaseFragment;
|
import org.hibernate.sql.CaseFragment;
|
||||||
import org.hibernate.sql.DecodeCaseFragment;
|
import org.hibernate.sql.DecodeCaseFragment;
|
||||||
import org.hibernate.sql.JoinFragment;
|
import org.hibernate.sql.JoinFragment;
|
||||||
|
@ -39,7 +40,7 @@ import org.jboss.logging.Logger;
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public class OracleDialect extends Oracle9Dialect {
|
public class OracleDialect extends Oracle9Dialect {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, OracleDialect.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, OracleDialect.class.getName());
|
||||||
|
|
||||||
public OracleDialect() {
|
public OracleDialect() {
|
||||||
super();
|
super();
|
||||||
|
|
|
@ -23,7 +23,8 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.dialect;
|
package org.hibernate.dialect;
|
||||||
import java.sql.Types;
|
import java.sql.Types;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.LockMode;
|
import org.hibernate.LockMode;
|
||||||
import org.hibernate.dialect.function.NoArgSQLFunction;
|
import org.hibernate.dialect.function.NoArgSQLFunction;
|
||||||
import org.hibernate.dialect.function.SQLFunctionTemplate;
|
import org.hibernate.dialect.function.SQLFunctionTemplate;
|
||||||
|
@ -56,7 +57,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class RDMSOS2200Dialect extends Dialect {
|
public class RDMSOS2200Dialect extends Dialect {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, RDMSOS2200Dialect.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, RDMSOS2200Dialect.class.getName());
|
||||||
|
|
||||||
public RDMSOS2200Dialect() {
|
public RDMSOS2200Dialect() {
|
||||||
super();
|
super();
|
||||||
|
|
|
@ -24,8 +24,10 @@
|
||||||
package org.hibernate.dialect.function;
|
package org.hibernate.dialect.function;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.engine.SessionFactoryImplementor;
|
import org.hibernate.engine.SessionFactoryImplementor;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -35,7 +37,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class TemplateRenderer {
|
public class TemplateRenderer {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, TemplateRenderer.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, TemplateRenderer.class.getName());
|
||||||
|
|
||||||
private final String template;
|
private final String template;
|
||||||
private final String[] chunks;
|
private final String[] chunks;
|
||||||
|
|
|
@ -26,7 +26,7 @@ import java.io.Serializable;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.JDBCException;
|
import org.hibernate.JDBCException;
|
||||||
import org.hibernate.LockMode;
|
import org.hibernate.LockMode;
|
||||||
import org.hibernate.PessimisticLockException;
|
import org.hibernate.PessimisticLockException;
|
||||||
|
@ -52,7 +52,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class PessimisticReadUpdateLockingStrategy implements LockingStrategy {
|
public class PessimisticReadUpdateLockingStrategy implements LockingStrategy {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
|
||||||
PessimisticReadUpdateLockingStrategy.class.getName());
|
PessimisticReadUpdateLockingStrategy.class.getName());
|
||||||
|
|
||||||
private final Lockable lockable;
|
private final Lockable lockable;
|
||||||
|
|
|
@ -26,7 +26,7 @@ import java.io.Serializable;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.JDBCException;
|
import org.hibernate.JDBCException;
|
||||||
import org.hibernate.LockMode;
|
import org.hibernate.LockMode;
|
||||||
import org.hibernate.PessimisticLockException;
|
import org.hibernate.PessimisticLockException;
|
||||||
|
@ -52,7 +52,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class PessimisticWriteUpdateLockingStrategy implements LockingStrategy {
|
public class PessimisticWriteUpdateLockingStrategy implements LockingStrategy {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
|
||||||
PessimisticWriteUpdateLockingStrategy.class.getName());
|
PessimisticWriteUpdateLockingStrategy.class.getName());
|
||||||
|
|
||||||
private final Lockable lockable;
|
private final Lockable lockable;
|
||||||
|
|
|
@ -26,7 +26,7 @@ import java.io.Serializable;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.JDBCException;
|
import org.hibernate.JDBCException;
|
||||||
import org.hibernate.LockMode;
|
import org.hibernate.LockMode;
|
||||||
import org.hibernate.StaleObjectStateException;
|
import org.hibernate.StaleObjectStateException;
|
||||||
|
@ -48,7 +48,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class UpdateLockingStrategy implements LockingStrategy {
|
public class UpdateLockingStrategy implements LockingStrategy {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, UpdateLockingStrategy.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, UpdateLockingStrategy.class.getName());
|
||||||
|
|
||||||
private final Lockable lockable;
|
private final Lockable lockable;
|
||||||
private final LockMode lockMode;
|
private final LockMode lockMode;
|
||||||
|
|
|
@ -23,10 +23,12 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.dialect.resolver;
|
package org.hibernate.dialect.resolver;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.JDBCException;
|
import org.hibernate.JDBCException;
|
||||||
import org.hibernate.exception.SQLStateConverter;
|
import org.hibernate.exception.SQLStateConverter;
|
||||||
import org.hibernate.exception.ViolatedConstraintNameExtracter;
|
import org.hibernate.exception.ViolatedConstraintNameExtracter;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -36,7 +38,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class BasicSQLExceptionConverter {
|
public class BasicSQLExceptionConverter {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
|
||||||
BasicSQLExceptionConverter.class.getName());
|
BasicSQLExceptionConverter.class.getName());
|
||||||
public static final BasicSQLExceptionConverter INSTANCE = new BasicSQLExceptionConverter();
|
public static final BasicSQLExceptionConverter INSTANCE = new BasicSQLExceptionConverter();
|
||||||
public static final String MSG = LOG.unableToQueryDatabaseMetadata();
|
public static final String MSG = LOG.unableToQueryDatabaseMetadata();
|
||||||
|
|
|
@ -34,7 +34,7 @@ import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import org.hibernate.AssertionFailure;
|
import org.hibernate.AssertionFailure;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.action.internal.BulkOperationCleanupAction;
|
import org.hibernate.action.internal.BulkOperationCleanupAction;
|
||||||
import org.hibernate.action.internal.CollectionAction;
|
import org.hibernate.action.internal.CollectionAction;
|
||||||
import org.hibernate.action.internal.CollectionRecreateAction;
|
import org.hibernate.action.internal.CollectionRecreateAction;
|
||||||
|
@ -63,7 +63,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class ActionQueue {
|
public class ActionQueue {
|
||||||
|
|
||||||
static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, ActionQueue.class.getName());
|
static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, ActionQueue.class.getName());
|
||||||
private static final int INIT_QUEUE_LIST_SIZE = 5;
|
private static final int INIT_QUEUE_LIST_SIZE = 5;
|
||||||
|
|
||||||
private SessionImplementor session;
|
private SessionImplementor session;
|
||||||
|
|
|
@ -30,7 +30,7 @@ import java.util.Iterator;
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
import org.hibernate.EntityMode;
|
import org.hibernate.EntityMode;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.collection.PersistentCollection;
|
import org.hibernate.collection.PersistentCollection;
|
||||||
import org.hibernate.event.EventSource;
|
import org.hibernate.event.EventSource;
|
||||||
import org.hibernate.internal.util.collections.CollectionHelper;
|
import org.hibernate.internal.util.collections.CollectionHelper;
|
||||||
|
@ -96,7 +96,7 @@ public final class Cascade {
|
||||||
*/
|
*/
|
||||||
public static final int BEFORE_MERGE = 0;
|
public static final int BEFORE_MERGE = 0;
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, Cascade.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, Cascade.class.getName());
|
||||||
|
|
||||||
|
|
||||||
private int cascadeTo;
|
private int cascadeTo;
|
||||||
|
|
|
@ -27,7 +27,7 @@ import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.LockMode;
|
import org.hibernate.LockMode;
|
||||||
import org.hibernate.LockOptions;
|
import org.hibernate.LockOptions;
|
||||||
import org.hibernate.ReplicationMode;
|
import org.hibernate.ReplicationMode;
|
||||||
|
@ -48,7 +48,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public abstract class CascadingAction {
|
public abstract class CascadingAction {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, CascadingAction.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, CascadingAction.class.getName());
|
||||||
|
|
||||||
|
|
||||||
// the CascadingAction contract ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// the CascadingAction contract ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
|
@ -30,7 +30,7 @@ import java.io.Serializable;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import org.hibernate.AssertionFailure;
|
import org.hibernate.AssertionFailure;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.MappingException;
|
import org.hibernate.MappingException;
|
||||||
import org.hibernate.collection.PersistentCollection;
|
import org.hibernate.collection.PersistentCollection;
|
||||||
import org.hibernate.persister.collection.CollectionPersister;
|
import org.hibernate.persister.collection.CollectionPersister;
|
||||||
|
@ -45,7 +45,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public final class CollectionEntry implements Serializable {
|
public final class CollectionEntry implements Serializable {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, CollectionEntry.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, CollectionEntry.class.getName());
|
||||||
|
|
||||||
//ATTRIBUTES MAINTAINED BETWEEN FLUSH CYCLES
|
//ATTRIBUTES MAINTAINED BETWEEN FLUSH CYCLES
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ import org.jboss.logging.Logger;
|
||||||
import org.hibernate.AssertionFailure;
|
import org.hibernate.AssertionFailure;
|
||||||
import org.hibernate.EntityMode;
|
import org.hibernate.EntityMode;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.collection.PersistentCollection;
|
import org.hibernate.collection.PersistentCollection;
|
||||||
import org.hibernate.persister.collection.CollectionPersister;
|
import org.hibernate.persister.collection.CollectionPersister;
|
||||||
import org.hibernate.pretty.MessageHelper;
|
import org.hibernate.pretty.MessageHelper;
|
||||||
|
@ -42,7 +42,7 @@ import org.hibernate.type.CollectionType;
|
||||||
*/
|
*/
|
||||||
public final class Collections {
|
public final class Collections {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, Collections.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, Collections.class.getName());
|
||||||
|
|
||||||
private Collections() {}
|
private Collections() {}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,9 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.engine;
|
package org.hibernate.engine;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -37,7 +39,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class IdentifierValue {
|
public class IdentifierValue {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, IdentifierValue.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, IdentifierValue.class.getName());
|
||||||
|
|
||||||
private final Serializable value;
|
private final Serializable value;
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ import java.sql.SQLException;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.type.Type;
|
import org.hibernate.type.Type;
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class ParameterBinder {
|
public class ParameterBinder {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, ParameterBinder.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, ParameterBinder.class.getName());
|
||||||
|
|
||||||
public static interface NamedParameterSource {
|
public static interface NamedParameterSource {
|
||||||
public int[] getNamedParameterLocations(String name);
|
public int[] getNamedParameterLocations(String name);
|
||||||
|
|
|
@ -32,7 +32,7 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.LockOptions;
|
import org.hibernate.LockOptions;
|
||||||
import org.hibernate.QueryException;
|
import org.hibernate.QueryException;
|
||||||
import org.hibernate.ScrollMode;
|
import org.hibernate.ScrollMode;
|
||||||
|
@ -50,7 +50,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public final class QueryParameters {
|
public final class QueryParameters {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, QueryParameters.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, QueryParameters.class.getName());
|
||||||
|
|
||||||
private Type[] positionalParameterTypes;
|
private Type[] positionalParameterTypes;
|
||||||
private Object[] positionalParameterValues;
|
private Object[] positionalParameterValues;
|
||||||
|
|
|
@ -42,7 +42,7 @@ import org.jboss.logging.Logger;
|
||||||
import org.hibernate.AssertionFailure;
|
import org.hibernate.AssertionFailure;
|
||||||
import org.hibernate.Hibernate;
|
import org.hibernate.Hibernate;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.LockMode;
|
import org.hibernate.LockMode;
|
||||||
import org.hibernate.MappingException;
|
import org.hibernate.MappingException;
|
||||||
import org.hibernate.NonUniqueObjectException;
|
import org.hibernate.NonUniqueObjectException;
|
||||||
|
@ -77,7 +77,7 @@ public class StatefulPersistenceContext implements PersistenceContext {
|
||||||
|
|
||||||
public static final Object NO_ROW = new MarkerObject( "NO_ROW" );
|
public static final Object NO_ROW = new MarkerObject( "NO_ROW" );
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
|
||||||
StatefulPersistenceContext.class.getName());
|
StatefulPersistenceContext.class.getName());
|
||||||
private static final int INIT_COLL_SIZE = 8;
|
private static final int INIT_COLL_SIZE = 8;
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ import org.jboss.logging.Logger;
|
||||||
import org.hibernate.AssertionFailure;
|
import org.hibernate.AssertionFailure;
|
||||||
import org.hibernate.CacheMode;
|
import org.hibernate.CacheMode;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.LockMode;
|
import org.hibernate.LockMode;
|
||||||
import org.hibernate.bytecode.instrumentation.spi.LazyPropertyInitializer;
|
import org.hibernate.bytecode.instrumentation.spi.LazyPropertyInitializer;
|
||||||
import org.hibernate.cache.CacheKey;
|
import org.hibernate.cache.CacheKey;
|
||||||
|
@ -58,8 +58,8 @@ import org.hibernate.type.TypeHelper;
|
||||||
*/
|
*/
|
||||||
public final class TwoPhaseLoad {
|
public final class TwoPhaseLoad {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(
|
||||||
HibernateLogger.class, TwoPhaseLoad.class.getName()
|
CoreMessageLogger.class, TwoPhaseLoad.class.getName()
|
||||||
);
|
);
|
||||||
|
|
||||||
private TwoPhaseLoad() {}
|
private TwoPhaseLoad() {}
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.hibernate.engine;
|
package org.hibernate.engine;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.MappingException;
|
import org.hibernate.MappingException;
|
||||||
import org.hibernate.id.IdentifierGeneratorHelper;
|
import org.hibernate.id.IdentifierGeneratorHelper;
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
@ -38,7 +38,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class VersionValue {
|
public class VersionValue {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, VersionValue.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, VersionValue.class.getName());
|
||||||
|
|
||||||
private final Object value;
|
private final Object value;
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.hibernate.engine;
|
package org.hibernate.engine;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.persister.entity.EntityPersister;
|
import org.hibernate.persister.entity.EntityPersister;
|
||||||
import org.hibernate.type.VersionType;
|
import org.hibernate.type.VersionType;
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
@ -57,7 +57,7 @@ public final class Versioning {
|
||||||
*/
|
*/
|
||||||
public static final int OPTIMISTIC_LOCK_DIRTY = 1;
|
public static final int OPTIMISTIC_LOCK_DIRTY = 1;
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, Versioning.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, Versioning.class.getName());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Private constructor disallowing instantiation.
|
* Private constructor disallowing instantiation.
|
||||||
|
|
|
@ -29,8 +29,10 @@ import java.lang.reflect.Method;
|
||||||
import java.lang.reflect.Proxy;
|
import java.lang.reflect.Proxy;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.engine.jdbc.spi.SqlExceptionHelper;
|
import org.hibernate.engine.jdbc.spi.SqlExceptionHelper;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -42,7 +44,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class ResultSetWrapperProxy implements InvocationHandler {
|
public class ResultSetWrapperProxy implements InvocationHandler {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, ResultSetWrapperProxy.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, ResultSetWrapperProxy.class.getName());
|
||||||
private static final Class[] PROXY_INTERFACES = new Class[] { ResultSet.class };
|
private static final Class[] PROXY_INTERFACES = new Class[] { ResultSet.class };
|
||||||
private static final SqlExceptionHelper sqlExceptionHelper = new SqlExceptionHelper();
|
private static final SqlExceptionHelper sqlExceptionHelper = new SqlExceptionHelper();
|
||||||
|
|
||||||
|
|
|
@ -27,13 +27,15 @@ import java.sql.PreparedStatement;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.engine.jdbc.batch.spi.Batch;
|
import org.hibernate.engine.jdbc.batch.spi.Batch;
|
||||||
import org.hibernate.engine.jdbc.batch.spi.BatchKey;
|
import org.hibernate.engine.jdbc.batch.spi.BatchKey;
|
||||||
import org.hibernate.engine.jdbc.batch.spi.BatchObserver;
|
import org.hibernate.engine.jdbc.batch.spi.BatchObserver;
|
||||||
import org.hibernate.engine.jdbc.spi.JdbcCoordinator;
|
import org.hibernate.engine.jdbc.spi.JdbcCoordinator;
|
||||||
import org.hibernate.engine.jdbc.spi.SqlExceptionHelper;
|
import org.hibernate.engine.jdbc.spi.SqlExceptionHelper;
|
||||||
import org.hibernate.engine.jdbc.spi.SqlStatementLogger;
|
import org.hibernate.engine.jdbc.spi.SqlStatementLogger;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -43,7 +45,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractBatchImpl implements Batch {
|
public abstract class AbstractBatchImpl implements Batch {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, AbstractBatchImpl.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, AbstractBatchImpl.class.getName());
|
||||||
|
|
||||||
private final BatchKey key;
|
private final BatchKey key;
|
||||||
private final JdbcCoordinator jdbcCoordinator;
|
private final JdbcCoordinator jdbcCoordinator;
|
||||||
|
|
|
@ -24,7 +24,8 @@
|
||||||
package org.hibernate.engine.jdbc.batch.internal;
|
package org.hibernate.engine.jdbc.batch.internal;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.cfg.Environment;
|
import org.hibernate.cfg.Environment;
|
||||||
import org.hibernate.engine.jdbc.batch.spi.Batch;
|
import org.hibernate.engine.jdbc.batch.spi.Batch;
|
||||||
import org.hibernate.engine.jdbc.batch.spi.BatchBuilder;
|
import org.hibernate.engine.jdbc.batch.spi.BatchBuilder;
|
||||||
|
@ -41,7 +42,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class BatchBuilderImpl implements BatchBuilder, Configurable {
|
public class BatchBuilderImpl implements BatchBuilder, Configurable {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, BatchBuilderImpl.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, BatchBuilderImpl.class.getName());
|
||||||
|
|
||||||
private int size;
|
private int size;
|
||||||
|
|
||||||
|
|
|
@ -26,9 +26,10 @@ import java.sql.PreparedStatement;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.engine.jdbc.batch.spi.BatchKey;
|
import org.hibernate.engine.jdbc.batch.spi.BatchKey;
|
||||||
import org.hibernate.engine.jdbc.spi.JdbcCoordinator;
|
import org.hibernate.engine.jdbc.spi.JdbcCoordinator;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -39,7 +40,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class BatchingBatch extends AbstractBatchImpl {
|
public class BatchingBatch extends AbstractBatchImpl {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, BatchingBatch.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, BatchingBatch.class.getName());
|
||||||
|
|
||||||
// IMPL NOTE : Until HHH-5797 is fixed, there will only be 1 statement in a batch
|
// IMPL NOTE : Until HHH-5797 is fixed, there will only be 1 statement in a batch
|
||||||
|
|
||||||
|
|
|
@ -26,9 +26,11 @@ package org.hibernate.engine.jdbc.batch.internal;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.engine.jdbc.batch.spi.BatchKey;
|
import org.hibernate.engine.jdbc.batch.spi.BatchKey;
|
||||||
import org.hibernate.engine.jdbc.spi.JdbcCoordinator;
|
import org.hibernate.engine.jdbc.spi.JdbcCoordinator;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -39,7 +41,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class NonBatchingBatch extends AbstractBatchImpl {
|
public class NonBatchingBatch extends AbstractBatchImpl {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, NonBatchingBatch.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, NonBatchingBatch.class.getName());
|
||||||
|
|
||||||
protected NonBatchingBatch(BatchKey key, JdbcCoordinator jdbcCoordinator) {
|
protected NonBatchingBatch(BatchKey key, JdbcCoordinator jdbcCoordinator) {
|
||||||
super( key, jdbcCoordinator );
|
super( key, jdbcCoordinator );
|
||||||
|
|
|
@ -29,7 +29,7 @@ import java.io.ObjectOutputStream;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.engine.SessionFactoryImplementor;
|
import org.hibernate.engine.SessionFactoryImplementor;
|
||||||
import org.hibernate.engine.jdbc.batch.spi.Batch;
|
import org.hibernate.engine.jdbc.batch.spi.Batch;
|
||||||
import org.hibernate.engine.jdbc.batch.spi.BatchBuilder;
|
import org.hibernate.engine.jdbc.batch.spi.BatchBuilder;
|
||||||
|
@ -56,7 +56,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class JdbcCoordinatorImpl implements JdbcCoordinator {
|
public class JdbcCoordinatorImpl implements JdbcCoordinator {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, JdbcCoordinatorImpl.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, JdbcCoordinatorImpl.class.getName());
|
||||||
|
|
||||||
private transient TransactionCoordinatorImpl transactionCoordinator;
|
private transient TransactionCoordinatorImpl transactionCoordinator;
|
||||||
|
|
||||||
|
|
|
@ -31,11 +31,12 @@ import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.engine.jdbc.spi.InvalidatableWrapper;
|
import org.hibernate.engine.jdbc.spi.InvalidatableWrapper;
|
||||||
import org.hibernate.engine.jdbc.spi.JdbcResourceRegistry;
|
import org.hibernate.engine.jdbc.spi.JdbcResourceRegistry;
|
||||||
import org.hibernate.engine.jdbc.spi.JdbcWrapper;
|
import org.hibernate.engine.jdbc.spi.JdbcWrapper;
|
||||||
import org.hibernate.engine.jdbc.spi.SqlExceptionHelper;
|
import org.hibernate.engine.jdbc.spi.SqlExceptionHelper;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
import org.jboss.logging.Logger.Level;
|
import org.jboss.logging.Logger.Level;
|
||||||
|
|
||||||
|
@ -46,7 +47,7 @@ import org.jboss.logging.Logger.Level;
|
||||||
*/
|
*/
|
||||||
public class JdbcResourceRegistryImpl implements JdbcResourceRegistry {
|
public class JdbcResourceRegistryImpl implements JdbcResourceRegistry {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
|
||||||
JdbcResourceRegistryImpl.class.getName());
|
JdbcResourceRegistryImpl.class.getName());
|
||||||
|
|
||||||
private final HashMap<Statement,Set<ResultSet>> xref = new HashMap<Statement,Set<ResultSet>>();
|
private final HashMap<Statement,Set<ResultSet>> xref = new HashMap<Statement,Set<ResultSet>>();
|
||||||
|
|
|
@ -36,7 +36,7 @@ import java.util.Set;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.MultiTenancyStrategy;
|
import org.hibernate.MultiTenancyStrategy;
|
||||||
import org.hibernate.cfg.Environment;
|
import org.hibernate.cfg.Environment;
|
||||||
import org.hibernate.dialect.Dialect;
|
import org.hibernate.dialect.Dialect;
|
||||||
|
@ -64,7 +64,7 @@ import org.hibernate.service.spi.ServiceRegistryImplementor;
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
public class JdbcServicesImpl implements JdbcServices, ServiceRegistryAwareService, Configurable {
|
public class JdbcServicesImpl implements JdbcServices, ServiceRegistryAwareService, Configurable {
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, JdbcServicesImpl.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, JdbcServicesImpl.class.getName());
|
||||||
|
|
||||||
private ServiceRegistryImplementor serviceRegistry;
|
private ServiceRegistryImplementor serviceRegistry;
|
||||||
|
|
||||||
|
|
|
@ -28,13 +28,15 @@ import java.sql.Connection;
|
||||||
import java.sql.DatabaseMetaData;
|
import java.sql.DatabaseMetaData;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.cfg.Environment;
|
import org.hibernate.cfg.Environment;
|
||||||
import org.hibernate.engine.jdbc.ContextualLobCreator;
|
import org.hibernate.engine.jdbc.ContextualLobCreator;
|
||||||
import org.hibernate.engine.jdbc.LobCreationContext;
|
import org.hibernate.engine.jdbc.LobCreationContext;
|
||||||
import org.hibernate.engine.jdbc.LobCreator;
|
import org.hibernate.engine.jdbc.LobCreator;
|
||||||
import org.hibernate.engine.jdbc.NonContextualLobCreator;
|
import org.hibernate.engine.jdbc.NonContextualLobCreator;
|
||||||
import org.hibernate.internal.util.config.ConfigurationHelper;
|
import org.hibernate.internal.util.config.ConfigurationHelper;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -44,7 +46,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class LobCreatorBuilder {
|
public class LobCreatorBuilder {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, LobCreatorBuilder.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, LobCreatorBuilder.class.getName());
|
||||||
|
|
||||||
private boolean useContextualLobCreation;
|
private boolean useContextualLobCreation;
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.hibernate.ConnectionReleaseMode;
|
import org.hibernate.ConnectionReleaseMode;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.JDBCException;
|
import org.hibernate.JDBCException;
|
||||||
import org.hibernate.engine.jdbc.internal.proxy.ProxyBuilder;
|
import org.hibernate.engine.jdbc.internal.proxy.ProxyBuilder;
|
||||||
import org.hibernate.engine.jdbc.spi.ConnectionObserver;
|
import org.hibernate.engine.jdbc.spi.ConnectionObserver;
|
||||||
|
@ -44,6 +44,7 @@ import org.hibernate.engine.jdbc.spi.LogicalConnectionImplementor;
|
||||||
import org.hibernate.engine.jdbc.spi.NonDurableConnectionObserver;
|
import org.hibernate.engine.jdbc.spi.NonDurableConnectionObserver;
|
||||||
import org.hibernate.engine.transaction.spi.TransactionContext;
|
import org.hibernate.engine.transaction.spi.TransactionContext;
|
||||||
import org.hibernate.internal.util.collections.CollectionHelper;
|
import org.hibernate.internal.util.collections.CollectionHelper;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,7 +56,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class LogicalConnectionImpl implements LogicalConnectionImplementor {
|
public class LogicalConnectionImpl implements LogicalConnectionImplementor {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, LogicalConnectionImpl.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, LogicalConnectionImpl.class.getName());
|
||||||
|
|
||||||
private transient Connection physicalConnection;
|
private transient Connection physicalConnection;
|
||||||
private transient Connection shareableConnectionProxy;
|
private transient Connection shareableConnectionProxy;
|
||||||
|
|
|
@ -27,8 +27,10 @@ import java.sql.DatabaseMetaData;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.internal.util.collections.ArrayHelper;
|
import org.hibernate.internal.util.collections.ArrayHelper;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -38,7 +40,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class TypeInfoExtracter {
|
public class TypeInfoExtracter {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, TypeInfoExtracter.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, TypeInfoExtracter.class.getName());
|
||||||
|
|
||||||
private TypeInfoExtracter() {
|
private TypeInfoExtracter() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,9 +27,11 @@ import java.lang.reflect.Method;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.sql.Statement;
|
import java.sql.Statement;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.engine.jdbc.spi.JdbcResourceRegistry;
|
import org.hibernate.engine.jdbc.spi.JdbcResourceRegistry;
|
||||||
import org.hibernate.engine.jdbc.spi.JdbcServices;
|
import org.hibernate.engine.jdbc.spi.JdbcServices;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -39,7 +41,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractResultSetProxyHandler extends AbstractProxyHandler {
|
public abstract class AbstractResultSetProxyHandler extends AbstractProxyHandler {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
|
||||||
AbstractResultSetProxyHandler.class.getName());
|
AbstractResultSetProxyHandler.class.getName());
|
||||||
|
|
||||||
private ResultSet resultSet;
|
private ResultSet resultSet;
|
||||||
|
|
|
@ -28,10 +28,12 @@ import java.sql.Connection;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.sql.Statement;
|
import java.sql.Statement;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.engine.jdbc.spi.JdbcResourceRegistry;
|
import org.hibernate.engine.jdbc.spi.JdbcResourceRegistry;
|
||||||
import org.hibernate.engine.jdbc.spi.JdbcServices;
|
import org.hibernate.engine.jdbc.spi.JdbcServices;
|
||||||
import org.hibernate.engine.jdbc.spi.LogicalConnectionImplementor;
|
import org.hibernate.engine.jdbc.spi.LogicalConnectionImplementor;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -41,7 +43,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractStatementProxyHandler extends AbstractProxyHandler {
|
public abstract class AbstractStatementProxyHandler extends AbstractProxyHandler {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
|
||||||
AbstractStatementProxyHandler.class.getName());
|
AbstractStatementProxyHandler.class.getName());
|
||||||
|
|
||||||
private ConnectionProxyHandler connectionProxyHandler;
|
private ConnectionProxyHandler connectionProxyHandler;
|
||||||
|
|
|
@ -32,11 +32,12 @@ import java.sql.DatabaseMetaData;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.sql.Statement;
|
import java.sql.Statement;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.engine.jdbc.spi.JdbcResourceRegistry;
|
import org.hibernate.engine.jdbc.spi.JdbcResourceRegistry;
|
||||||
import org.hibernate.engine.jdbc.spi.JdbcServices;
|
import org.hibernate.engine.jdbc.spi.JdbcServices;
|
||||||
import org.hibernate.engine.jdbc.spi.LogicalConnectionImplementor;
|
import org.hibernate.engine.jdbc.spi.LogicalConnectionImplementor;
|
||||||
import org.hibernate.engine.jdbc.spi.NonDurableConnectionObserver;
|
import org.hibernate.engine.jdbc.spi.NonDurableConnectionObserver;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -48,7 +49,7 @@ public class ConnectionProxyHandler
|
||||||
extends AbstractProxyHandler
|
extends AbstractProxyHandler
|
||||||
implements InvocationHandler, NonDurableConnectionObserver {
|
implements InvocationHandler, NonDurableConnectionObserver {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
|
||||||
ConnectionProxyHandler.class.getName());
|
ConnectionProxyHandler.class.getName());
|
||||||
|
|
||||||
private LogicalConnectionImplementor logicalConnection;
|
private LogicalConnectionImplementor logicalConnection;
|
||||||
|
|
|
@ -26,7 +26,9 @@ import java.lang.reflect.Method;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.Statement;
|
import java.sql.Statement;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -36,7 +38,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class PreparedStatementProxyHandler extends AbstractStatementProxyHandler {
|
public class PreparedStatementProxyHandler extends AbstractStatementProxyHandler {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
|
||||||
PreparedStatementProxyHandler.class.getName());
|
PreparedStatementProxyHandler.class.getName());
|
||||||
|
|
||||||
private final String sql;
|
private final String sql;
|
||||||
|
|
|
@ -28,7 +28,7 @@ import java.sql.SQLException;
|
||||||
import java.sql.SQLWarning;
|
import java.sql.SQLWarning;
|
||||||
import java.sql.Statement;
|
import java.sql.Statement;
|
||||||
|
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.JDBCException;
|
import org.hibernate.JDBCException;
|
||||||
import org.hibernate.exception.SQLExceptionConverter;
|
import org.hibernate.exception.SQLExceptionConverter;
|
||||||
import org.hibernate.exception.SQLStateConverter;
|
import org.hibernate.exception.SQLStateConverter;
|
||||||
|
@ -44,7 +44,7 @@ import org.jboss.logging.Logger.Level;
|
||||||
*/
|
*/
|
||||||
public class SqlExceptionHelper {
|
public class SqlExceptionHelper {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, SqlExceptionHelper.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, SqlExceptionHelper.class.getName());
|
||||||
|
|
||||||
public static final String DEFAULT_EXCEPTION_MSG = "SQL Exception";
|
public static final String DEFAULT_EXCEPTION_MSG = "SQL Exception";
|
||||||
public static final String DEFAULT_WARNING_MSG = "SQL Warning";
|
public static final String DEFAULT_WARNING_MSG = "SQL Warning";
|
||||||
|
|
|
@ -23,9 +23,10 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.engine.jdbc.spi;
|
package org.hibernate.engine.jdbc.spi;
|
||||||
|
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.engine.jdbc.internal.FormatStyle;
|
import org.hibernate.engine.jdbc.internal.FormatStyle;
|
||||||
import org.hibernate.engine.jdbc.internal.Formatter;
|
import org.hibernate.engine.jdbc.internal.Formatter;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -35,7 +36,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class SqlStatementLogger {
|
public class SqlStatementLogger {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, SqlStatementLogger.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, SqlStatementLogger.class.getName());
|
||||||
|
|
||||||
private boolean logToStdout;
|
private boolean logToStdout;
|
||||||
private boolean format;
|
private boolean format;
|
||||||
|
|
|
@ -36,7 +36,7 @@ import org.jboss.logging.Logger;
|
||||||
import org.hibernate.CacheMode;
|
import org.hibernate.CacheMode;
|
||||||
import org.hibernate.EntityMode;
|
import org.hibernate.EntityMode;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.cache.CacheKey;
|
import org.hibernate.cache.CacheKey;
|
||||||
import org.hibernate.cache.entry.CollectionCacheEntry;
|
import org.hibernate.cache.entry.CollectionCacheEntry;
|
||||||
import org.hibernate.collection.PersistentCollection;
|
import org.hibernate.collection.PersistentCollection;
|
||||||
|
@ -60,7 +60,7 @@ import org.hibernate.pretty.MessageHelper;
|
||||||
*/
|
*/
|
||||||
public class CollectionLoadContext {
|
public class CollectionLoadContext {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, CollectionLoadContext.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, CollectionLoadContext.class.getName());
|
||||||
|
|
||||||
private final LoadContexts loadContexts;
|
private final LoadContexts loadContexts;
|
||||||
private final ResultSet resultSet;
|
private final ResultSet resultSet;
|
||||||
|
|
|
@ -1,60 +1,62 @@
|
||||||
/*
|
/*
|
||||||
* Hibernate, Relational Persistence for Idiomatic Java
|
* Hibernate, Relational Persistence for Idiomatic Java
|
||||||
*
|
*
|
||||||
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
|
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
|
||||||
* indicated by the @author tags or express copyright attribution
|
* indicated by the @author tags or express copyright attribution
|
||||||
* statements applied by the authors. All third-party contributions are
|
* statements applied by the authors. All third-party contributions are
|
||||||
* distributed under license by Red Hat Middleware LLC.
|
* distributed under license by Red Hat Middleware LLC.
|
||||||
*
|
*
|
||||||
* This copyrighted material is made available to anyone wishing to use, modify,
|
* 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
|
* copy, or redistribute it subject to the terms and conditions of the GNU
|
||||||
* Lesser General Public License, as published by the Free Software Foundation.
|
* Lesser General Public License, as published by the Free Software Foundation.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
||||||
* for more details.
|
* for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
* along with this distribution; if not, write to:
|
* along with this distribution; if not, write to:
|
||||||
* Free Software Foundation, Inc.
|
* Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor
|
* 51 Franklin Street, Fifth Floor
|
||||||
* Boston, MA 02110-1301 USA
|
* Boston, MA 02110-1301 USA
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.hibernate.engine.loading;
|
package org.hibernate.engine.loading;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
import org.jboss.logging.Logger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
|
|
||||||
/**
|
import org.jboss.logging.Logger;
|
||||||
* {@inheritDoc}
|
|
||||||
*
|
/**
|
||||||
* @author Steve Ebersole
|
* {@inheritDoc}
|
||||||
*/
|
*
|
||||||
public class EntityLoadContext {
|
* @author Steve Ebersole
|
||||||
|
*/
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, EntityLoadContext.class.getName());
|
public class EntityLoadContext {
|
||||||
|
|
||||||
private final LoadContexts loadContexts;
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, EntityLoadContext.class.getName());
|
||||||
private final ResultSet resultSet;
|
|
||||||
private final List hydratingEntities = new ArrayList( 20 ); // todo : need map? the prob is a proper key, right?
|
private final LoadContexts loadContexts;
|
||||||
|
private final ResultSet resultSet;
|
||||||
public EntityLoadContext(LoadContexts loadContexts, ResultSet resultSet) {
|
private final List hydratingEntities = new ArrayList( 20 ); // todo : need map? the prob is a proper key, right?
|
||||||
this.loadContexts = loadContexts;
|
|
||||||
this.resultSet = resultSet;
|
public EntityLoadContext(LoadContexts loadContexts, ResultSet resultSet) {
|
||||||
}
|
this.loadContexts = loadContexts;
|
||||||
|
this.resultSet = resultSet;
|
||||||
void cleanup() {
|
}
|
||||||
if (!hydratingEntities.isEmpty()) LOG.hydratingEntitiesCount(hydratingEntities.size());
|
|
||||||
hydratingEntities.clear();
|
void cleanup() {
|
||||||
}
|
if (!hydratingEntities.isEmpty()) LOG.hydratingEntitiesCount(hydratingEntities.size());
|
||||||
|
hydratingEntities.clear();
|
||||||
|
}
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return super.toString() + "<rs=" + resultSet + ">";
|
@Override
|
||||||
}
|
public String toString() {
|
||||||
}
|
return super.toString() + "<rs=" + resultSet + ">";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,309 +1,310 @@
|
||||||
/*
|
/*
|
||||||
* Hibernate, Relational Persistence for Idiomatic Java
|
* Hibernate, Relational Persistence for Idiomatic Java
|
||||||
*
|
*
|
||||||
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
|
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
|
||||||
* indicated by the @author tags or express copyright attribution
|
* indicated by the @author tags or express copyright attribution
|
||||||
* statements applied by the authors. All third-party contributions are
|
* statements applied by the authors. All third-party contributions are
|
||||||
* distributed under license by Red Hat Middleware LLC.
|
* distributed under license by Red Hat Middleware LLC.
|
||||||
*
|
*
|
||||||
* This copyrighted material is made available to anyone wishing to use, modify,
|
* 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
|
* copy, or redistribute it subject to the terms and conditions of the GNU
|
||||||
* Lesser General Public License, as published by the Free Software Foundation.
|
* Lesser General Public License, as published by the Free Software Foundation.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
||||||
* for more details.
|
* for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
* along with this distribution; if not, write to:
|
* along with this distribution; if not, write to:
|
||||||
* Free Software Foundation, Inc.
|
* Free Software Foundation, Inc.
|
||||||
* 51 Franklin Street, Fifth Floor
|
* 51 Franklin Street, Fifth Floor
|
||||||
* Boston, MA 02110-1301 USA
|
* Boston, MA 02110-1301 USA
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package org.hibernate.engine.loading;
|
package org.hibernate.engine.loading;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import org.hibernate.EntityMode;
|
import org.hibernate.EntityMode;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.collection.PersistentCollection;
|
import org.hibernate.collection.PersistentCollection;
|
||||||
import org.hibernate.engine.CollectionKey;
|
import org.hibernate.engine.CollectionKey;
|
||||||
import org.hibernate.engine.PersistenceContext;
|
import org.hibernate.engine.PersistenceContext;
|
||||||
import org.hibernate.engine.SessionImplementor;
|
import org.hibernate.engine.SessionImplementor;
|
||||||
import org.hibernate.internal.util.collections.IdentityMap;
|
import org.hibernate.internal.util.collections.IdentityMap;
|
||||||
import org.hibernate.persister.collection.CollectionPersister;
|
import org.hibernate.persister.collection.CollectionPersister;
|
||||||
import org.hibernate.pretty.MessageHelper;
|
import org.hibernate.pretty.MessageHelper;
|
||||||
import org.jboss.logging.Logger;
|
|
||||||
|
import org.jboss.logging.Logger;
|
||||||
/**
|
|
||||||
* Maps {@link ResultSet result-sets} to specific contextual data
|
/**
|
||||||
* related to processing that {@link ResultSet result-sets}.
|
* Maps {@link ResultSet result-sets} to specific contextual data
|
||||||
* <p/>
|
* related to processing that {@link ResultSet result-sets}.
|
||||||
* Implementation note: internally an {@link IdentityMap} is used to maintain
|
* <p/>
|
||||||
* the mappings; {@link IdentityMap} was chosen because I'd rather not be
|
* Implementation note: internally an {@link IdentityMap} is used to maintain
|
||||||
* dependent upon potentially bad {@link ResultSet#equals} and {ResultSet#hashCode}
|
* the mappings; {@link IdentityMap} was chosen because I'd rather not be
|
||||||
* implementations.
|
* dependent upon potentially bad {@link ResultSet#equals} and {ResultSet#hashCode}
|
||||||
* <p/>
|
* implementations.
|
||||||
* Considering the JDBC-redesign work, would further like this contextual info
|
* <p/>
|
||||||
* not mapped seperately, but available based on the result set being processed.
|
* Considering the JDBC-redesign work, would further like this contextual info
|
||||||
* This would also allow maintaining a single mapping as we could reliably get
|
* not mapped seperately, but available based on the result set being processed.
|
||||||
* notification of the result-set closing...
|
* This would also allow maintaining a single mapping as we could reliably get
|
||||||
*
|
* notification of the result-set closing...
|
||||||
* @author Steve Ebersole
|
*
|
||||||
*/
|
* @author Steve Ebersole
|
||||||
public class LoadContexts {
|
*/
|
||||||
|
public class LoadContexts {
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, LoadContexts.class.getName());
|
|
||||||
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, LoadContexts.class.getName());
|
||||||
private final PersistenceContext persistenceContext;
|
|
||||||
private Map collectionLoadContexts;
|
private final PersistenceContext persistenceContext;
|
||||||
private Map entityLoadContexts;
|
private Map collectionLoadContexts;
|
||||||
|
private Map entityLoadContexts;
|
||||||
private Map xrefLoadingCollectionEntries;
|
|
||||||
|
private Map xrefLoadingCollectionEntries;
|
||||||
/**
|
|
||||||
* Creates and binds this to the given persistence context.
|
/**
|
||||||
*
|
* Creates and binds this to the given persistence context.
|
||||||
* @param persistenceContext The persistence context to which this
|
*
|
||||||
* will be bound.
|
* @param persistenceContext The persistence context to which this
|
||||||
*/
|
* will be bound.
|
||||||
public LoadContexts(PersistenceContext persistenceContext) {
|
*/
|
||||||
this.persistenceContext = persistenceContext;
|
public LoadContexts(PersistenceContext persistenceContext) {
|
||||||
}
|
this.persistenceContext = persistenceContext;
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Retrieves the persistence context to which this is bound.
|
/**
|
||||||
*
|
* Retrieves the persistence context to which this is bound.
|
||||||
* @return The persistence context to which this is bound.
|
*
|
||||||
*/
|
* @return The persistence context to which this is bound.
|
||||||
public PersistenceContext getPersistenceContext() {
|
*/
|
||||||
return persistenceContext;
|
public PersistenceContext getPersistenceContext() {
|
||||||
}
|
return persistenceContext;
|
||||||
|
}
|
||||||
private SessionImplementor getSession() {
|
|
||||||
return getPersistenceContext().getSession();
|
private SessionImplementor getSession() {
|
||||||
}
|
return getPersistenceContext().getSession();
|
||||||
|
}
|
||||||
private EntityMode getEntityMode() {
|
|
||||||
return getSession().getEntityMode();
|
private EntityMode getEntityMode() {
|
||||||
}
|
return getSession().getEntityMode();
|
||||||
|
}
|
||||||
|
|
||||||
// cleanup code ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
// cleanup code ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
/**
|
|
||||||
* Release internal state associated with the given result set.
|
/**
|
||||||
* <p/>
|
* Release internal state associated with the given result set.
|
||||||
* This should be called when we are done with processing said result set,
|
* <p/>
|
||||||
* ideally as the result set is being closed.
|
* This should be called when we are done with processing said result set,
|
||||||
*
|
* ideally as the result set is being closed.
|
||||||
* @param resultSet The result set for which it is ok to release
|
*
|
||||||
* associated resources.
|
* @param resultSet The result set for which it is ok to release
|
||||||
*/
|
* associated resources.
|
||||||
public void cleanup(ResultSet resultSet) {
|
*/
|
||||||
if ( collectionLoadContexts != null ) {
|
public void cleanup(ResultSet resultSet) {
|
||||||
CollectionLoadContext collectionLoadContext = ( CollectionLoadContext ) collectionLoadContexts.remove( resultSet );
|
if ( collectionLoadContexts != null ) {
|
||||||
collectionLoadContext.cleanup();
|
CollectionLoadContext collectionLoadContext = ( CollectionLoadContext ) collectionLoadContexts.remove( resultSet );
|
||||||
}
|
collectionLoadContext.cleanup();
|
||||||
if ( entityLoadContexts != null ) {
|
}
|
||||||
EntityLoadContext entityLoadContext = ( EntityLoadContext ) entityLoadContexts.remove( resultSet );
|
if ( entityLoadContexts != null ) {
|
||||||
entityLoadContext.cleanup();
|
EntityLoadContext entityLoadContext = ( EntityLoadContext ) entityLoadContexts.remove( resultSet );
|
||||||
}
|
entityLoadContext.cleanup();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Release internal state associated with *all* result sets.
|
/**
|
||||||
* <p/>
|
* Release internal state associated with *all* result sets.
|
||||||
* This is intended as a "failsafe" process to make sure we get everything
|
* <p/>
|
||||||
* cleaned up and released.
|
* This is intended as a "failsafe" process to make sure we get everything
|
||||||
*/
|
* cleaned up and released.
|
||||||
public void cleanup() {
|
*/
|
||||||
if ( collectionLoadContexts != null ) {
|
public void cleanup() {
|
||||||
Iterator itr = collectionLoadContexts.values().iterator();
|
if ( collectionLoadContexts != null ) {
|
||||||
while ( itr.hasNext() ) {
|
Iterator itr = collectionLoadContexts.values().iterator();
|
||||||
CollectionLoadContext collectionLoadContext = ( CollectionLoadContext ) itr.next();
|
while ( itr.hasNext() ) {
|
||||||
LOG.failSafeCollectionsCleanup(collectionLoadContext);
|
CollectionLoadContext collectionLoadContext = ( CollectionLoadContext ) itr.next();
|
||||||
collectionLoadContext.cleanup();
|
LOG.failSafeCollectionsCleanup(collectionLoadContext);
|
||||||
}
|
collectionLoadContext.cleanup();
|
||||||
collectionLoadContexts.clear();
|
}
|
||||||
}
|
collectionLoadContexts.clear();
|
||||||
if ( entityLoadContexts != null ) {
|
}
|
||||||
Iterator itr = entityLoadContexts.values().iterator();
|
if ( entityLoadContexts != null ) {
|
||||||
while ( itr.hasNext() ) {
|
Iterator itr = entityLoadContexts.values().iterator();
|
||||||
EntityLoadContext entityLoadContext = ( EntityLoadContext ) itr.next();
|
while ( itr.hasNext() ) {
|
||||||
LOG.failSafeEntitiesCleanup(entityLoadContext);
|
EntityLoadContext entityLoadContext = ( EntityLoadContext ) itr.next();
|
||||||
entityLoadContext.cleanup();
|
LOG.failSafeEntitiesCleanup(entityLoadContext);
|
||||||
}
|
entityLoadContext.cleanup();
|
||||||
entityLoadContexts.clear();
|
}
|
||||||
}
|
entityLoadContexts.clear();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Collection load contexts ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
// Collection load contexts ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
/**
|
|
||||||
* Do we currently have any internal entries corresponding to loading
|
/**
|
||||||
* collections?
|
* Do we currently have any internal entries corresponding to loading
|
||||||
*
|
* collections?
|
||||||
* @return True if we currently hold state pertaining to loading collections;
|
*
|
||||||
* false otherwise.
|
* @return True if we currently hold state pertaining to loading collections;
|
||||||
*/
|
* false otherwise.
|
||||||
public boolean hasLoadingCollectionEntries() {
|
*/
|
||||||
return ( collectionLoadContexts != null && !collectionLoadContexts.isEmpty() );
|
public boolean hasLoadingCollectionEntries() {
|
||||||
}
|
return ( collectionLoadContexts != null && !collectionLoadContexts.isEmpty() );
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Do we currently have any registered internal entries corresponding to loading
|
/**
|
||||||
* collections?
|
* Do we currently have any registered internal entries corresponding to loading
|
||||||
*
|
* collections?
|
||||||
* @return True if we currently hold state pertaining to a registered loading collections;
|
*
|
||||||
* false otherwise.
|
* @return True if we currently hold state pertaining to a registered loading collections;
|
||||||
*/
|
* false otherwise.
|
||||||
public boolean hasRegisteredLoadingCollectionEntries() {
|
*/
|
||||||
return ( xrefLoadingCollectionEntries != null && !xrefLoadingCollectionEntries.isEmpty() );
|
public boolean hasRegisteredLoadingCollectionEntries() {
|
||||||
}
|
return ( xrefLoadingCollectionEntries != null && !xrefLoadingCollectionEntries.isEmpty() );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the {@link CollectionLoadContext} associated with the given
|
/**
|
||||||
* {@link ResultSet}, creating one if needed.
|
* Get the {@link CollectionLoadContext} associated with the given
|
||||||
*
|
* {@link ResultSet}, creating one if needed.
|
||||||
* @param resultSet The result set for which to retrieve the context.
|
*
|
||||||
* @return The processing context.
|
* @param resultSet The result set for which to retrieve the context.
|
||||||
*/
|
* @return The processing context.
|
||||||
public CollectionLoadContext getCollectionLoadContext(ResultSet resultSet) {
|
*/
|
||||||
CollectionLoadContext context = null;
|
public CollectionLoadContext getCollectionLoadContext(ResultSet resultSet) {
|
||||||
if (collectionLoadContexts == null) collectionLoadContexts = IdentityMap.instantiate(8);
|
CollectionLoadContext context = null;
|
||||||
else context = (CollectionLoadContext)collectionLoadContexts.get(resultSet);
|
if (collectionLoadContexts == null) collectionLoadContexts = IdentityMap.instantiate(8);
|
||||||
if ( context == null ) {
|
else context = (CollectionLoadContext)collectionLoadContexts.get(resultSet);
|
||||||
LOG.trace("Constructing collection load context for result set [" + resultSet + "]");
|
if ( context == null ) {
|
||||||
context = new CollectionLoadContext( this, resultSet );
|
LOG.trace("Constructing collection load context for result set [" + resultSet + "]");
|
||||||
collectionLoadContexts.put( resultSet, context );
|
context = new CollectionLoadContext( this, resultSet );
|
||||||
}
|
collectionLoadContexts.put( resultSet, context );
|
||||||
return context;
|
}
|
||||||
}
|
return context;
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Attempt to locate the loading collection given the owner's key. The lookup here
|
/**
|
||||||
* occurs against all result-set contexts...
|
* Attempt to locate the loading collection given the owner's key. The lookup here
|
||||||
*
|
* occurs against all result-set contexts...
|
||||||
* @param persister The collection persister
|
*
|
||||||
* @param ownerKey The owner key
|
* @param persister The collection persister
|
||||||
* @return The loading collection, or null if not found.
|
* @param ownerKey The owner key
|
||||||
*/
|
* @return The loading collection, or null if not found.
|
||||||
public PersistentCollection locateLoadingCollection(CollectionPersister persister, Serializable ownerKey) {
|
*/
|
||||||
LoadingCollectionEntry lce = locateLoadingCollectionEntry( new CollectionKey( persister, ownerKey, getEntityMode() ) );
|
public PersistentCollection locateLoadingCollection(CollectionPersister persister, Serializable ownerKey) {
|
||||||
if ( lce != null ) {
|
LoadingCollectionEntry lce = locateLoadingCollectionEntry( new CollectionKey( persister, ownerKey, getEntityMode() ) );
|
||||||
if (LOG.isTraceEnabled()) LOG.trace("Returning loading collection: "
|
if ( lce != null ) {
|
||||||
+ MessageHelper.collectionInfoString(persister, ownerKey, getSession().getFactory()));
|
if (LOG.isTraceEnabled()) LOG.trace("Returning loading collection: "
|
||||||
return lce.getCollection();
|
+ MessageHelper.collectionInfoString(persister, ownerKey, getSession().getFactory()));
|
||||||
}
|
return lce.getCollection();
|
||||||
// TODO : should really move this log statement to CollectionType, where this is used from...
|
}
|
||||||
if (LOG.isTraceEnabled()) LOG.trace("Creating collection wrapper: "
|
// TODO : should really move this log statement to CollectionType, where this is used from...
|
||||||
+ MessageHelper.collectionInfoString(persister, ownerKey, getSession().getFactory()));
|
if (LOG.isTraceEnabled()) LOG.trace("Creating collection wrapper: "
|
||||||
return null;
|
+ MessageHelper.collectionInfoString(persister, ownerKey, getSession().getFactory()));
|
||||||
}
|
return null;
|
||||||
|
}
|
||||||
// loading collection xrefs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
// loading collection xrefs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
/**
|
|
||||||
* Register a loading collection xref.
|
/**
|
||||||
* <p/>
|
* Register a loading collection xref.
|
||||||
* This xref map is used because sometimes a collection is in process of
|
* <p/>
|
||||||
* being loaded from one result set, but needs to be accessed from the
|
* This xref map is used because sometimes a collection is in process of
|
||||||
* context of another "nested" result set processing.
|
* being loaded from one result set, but needs to be accessed from the
|
||||||
* <p/>
|
* context of another "nested" result set processing.
|
||||||
* Implementation note: package protected, as this is meant solely for use
|
* <p/>
|
||||||
* by {@link CollectionLoadContext} to be able to locate collections
|
* Implementation note: package protected, as this is meant solely for use
|
||||||
* being loaded by other {@link CollectionLoadContext}s/{@link ResultSet}s.
|
* by {@link CollectionLoadContext} to be able to locate collections
|
||||||
*
|
* being loaded by other {@link CollectionLoadContext}s/{@link ResultSet}s.
|
||||||
* @param entryKey The xref collection key
|
*
|
||||||
* @param entry The corresponding loading collection entry
|
* @param entryKey The xref collection key
|
||||||
*/
|
* @param entry The corresponding loading collection entry
|
||||||
void registerLoadingCollectionXRef(CollectionKey entryKey, LoadingCollectionEntry entry) {
|
*/
|
||||||
if ( xrefLoadingCollectionEntries == null ) {
|
void registerLoadingCollectionXRef(CollectionKey entryKey, LoadingCollectionEntry entry) {
|
||||||
xrefLoadingCollectionEntries = new HashMap();
|
if ( xrefLoadingCollectionEntries == null ) {
|
||||||
}
|
xrefLoadingCollectionEntries = new HashMap();
|
||||||
xrefLoadingCollectionEntries.put( entryKey, entry );
|
}
|
||||||
}
|
xrefLoadingCollectionEntries.put( entryKey, entry );
|
||||||
|
}
|
||||||
/**
|
|
||||||
* The inverse of {@link #registerLoadingCollectionXRef}. Here, we are done
|
/**
|
||||||
* processing the said collection entry, so we remove it from the
|
* The inverse of {@link #registerLoadingCollectionXRef}. Here, we are done
|
||||||
* load context.
|
* processing the said collection entry, so we remove it from the
|
||||||
* <p/>
|
* load context.
|
||||||
* The idea here is that other loading collections can now reference said
|
* <p/>
|
||||||
* collection directly from the {@link PersistenceContext} because it
|
* The idea here is that other loading collections can now reference said
|
||||||
* has completed its load cycle.
|
* collection directly from the {@link PersistenceContext} because it
|
||||||
* <p/>
|
* has completed its load cycle.
|
||||||
* Implementation note: package protected, as this is meant solely for use
|
* <p/>
|
||||||
* by {@link CollectionLoadContext} to be able to locate collections
|
* Implementation note: package protected, as this is meant solely for use
|
||||||
* being loaded by other {@link CollectionLoadContext}s/{@link ResultSet}s.
|
* by {@link CollectionLoadContext} to be able to locate collections
|
||||||
*
|
* being loaded by other {@link CollectionLoadContext}s/{@link ResultSet}s.
|
||||||
* @param key The key of the collection we are done processing.
|
*
|
||||||
*/
|
* @param key The key of the collection we are done processing.
|
||||||
void unregisterLoadingCollectionXRef(CollectionKey key) {
|
*/
|
||||||
if ( !hasRegisteredLoadingCollectionEntries() ) {
|
void unregisterLoadingCollectionXRef(CollectionKey key) {
|
||||||
return;
|
if ( !hasRegisteredLoadingCollectionEntries() ) {
|
||||||
}
|
return;
|
||||||
xrefLoadingCollectionEntries.remove(key);
|
}
|
||||||
}
|
xrefLoadingCollectionEntries.remove(key);
|
||||||
|
}
|
||||||
/*package*/Map getLoadingCollectionXRefs() {
|
|
||||||
return xrefLoadingCollectionEntries;
|
/*package*/Map getLoadingCollectionXRefs() {
|
||||||
}
|
return xrefLoadingCollectionEntries;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Locate the LoadingCollectionEntry within *any* of the tracked
|
/**
|
||||||
* {@link CollectionLoadContext}s.
|
* Locate the LoadingCollectionEntry within *any* of the tracked
|
||||||
* <p/>
|
* {@link CollectionLoadContext}s.
|
||||||
* Implementation note: package protected, as this is meant solely for use
|
* <p/>
|
||||||
* by {@link CollectionLoadContext} to be able to locate collections
|
* Implementation note: package protected, as this is meant solely for use
|
||||||
* being loaded by other {@link CollectionLoadContext}s/{@link ResultSet}s.
|
* by {@link CollectionLoadContext} to be able to locate collections
|
||||||
*
|
* being loaded by other {@link CollectionLoadContext}s/{@link ResultSet}s.
|
||||||
* @param key The collection key.
|
*
|
||||||
* @return The located entry; or null.
|
* @param key The collection key.
|
||||||
*/
|
* @return The located entry; or null.
|
||||||
LoadingCollectionEntry locateLoadingCollectionEntry(CollectionKey key) {
|
*/
|
||||||
if (xrefLoadingCollectionEntries == null) return null;
|
LoadingCollectionEntry locateLoadingCollectionEntry(CollectionKey key) {
|
||||||
LOG.trace("Attempting to locate loading collection entry [" + key + "] in any result-set context");
|
if (xrefLoadingCollectionEntries == null) return null;
|
||||||
LoadingCollectionEntry rtn = ( LoadingCollectionEntry ) xrefLoadingCollectionEntries.get( key );
|
LOG.trace("Attempting to locate loading collection entry [" + key + "] in any result-set context");
|
||||||
if (rtn == null) LOG.trace("Collection [" + key + "] not located in load context");
|
LoadingCollectionEntry rtn = ( LoadingCollectionEntry ) xrefLoadingCollectionEntries.get( key );
|
||||||
else LOG.trace("Collection [" + key + "] located in load context");
|
if (rtn == null) LOG.trace("Collection [" + key + "] not located in load context");
|
||||||
return rtn;
|
else LOG.trace("Collection [" + key + "] located in load context");
|
||||||
}
|
return rtn;
|
||||||
|
}
|
||||||
/*package*/void cleanupCollectionXRefs(Set entryKeys) {
|
|
||||||
Iterator itr = entryKeys.iterator();
|
/*package*/void cleanupCollectionXRefs(Set entryKeys) {
|
||||||
while ( itr.hasNext() ) {
|
Iterator itr = entryKeys.iterator();
|
||||||
final CollectionKey entryKey = ( CollectionKey ) itr.next();
|
while ( itr.hasNext() ) {
|
||||||
xrefLoadingCollectionEntries.remove( entryKey );
|
final CollectionKey entryKey = ( CollectionKey ) itr.next();
|
||||||
}
|
xrefLoadingCollectionEntries.remove( entryKey );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Entity load contexts ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// * currently, not yet used...
|
// Entity load contexts ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// * currently, not yet used...
|
||||||
public EntityLoadContext getEntityLoadContext(ResultSet resultSet) {
|
|
||||||
EntityLoadContext context = null;
|
public EntityLoadContext getEntityLoadContext(ResultSet resultSet) {
|
||||||
if ( entityLoadContexts == null ) {
|
EntityLoadContext context = null;
|
||||||
entityLoadContexts = IdentityMap.instantiate( 8 );
|
if ( entityLoadContexts == null ) {
|
||||||
}
|
entityLoadContexts = IdentityMap.instantiate( 8 );
|
||||||
else {
|
}
|
||||||
context = ( EntityLoadContext ) entityLoadContexts.get( resultSet );
|
else {
|
||||||
}
|
context = ( EntityLoadContext ) entityLoadContexts.get( resultSet );
|
||||||
if ( context == null ) {
|
}
|
||||||
context = new EntityLoadContext( this, resultSet );
|
if ( context == null ) {
|
||||||
entityLoadContexts.put( resultSet, context );
|
context = new EntityLoadContext( this, resultSet );
|
||||||
}
|
entityLoadContexts.put( resultSet, context );
|
||||||
return context;
|
}
|
||||||
}
|
return context;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
package org.hibernate.engine.profile;
|
package org.hibernate.engine.profile;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.engine.SessionFactoryImplementor;
|
import org.hibernate.engine.SessionFactoryImplementor;
|
||||||
import org.hibernate.type.BagType;
|
import org.hibernate.type.BagType;
|
||||||
import org.hibernate.type.Type;
|
import org.hibernate.type.Type;
|
||||||
|
@ -40,7 +40,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class FetchProfile {
|
public class FetchProfile {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, FetchProfile.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, FetchProfile.class.getName());
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
private Map<String,Fetch> fetches = new HashMap<String,Fetch>();
|
private Map<String,Fetch> fetches = new HashMap<String,Fetch>();
|
||||||
|
|
|
@ -35,7 +35,7 @@ import java.util.Set;
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.QueryException;
|
import org.hibernate.QueryException;
|
||||||
import org.hibernate.ScrollableResults;
|
import org.hibernate.ScrollableResults;
|
||||||
import org.hibernate.engine.QueryParameters;
|
import org.hibernate.engine.QueryParameters;
|
||||||
|
@ -62,7 +62,7 @@ public class HQLQueryPlan implements Serializable {
|
||||||
|
|
||||||
// TODO : keep separate notions of QT[] here for shallow/non-shallow queries...
|
// TODO : keep separate notions of QT[] here for shallow/non-shallow queries...
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, HQLQueryPlan.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, HQLQueryPlan.class.getName());
|
||||||
|
|
||||||
private final String sourceQuery;
|
private final String sourceQuery;
|
||||||
private final QueryTranslator[] translators;
|
private final QueryTranslator[] translators;
|
||||||
|
|
|
@ -31,7 +31,7 @@ import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.QueryException;
|
import org.hibernate.QueryException;
|
||||||
import org.hibernate.action.internal.BulkOperationCleanupAction;
|
import org.hibernate.action.internal.BulkOperationCleanupAction;
|
||||||
import org.hibernate.engine.QueryParameters;
|
import org.hibernate.engine.QueryParameters;
|
||||||
|
@ -55,7 +55,7 @@ public class NativeSQLQueryPlan implements Serializable {
|
||||||
|
|
||||||
private final SQLCustomQuery customQuery;
|
private final SQLCustomQuery customQuery;
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, NativeSQLQueryPlan.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, NativeSQLQueryPlan.class.getName());
|
||||||
|
|
||||||
public NativeSQLQueryPlan(
|
public NativeSQLQueryPlan(
|
||||||
NativeSQLQuerySpecification specification,
|
NativeSQLQuerySpecification specification,
|
||||||
|
|
|
@ -31,7 +31,8 @@ import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.MappingException;
|
import org.hibernate.MappingException;
|
||||||
import org.hibernate.QueryException;
|
import org.hibernate.QueryException;
|
||||||
import org.hibernate.cfg.Environment;
|
import org.hibernate.cfg.Environment;
|
||||||
|
@ -42,6 +43,7 @@ import org.hibernate.internal.util.collections.CollectionHelper;
|
||||||
import org.hibernate.internal.util.collections.SimpleMRUCache;
|
import org.hibernate.internal.util.collections.SimpleMRUCache;
|
||||||
import org.hibernate.internal.util.collections.SoftLimitMRUCache;
|
import org.hibernate.internal.util.collections.SoftLimitMRUCache;
|
||||||
import org.hibernate.internal.util.config.ConfigurationHelper;
|
import org.hibernate.internal.util.config.ConfigurationHelper;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -54,7 +56,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class QueryPlanCache implements Serializable {
|
public class QueryPlanCache implements Serializable {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, QueryPlanCache.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, QueryPlanCache.class.getName());
|
||||||
|
|
||||||
private SessionFactoryImplementor factory;
|
private SessionFactoryImplementor factory;
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,8 @@ package org.hibernate.engine.transaction.internal;
|
||||||
|
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import javax.transaction.Synchronization;
|
import javax.transaction.Synchronization;
|
||||||
import org.hibernate.HibernateLogger;
|
|
||||||
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.engine.transaction.spi.SynchronizationRegistry;
|
import org.hibernate.engine.transaction.spi.SynchronizationRegistry;
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
|
@ -36,7 +37,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class SynchronizationRegistryImpl implements SynchronizationRegistry {
|
public class SynchronizationRegistryImpl implements SynchronizationRegistry {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
|
||||||
SynchronizationRegistryImpl.class.getName());
|
SynchronizationRegistryImpl.class.getName());
|
||||||
|
|
||||||
private LinkedHashSet<Synchronization> synchronizations;
|
private LinkedHashSet<Synchronization> synchronizations;
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
package org.hibernate.engine.transaction.internal;
|
package org.hibernate.engine.transaction.internal;
|
||||||
|
|
||||||
import org.hibernate.ConnectionReleaseMode;
|
import org.hibernate.ConnectionReleaseMode;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.ResourceClosedException;
|
import org.hibernate.ResourceClosedException;
|
||||||
import org.hibernate.engine.SessionFactoryImplementor;
|
import org.hibernate.engine.SessionFactoryImplementor;
|
||||||
import org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl;
|
import org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl;
|
||||||
|
@ -61,7 +61,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public class TransactionCoordinatorImpl implements TransactionCoordinator {
|
public class TransactionCoordinatorImpl implements TransactionCoordinator {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, TransactionCoordinatorImpl.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, TransactionCoordinatorImpl.class.getName());
|
||||||
|
|
||||||
private final transient TransactionContext transactionContext;
|
private final transient TransactionContext transactionContext;
|
||||||
private final transient JdbcCoordinatorImpl jdbcCoordinator;
|
private final transient JdbcCoordinatorImpl jdbcCoordinator;
|
||||||
|
|
|
@ -28,7 +28,7 @@ import java.util.Map;
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.cfg.Environment;
|
import org.hibernate.cfg.Environment;
|
||||||
import org.hibernate.engine.transaction.internal.jdbc.JdbcTransactionFactory;
|
import org.hibernate.engine.transaction.internal.jdbc.JdbcTransactionFactory;
|
||||||
import org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory;
|
import org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory;
|
||||||
|
@ -45,7 +45,7 @@ import org.hibernate.service.spi.BasicServiceInitiator;
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
public class TransactionFactoryInitiator<T extends TransactionImplementor> implements BasicServiceInitiator<TransactionFactory> {
|
public class TransactionFactoryInitiator<T extends TransactionImplementor> implements BasicServiceInitiator<TransactionFactory> {
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class,
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
|
||||||
TransactionFactoryInitiator.class.getName());
|
TransactionFactoryInitiator.class.getName());
|
||||||
|
|
||||||
public static final TransactionFactoryInitiator INSTANCE = new TransactionFactoryInitiator();
|
public static final TransactionFactoryInitiator INSTANCE = new TransactionFactoryInitiator();
|
||||||
|
|
|
@ -26,13 +26,14 @@ package org.hibernate.engine.transaction.internal.jdbc;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.HibernateLogger;
|
import org.hibernate.internal.CoreMessageLogger;
|
||||||
import org.hibernate.engine.jdbc.spi.SqlExceptionHelper;
|
import org.hibernate.engine.jdbc.spi.SqlExceptionHelper;
|
||||||
import org.hibernate.engine.transaction.spi.IsolationDelegate;
|
import org.hibernate.engine.transaction.spi.IsolationDelegate;
|
||||||
import org.hibernate.engine.transaction.spi.TransactionCoordinator;
|
import org.hibernate.engine.transaction.spi.TransactionCoordinator;
|
||||||
import org.hibernate.jdbc.WorkExecutorVisitable;
|
import org.hibernate.jdbc.WorkExecutorVisitable;
|
||||||
import org.hibernate.jdbc.WorkExecutor;
|
import org.hibernate.jdbc.WorkExecutor;
|
||||||
import org.hibernate.service.jdbc.connections.spi.ConnectionProvider;
|
import org.hibernate.service.jdbc.connections.spi.ConnectionProvider;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -42,7 +43,7 @@ import org.jboss.logging.Logger;
|
||||||
*/
|
*/
|
||||||
public class JdbcIsolationDelegate implements IsolationDelegate {
|
public class JdbcIsolationDelegate implements IsolationDelegate {
|
||||||
|
|
||||||
private static final HibernateLogger LOG = Logger.getMessageLogger(HibernateLogger.class, JdbcIsolationDelegate.class.getName());
|
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, JdbcIsolationDelegate.class.getName());
|
||||||
|
|
||||||
private final TransactionCoordinator transactionCoordinator;
|
private final TransactionCoordinator transactionCoordinator;
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue