org.hibernate.boot.model.relational.AuxiliaryDatabaseObject Java Examples

The following examples show how to use org.hibernate.boot.model.relational.AuxiliaryDatabaseObject. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Configuration.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public void addAuxiliaryDatabaseObject(AuxiliaryDatabaseObject object) {
	if ( auxiliaryDatabaseObjectList == null ) {
		auxiliaryDatabaseObjectList = new ArrayList<AuxiliaryDatabaseObject>();
	}
	auxiliaryDatabaseObjectList.add( object );
}
 
Example #2
Source File: DelegatingDialect.java    From keycloak with Apache License 2.0 4 votes vote down vote up
@Override
public Exporter<AuxiliaryDatabaseObject> getAuxiliaryDatabaseObjectExporter() {
    return getInstance().getAuxiliaryDatabaseObjectExporter();
}
 
Example #3
Source File: MetadataBuilderImpl.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public List<AuxiliaryDatabaseObject> getAuxiliaryDatabaseObjectList() {
	return new ArrayList<>( bootstrapContext.getAuxiliaryDatabaseObjectList());
}
 
Example #4
Source File: MetadataBuilderImpl.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public MetadataBuilder applyAuxiliaryDatabaseObject(AuxiliaryDatabaseObject auxiliaryDatabaseObject) {
	this.bootstrapContext.addAuxiliaryDatabaseObject( auxiliaryDatabaseObject );
	return this;
}
 
Example #5
Source File: BootstrapContextImpl.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public void addAuxiliaryDatabaseObject(AuxiliaryDatabaseObject auxiliaryDatabaseObject) {
	if ( this.auxiliaryDatabaseObjectList == null ) {
		this.auxiliaryDatabaseObjectList = new ArrayList<>();
	}
	this.auxiliaryDatabaseObjectList.add( auxiliaryDatabaseObject );
}
 
Example #6
Source File: BootstrapContextImpl.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Collection<AuxiliaryDatabaseObject> getAuxiliaryDatabaseObjectList() {
	return auxiliaryDatabaseObjectList == null ? Collections.emptyList() : auxiliaryDatabaseObjectList;
}
 
Example #7
Source File: InFlightMetadataCollectorImpl.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void addAuxiliaryDatabaseObject(AuxiliaryDatabaseObject auxiliaryDatabaseObject) {
	getDatabase().addAuxiliaryDatabaseObject( auxiliaryDatabaseObject );
}
 
Example #8
Source File: AbstractDelegatingMetadataBuildingOptions.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public List<AuxiliaryDatabaseObject> getAuxiliaryDatabaseObjectList() {
	return delegate.getAuxiliaryDatabaseObjectList();
}
 
Example #9
Source File: AbstractDelegatingMetadataBuilderImplementor.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public MetadataBuilder applyAuxiliaryDatabaseObject(AuxiliaryDatabaseObject auxiliaryDatabaseObject) {
	delegate.applyAuxiliaryDatabaseObject( auxiliaryDatabaseObject );
	return getThis();
}
 
Example #10
Source File: Dialect.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
public Exporter<AuxiliaryDatabaseObject> getAuxiliaryDatabaseObjectExporter() {
	return auxiliaryObjectExporter;
}
 
Example #11
Source File: StandardAuxiliaryDatabaseObjectExporter.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public String[] getSqlDropStrings(AuxiliaryDatabaseObject object, Metadata metadata) {
	return object.sqlDropStrings( dialect );
}
 
Example #12
Source File: StandardAuxiliaryDatabaseObjectExporter.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public String[] getSqlCreateStrings(AuxiliaryDatabaseObject object, Metadata metadata) {
	return object.sqlCreateStrings( dialect );
}
 
Example #13
Source File: Configuration.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Create a {@link SessionFactory} using the properties and mappings in this configuration. The
 * SessionFactory will be immutable, so changes made to this Configuration after building the
 * SessionFactory will not affect it.
 *
 * @param serviceRegistry The registry of services to be used in creating this session factory.
 *
 * @return The built {@link SessionFactory}
 *
 * @throws HibernateException usually indicates an invalid configuration or invalid mapping information
 */
public SessionFactory buildSessionFactory(ServiceRegistry serviceRegistry) throws HibernateException {
	log.debug( "Building session factory using provided StandardServiceRegistry" );
	final MetadataBuilder metadataBuilder = metadataSources.getMetadataBuilder( (StandardServiceRegistry) serviceRegistry );
	if ( implicitNamingStrategy != null ) {
		metadataBuilder.applyImplicitNamingStrategy( implicitNamingStrategy );
	}
	if ( physicalNamingStrategy != null ) {
		metadataBuilder.applyPhysicalNamingStrategy( physicalNamingStrategy );
	}
	if ( sharedCacheMode != null ) {
		metadataBuilder.applySharedCacheMode( sharedCacheMode );
	}
	if ( !typeContributorRegistrations.isEmpty() ) {
		for ( TypeContributor typeContributor : typeContributorRegistrations ) {
			metadataBuilder.applyTypes( typeContributor );
		}
	}
	if ( !basicTypes.isEmpty() ) {
		for ( BasicType basicType : basicTypes ) {
			metadataBuilder.applyBasicType( basicType );
		}
	}
	if ( sqlFunctions != null ) {
		for ( Map.Entry<String, SQLFunction> entry : sqlFunctions.entrySet() ) {
			metadataBuilder.applySqlFunction( entry.getKey(), entry.getValue() );
		}
	}
	if ( auxiliaryDatabaseObjectList != null ) {
		for ( AuxiliaryDatabaseObject auxiliaryDatabaseObject : auxiliaryDatabaseObjectList ) {
			metadataBuilder.applyAuxiliaryDatabaseObject( auxiliaryDatabaseObject );
		}
	}
	if ( attributeConverterDefinitionsByClass != null ) {
		for ( AttributeConverterDefinition attributeConverterDefinition : attributeConverterDefinitionsByClass.values() ) {
			metadataBuilder.applyAttributeConverter( attributeConverterDefinition );
		}
	}

	final Metadata metadata = metadataBuilder.build();

	final SessionFactoryBuilder sessionFactoryBuilder = metadata.getSessionFactoryBuilder();
	if ( interceptor != null && interceptor != EmptyInterceptor.INSTANCE ) {
		sessionFactoryBuilder.applyInterceptor( interceptor );
	}
	if ( getSessionFactoryObserver() != null ) {
		sessionFactoryBuilder.addSessionFactoryObservers( getSessionFactoryObserver() );
	}
	if ( getEntityNotFoundDelegate() != null ) {
		sessionFactoryBuilder.applyEntityNotFoundDelegate( getEntityNotFoundDelegate() );
	}
	if ( getEntityTuplizerFactory() != null ) {
		sessionFactoryBuilder.applyEntityTuplizerFactory( getEntityTuplizerFactory() );
	}
	if ( getCurrentTenantIdentifierResolver() != null ) {
		sessionFactoryBuilder.applyCurrentTenantIdentifierResolver( getCurrentTenantIdentifierResolver() );
	}

	return sessionFactoryBuilder.build();
}
 
Example #14
Source File: InFlightMetadataCollector.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Add metadata pertaining to an auxiliary database object to this repository.
 *
 * @param auxiliaryDatabaseObject The metadata.
 */
void addAuxiliaryDatabaseObject(AuxiliaryDatabaseObject auxiliaryDatabaseObject);
 
Example #15
Source File: MetadataBuildingOptions.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Access to any AuxiliaryDatabaseObject explicitly registered with the MetadataBuilder.  This
 * does not include AuxiliaryDatabaseObject defined in mappings.
 *
 * @return The AuxiliaryDatabaseObject registered through MetadataBuilder
 *
 * @deprecated Use {@link BootstrapContext#getAuxiliaryDatabaseObjectList()} instead.
 */
@Deprecated
List<AuxiliaryDatabaseObject> getAuxiliaryDatabaseObjectList();
 
Example #16
Source File: BootstrapContext.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Access to any AuxiliaryDatabaseObject explicitly registered with the MetadataBuilder.  This
 * does not include AuxiliaryDatabaseObject defined in mappings.
 * <p/>
 * Should never return {@code null}
 *
 * @return The AuxiliaryDatabaseObject registered through MetadataBuilder
 */
Collection<AuxiliaryDatabaseObject> getAuxiliaryDatabaseObjectList();
 
Example #17
Source File: MetadataBuilder.java    From lams with GNU General Public License v2.0 votes vote down vote up
MetadataBuilder applyAuxiliaryDatabaseObject(AuxiliaryDatabaseObject auxiliaryDatabaseObject);