HHH-5916 Expose PersisterClassProvider configuration
This commit is contained in:
parent
b31754d18b
commit
3c3179a081
|
@ -55,6 +55,7 @@ import org.hibernate.mapping.IdGenerator;
|
|||
import org.hibernate.mapping.Join;
|
||||
import org.hibernate.mapping.PersistentClass;
|
||||
import org.hibernate.mapping.Table;
|
||||
import org.hibernate.persister.PersisterClassProvider;
|
||||
import org.hibernate.util.CollectionHelper;
|
||||
|
||||
/**
|
||||
|
@ -267,6 +268,12 @@ public class AnnotationConfiguration extends Configuration {
|
|||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AnnotationConfiguration setPersisterClassProvider(PersisterClassProvider persisterClassProvider) {
|
||||
super.setPersisterClassProvider( persisterClassProvider );
|
||||
return this;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
protected class ExtendedMappingsImpl extends MappingsImpl implements ExtendedMappings {
|
||||
}
|
||||
|
|
|
@ -148,6 +148,7 @@ import org.hibernate.mapping.SimpleValue;
|
|||
import org.hibernate.mapping.Table;
|
||||
import org.hibernate.mapping.TypeDef;
|
||||
import org.hibernate.mapping.UniqueKey;
|
||||
import org.hibernate.persister.PersisterClassProvider;
|
||||
import org.hibernate.proxy.EntityNotFoundDelegate;
|
||||
import org.hibernate.secure.JACCConfiguration;
|
||||
import org.hibernate.tool.hbm2ddl.DatabaseMetadata;
|
||||
|
@ -258,6 +259,7 @@ public class Configuration implements Serializable {
|
|||
|
||||
protected transient XMLHelper xmlHelper;
|
||||
protected NamingStrategy namingStrategy;
|
||||
private PersisterClassProvider persisterClassProvider;
|
||||
private SessionFactoryObserver sessionFactoryObserver;
|
||||
|
||||
private EventListeners eventListeners;
|
||||
|
@ -355,6 +357,7 @@ public class Configuration implements Serializable {
|
|||
propertyRefResolver = new HashMap<String, String>();
|
||||
caches = new ArrayList<CacheHolder>();
|
||||
namingStrategy = EJB3NamingStrategy.INSTANCE;
|
||||
persisterClassProvider = null;
|
||||
setEntityResolver( new EJB3DTDEntityResolver() );
|
||||
anyMetaDefs = new HashMap<String, AnyMetaDef>();
|
||||
propertiesAnnotatedWithMapsId = new HashMap<XClass, Map<String, PropertyData>>();
|
||||
|
@ -2860,6 +2863,26 @@ public class Configuration implements Serializable {
|
|||
return this;
|
||||
}
|
||||
|
||||
public PersisterClassProvider getPersisterClassProvider() {
|
||||
return persisterClassProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines a custom persister class provider.
|
||||
*
|
||||
* The persister class is chosen according to the following rules in decreasing priority:
|
||||
* - the persister class defined explicitly via annotation or XML
|
||||
* - the persister class returned by the PersisterClassProvider implementation (if not null)
|
||||
* - the default provider as chosen by Hibernate Core (best choice most of the time)
|
||||
*
|
||||
*
|
||||
* @param persisterClassProvider implementation
|
||||
*/
|
||||
public Configuration setPersisterClassProvider(PersisterClassProvider persisterClassProvider) {
|
||||
this.persisterClassProvider = persisterClassProvider;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the IdentifierGeneratorFactory in effect for this configuration.
|
||||
*
|
||||
|
@ -3092,6 +3115,14 @@ public class Configuration implements Serializable {
|
|||
Configuration.this.namingStrategy = namingStrategy;
|
||||
}
|
||||
|
||||
public PersisterClassProvider getPersisterClassProvider() {
|
||||
return persisterClassProvider;
|
||||
}
|
||||
|
||||
public void setPersisterClassProvider(PersisterClassProvider persisterClassProvider) {
|
||||
Configuration.this.persisterClassProvider = persisterClassProvider;
|
||||
}
|
||||
|
||||
public TypeResolver getTypeResolver() {
|
||||
return typeResolver;
|
||||
}
|
||||
|
|
|
@ -51,6 +51,7 @@ import org.hibernate.mapping.TypeDef;
|
|||
import org.hibernate.mapping.AuxiliaryDatabaseObject;
|
||||
import org.hibernate.mapping.Column;
|
||||
import org.hibernate.mapping.FetchProfile;
|
||||
import org.hibernate.persister.PersisterClassProvider;
|
||||
import org.hibernate.type.TypeResolver;
|
||||
|
||||
/**
|
||||
|
@ -89,6 +90,16 @@ public interface Mappings {
|
|||
*/
|
||||
public void setNamingStrategy(NamingStrategy namingStrategy);
|
||||
|
||||
/**
|
||||
* Get the current persister class provider implementation
|
||||
*/
|
||||
public PersisterClassProvider getPersisterClassProvider();
|
||||
|
||||
/**
|
||||
* Set the current persister class provider implementation
|
||||
*/
|
||||
public void setPersisterClassProvider(PersisterClassProvider persisterClassProvider);
|
||||
|
||||
/**
|
||||
* Returns the currently bound default schema name.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue