use of org.hibernate.annotations.CollectionTypeRegistration in project hibernate-orm by hibernate.
the class AnnotationBinder method handleTypeDescriptorRegistrations.
private static void handleTypeDescriptorRegistrations(XAnnotatedElement annotatedElement, MetadataBuildingContext context) {
final ManagedBeanRegistry managedBeanRegistry = context.getBootstrapContext().getServiceRegistry().getService(ManagedBeanRegistry.class);
final JavaTypeRegistration javaTypeAnn = annotatedElement.getAnnotation(JavaTypeRegistration.class);
if (javaTypeAnn != null) {
handleJavaTypeRegistration(context, managedBeanRegistry, javaTypeAnn);
} else {
final JavaTypeRegistrations annotation = annotatedElement.getAnnotation(JavaTypeRegistrations.class);
if (annotation != null) {
final JavaTypeRegistration[] registrations = annotation.value();
for (JavaTypeRegistration registration : registrations) {
handleJavaTypeRegistration(context, managedBeanRegistry, registration);
}
}
}
final JdbcTypeRegistration jdbcTypeAnn = annotatedElement.getAnnotation(JdbcTypeRegistration.class);
if (jdbcTypeAnn != null) {
handleJdbcTypeRegistration(context, managedBeanRegistry, jdbcTypeAnn);
} else {
final JdbcTypeRegistrations jdbcTypesAnn = annotatedElement.getAnnotation(JdbcTypeRegistrations.class);
if (jdbcTypesAnn != null) {
final JdbcTypeRegistration[] registrations = jdbcTypesAnn.value();
for (JdbcTypeRegistration registration : registrations) {
handleJdbcTypeRegistration(context, managedBeanRegistry, registration);
}
}
}
final CollectionTypeRegistration singleRegistration = annotatedElement.getAnnotation(CollectionTypeRegistration.class);
if (singleRegistration != null) {
context.getMetadataCollector().addCollectionTypeRegistration(singleRegistration);
}
final CollectionTypeRegistrations multiRegistration = annotatedElement.getAnnotation(CollectionTypeRegistrations.class);
if (multiRegistration != null) {
for (CollectionTypeRegistration registration : multiRegistration.value()) {
context.getMetadataCollector().addCollectionTypeRegistration(registration);
}
}
}
Aggregations