org.hibernate.boot.internal.MetadataBuilderImpl Java Examples
The following examples show how to use
org.hibernate.boot.internal.MetadataBuilderImpl.
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: MetadataSources.java From lams with GNU General Public License v2.0 | 5 votes |
/** * In case a custom {@link MetadataBuilderFactory} creates a custom builder, return that one, otherwise the default * builder. */ private MetadataBuilder getCustomBuilderOrDefault(MetadataBuilderImpl defaultBuilder) { final ClassLoaderService cls = serviceRegistry.getService( ClassLoaderService.class ); final java.util.Collection<MetadataBuilderFactory> discoveredBuilderFactories = cls.loadJavaServices( MetadataBuilderFactory.class ); MetadataBuilder builder = null; List<String> activeFactoryNames = null; for ( MetadataBuilderFactory discoveredBuilderFactory : discoveredBuilderFactories ) { final MetadataBuilder returnedBuilder = discoveredBuilderFactory.getMetadataBuilder( this, defaultBuilder ); if ( returnedBuilder != null ) { if ( activeFactoryNames == null ) { activeFactoryNames = new ArrayList<>(); } activeFactoryNames.add( discoveredBuilderFactory.getClass().getName() ); builder = returnedBuilder; } } if ( activeFactoryNames != null && activeFactoryNames.size() > 1 ) { throw new HibernateException( "Multiple active MetadataBuilder definitions were discovered : " + String.join(", ", activeFactoryNames) ); } return builder != null ? builder : defaultBuilder; }
Example #2
Source File: MetadataSources.java From lams with GNU General Public License v2.0 | 2 votes |
/** * Get a builder for metadata where non-default options can be specified. * * @return The built metadata. */ public MetadataBuilder getMetadataBuilder() { MetadataBuilderImpl defaultBuilder = new MetadataBuilderImpl( this ); return getCustomBuilderOrDefault( defaultBuilder ); }
Example #3
Source File: MetadataSources.java From lams with GNU General Public License v2.0 | 2 votes |
/** * Get a builder for metadata where non-default options can be specified. * * @return The built metadata. * @deprecated Use {@link #getMetadataBuilder()} instead */ @Deprecated public MetadataBuilder getMetadataBuilder(StandardServiceRegistry serviceRegistry) { MetadataBuilderImpl defaultBuilder = new MetadataBuilderImpl( this, serviceRegistry ); return getCustomBuilderOrDefault( defaultBuilder ); }