本文整理汇总了Java中org.hibernate.metamodel.source.MetadataImplementor类的典型用法代码示例。如果您正苦于以下问题:Java MetadataImplementor类的具体用法?Java MetadataImplementor怎么用?Java MetadataImplementor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MetadataImplementor类属于org.hibernate.metamodel.source包,在下文中一共展示了MetadataImplementor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: LocalBindingContextImpl
import org.hibernate.metamodel.source.MetadataImplementor; //导入依赖的package包/类
private LocalBindingContextImpl(MetadataImplementor metadata) {
this.metadata = metadata;
this.localMappingDefaults = new OverriddenMappingDefaults(
metadata.getMappingDefaults(),
hbmJaxbRoot.getRoot().getPackage(),
hbmJaxbRoot.getRoot().getSchema(),
hbmJaxbRoot.getRoot().getCatalog(),
null,
null,
hbmJaxbRoot.getRoot().getDefaultCascade(),
hbmJaxbRoot.getRoot().getDefaultAccess(),
hbmJaxbRoot.getRoot().isDefaultLazy()
);
if ( hbmJaxbRoot.getRoot().getMeta() == null || hbmJaxbRoot.getRoot().getMeta().isEmpty() ) {
this.metaAttributeContext = new MetaAttributeContext( metadata.getGlobalMetaAttributeContext() );
}
else {
this.metaAttributeContext = Helper.extractMetaAttributeContext(
hbmJaxbRoot.getRoot().getMeta(),
true,
metadata.getGlobalMetaAttributeContext()
);
}
}
示例2: bindGenericGenerator
import org.hibernate.metamodel.source.MetadataImplementor; //导入依赖的package包/类
private static void bindGenericGenerator(MetadataImplementor metadata, AnnotationInstance generator) {
String name = JandexHelper.getValue( generator, "name", String.class );
Map<String, String> parameterMap = new HashMap<String, String>();
AnnotationInstance[] parameterAnnotations = JandexHelper.getValue(
generator,
"parameters",
AnnotationInstance[].class
);
for ( AnnotationInstance parameterAnnotation : parameterAnnotations ) {
parameterMap.put(
JandexHelper.getValue( parameterAnnotation, "name", String.class ),
JandexHelper.getValue( parameterAnnotation, "value", String.class )
);
}
metadata.addIdGenerator(
new IdGenerator(
name,
JandexHelper.getValue( generator, "strategy", String.class ),
parameterMap
)
);
LOG.tracef( "Add generic generator with name: %s", name );
}
示例3: bind
import org.hibernate.metamodel.source.MetadataImplementor; //导入依赖的package包/类
private static void bind(MetadataImplementor metadata, AnnotationInstance filterDef) {
String name = JandexHelper.getValue( filterDef, "name", String.class );
Map<String, Type> prms = new HashMap<String, Type>();
for ( AnnotationInstance prm : JandexHelper.getValue( filterDef, "parameters", AnnotationInstance[].class ) ) {
prms.put(
JandexHelper.getValue( prm, "name", String.class ),
metadata.getTypeResolver().heuristicType( JandexHelper.getValue( prm, "type", String.class ) )
);
}
metadata.addFilterDefinition(
new FilterDefinition(
name,
JandexHelper.getValue( filterDef, "defaultCondition", String.class ),
prms
)
);
LOG.debugf( "Binding filter definition: %s", name );
}
示例4: bind
import org.hibernate.metamodel.source.MetadataImplementor; //导入依赖的package包/类
private static void bind(MetadataImplementor metadata, AnnotationInstance fetchProfile) {
String name = JandexHelper.getValue( fetchProfile, "name", String.class );
Set<Fetch> fetches = new HashSet<Fetch>();
AnnotationInstance[] overrideAnnotations = JandexHelper.getValue(
fetchProfile,
"fetchOverrides",
AnnotationInstance[].class
);
for ( AnnotationInstance override : overrideAnnotations ) {
FetchMode fetchMode = JandexHelper.getEnumValue( override, "mode", FetchMode.class );
if ( !fetchMode.equals( org.hibernate.annotations.FetchMode.JOIN ) ) {
throw new MappingException( "Only FetchMode.JOIN is currently supported" );
}
final String entityName = JandexHelper.getValue( override, "entity", String.class );
final String associationName = JandexHelper.getValue( override, "association", String.class );
fetches.add( new Fetch( entityName, associationName, fetchMode.toString().toLowerCase() ) );
}
metadata.addFetchProfile( new FetchProfile( name, fetches ) );
}
示例5: SchemaExport
import org.hibernate.metamodel.source.MetadataImplementor; //导入依赖的package包/类
public SchemaExport(MetadataImplementor metadata) {
ServiceRegistry serviceRegistry = metadata.getServiceRegistry();
this.connectionHelper = new SuppliedConnectionProviderConnectionHelper(
serviceRegistry.getService( ConnectionProvider.class )
);
JdbcServices jdbcServices = serviceRegistry.getService( JdbcServices.class );
this.sqlStatementLogger = jdbcServices.getSqlStatementLogger();
this.formatter = ( sqlStatementLogger.isFormat() ? FormatStyle.DDL : FormatStyle.NONE ).getFormatter();
this.sqlExceptionHelper = jdbcServices.getSqlExceptionHelper();
this.importFiles = ConfigurationHelper.getString(
AvailableSettings.HBM2DDL_IMPORT_FILES,
serviceRegistry.getService( ConfigurationService.class ).getSettings(),
DEFAULT_IMPORT_FILE
);
final Dialect dialect = jdbcServices.getDialect();
this.dropSQL = metadata.getDatabase().generateDropSchemaScript( dialect );
this.createSQL = metadata.getDatabase().generateSchemaCreationScript( dialect );
}
示例6: SessionFactoryServiceRegistryImpl
import org.hibernate.metamodel.source.MetadataImplementor; //导入依赖的package包/类
@SuppressWarnings( {"unchecked"})
public SessionFactoryServiceRegistryImpl(
ServiceRegistryImplementor parent,
SessionFactoryImplementor sessionFactory,
MetadataImplementor metadata) {
super( parent );
this.sessionFactory = sessionFactory;
this.configuration = null;
this.metadata = metadata;
// for now, just use the standard initiator list
for ( SessionFactoryServiceInitiator initiator : StandardSessionFactoryServiceInitiators.LIST ) {
// create the bindings up front to help identify to which registry services belong
createServiceBinding( initiator );
}
}
示例7: bind
import org.hibernate.metamodel.source.MetadataImplementor; //导入依赖的package包/类
private static void bind(MetadataImplementor metadata, AnnotationInstance typeDefAnnotation) {
String name = JandexHelper.getValue( typeDefAnnotation, "name", String.class );
String defaultForType = JandexHelper.getValue( typeDefAnnotation, "defaultForType", String.class );
String typeClass = JandexHelper.getValue( typeDefAnnotation, "typeClass", String.class );
boolean noName = StringHelper.isEmpty( name );
boolean noDefaultForType = defaultForType == null || defaultForType.equals( void.class.getName() );
if ( noName && noDefaultForType ) {
throw new AnnotationException(
"Either name or defaultForType (or both) attribute should be set in TypeDef having typeClass "
+ typeClass
);
}
Map<String, String> parameterMaps = new HashMap<String, String>();
AnnotationInstance[] parameterAnnotations = JandexHelper.getValue(
typeDefAnnotation,
"parameters",
AnnotationInstance[].class
);
for ( AnnotationInstance parameterAnnotation : parameterAnnotations ) {
parameterMaps.put(
JandexHelper.getValue( parameterAnnotation, "name", String.class ),
JandexHelper.getValue( parameterAnnotation, "value", String.class )
);
}
if ( !noName ) {
bind( name, typeClass, parameterMaps, metadata );
}
if ( !noDefaultForType ) {
bind( defaultForType, typeClass, parameterMaps, metadata );
}
}
示例8: bind
import org.hibernate.metamodel.source.MetadataImplementor; //导入依赖的package包/类
private static void bind(MetadataImplementor metadata, AnnotationInstance tableAnnotation) {
String tableName = JandexHelper.getValue( tableAnnotation, "appliesTo", String.class );
ObjectName objectName = new ObjectName( tableName );
Schema schema = metadata.getDatabase().getSchema( objectName.getSchema(), objectName.getCatalog() );
Table table = schema.locateTable( objectName.getName() );
if ( table != null ) {
bindHibernateTableAnnotation( table, tableAnnotation );
}
}
示例9: AnnotationBindingContextImpl
import org.hibernate.metamodel.source.MetadataImplementor; //导入依赖的package包/类
public AnnotationBindingContextImpl(MetadataImplementor metadata, Index index) {
this.metadata = metadata;
this.classLoaderService = new ValueHolder<ClassLoaderService>(
new ValueHolder.DeferredInitializer<ClassLoaderService>() {
@Override
public ClassLoaderService initialize() {
return AnnotationBindingContextImpl.this.metadata
.getServiceRegistry()
.getService( ClassLoaderService.class );
}
}
);
this.index = index;
}
示例10: createCollectionPersister
import org.hibernate.metamodel.source.MetadataImplementor; //导入依赖的package包/类
@Override
@SuppressWarnings( {"unchecked"})
public CollectionPersister createCollectionPersister(
MetadataImplementor metadata,
PluralAttributeBinding collectionMetadata,
CollectionRegionAccessStrategy cacheAccessStrategy,
SessionFactoryImplementor factory) throws HibernateException {
Class<? extends CollectionPersister> persisterClass = collectionMetadata.getCollectionPersisterClass();
if ( persisterClass == null ) {
persisterClass = serviceRegistry.getService( PersisterClassResolver.class ).getCollectionPersisterClass( collectionMetadata );
}
return create( persisterClass, COLLECTION_PERSISTER_CONSTRUCTOR_ARGS_NEW, metadata, collectionMetadata, cacheAccessStrategy, factory );
}
示例11: initiateService
import org.hibernate.metamodel.source.MetadataImplementor; //导入依赖的package包/类
@Override
public NativeQueryInterpreter initiateService(
SessionFactoryImplementor sessionFactory,
MetadataImplementor metadata,
ServiceRegistryImplementor registry) {
return NativeQueryInterpreterStandardImpl.INSTANCE;
}
示例12: initiateService
import org.hibernate.metamodel.source.MetadataImplementor; //导入依赖的package包/类
@Override
public StatisticsImplementor initiateService(
SessionFactoryImplementor sessionFactory,
MetadataImplementor metadata,
ServiceRegistryImplementor registry) {
ConfigurationService configurationService = registry.getService( ConfigurationService.class );
final Object configValue = configurationService.getSetting( STATS_BUILDER, null );
return initiateServiceInternal( sessionFactory, configValue, registry );
}
示例13: integrate
import org.hibernate.metamodel.source.MetadataImplementor; //导入依赖的package包/类
@Override
public void integrate(
MetadataImplementor metadata,
SessionFactoryImplementor sessionFactory,
SessionFactoryServiceRegistry serviceRegistry) {
doIntegration( sessionFactory.getProperties(), null, serviceRegistry );
}
示例14: initiateService
import org.hibernate.metamodel.source.MetadataImplementor; //导入依赖的package包/类
@Override
public EventListenerRegistry initiateService(
SessionFactoryImplementor sessionFactory,
MetadataImplementor metadata,
ServiceRegistryImplementor registry) {
return new EventListenerRegistryImpl();
}
示例15: integrate
import org.hibernate.metamodel.source.MetadataImplementor; //导入依赖的package包/类
/**
* Appends the {@link LifecyclePostLoadEventListener}.
* <p>
* {@inheritDoc}
*/
@Override
public void integrate(MetadataImplementor metadata,
SessionFactoryImplementor sessionFactory,
SessionFactoryServiceRegistry serviceRegistry) {
serviceRegistry.getService(EventListenerRegistry.class)
.getEventListenerGroup(EventType.POST_LOAD)
.appendListener(postLoadListener);
}