Skip to content

Commit

Permalink
HHH-17504 - Ongoing JPA 32 work
Browse files Browse the repository at this point in the history
HHH-17350 - Work on hibernate-models, XSD and JAXB
HHH-16114 - Improve boot metamodel binding
HHH-15996 - Develop an abstraction for Annotation in annotation processing
HHH-16012 - Develop an abstraction for domain model Class refs
HHH-15997 - Support for dynamic models in orm.xml
HHH-15698 - Support for entity-name in mapping.xsd
  • Loading branch information
sebersole committed Jan 3, 2024
1 parent 9562b8c commit 1e5fb6f
Show file tree
Hide file tree
Showing 104 changed files with 1,964 additions and 742 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public Binding doBind(Binder binder) {
else {
if ( !isSerfileObsolete() ) {
try {
return readSerFile();
return new Binding( readSerFile(), getOrigin() );
}
catch ( SerializationException e ) {
log.unableToDeserializeCache( serFile.getName(), e );
Expand Down Expand Up @@ -117,6 +117,9 @@ private void writeSerFile(Object binding) {
}

private static void writeSerFile(Serializable binding, File xmlFile, File serFile) {
if ( binding instanceof Binding<?> bindingWrapper ) {
binding = (Serializable) bindingWrapper.getRoot();
}
try ( FileOutputStream fos = new FileOutputStream( serFile ) ) {
if ( log.isDebugEnabled() ) {
log.debugf( "Writing cache file for: %s to: %s", xmlFile.getAbsolutePath(), serFile.getAbsolutePath() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.util.Map;

import org.hibernate.AnnotationException;
import org.hibernate.Internal;
import org.hibernate.MappingException;
import org.hibernate.annotations.CollectionTypeRegistration;
import org.hibernate.annotations.CollectionTypeRegistrations;
Expand Down Expand Up @@ -410,7 +411,7 @@ public static void bindClass(

bindQueries( annotatedClass, context );
handleImport( annotatedClass, context );
bindFilterDefs( annotatedClass, context );
//bindFilterDefs( annotatedClass, context );
bindTypeDescriptorRegistrations( annotatedClass, context );
bindEmbeddableInstantiatorRegistrations( annotatedClass, context );
bindUserTypeRegistrations( annotatedClass, context );
Expand Down Expand Up @@ -687,7 +688,7 @@ private static void bindFilterDef(FilterDef filterDef, MetadataBuildingContext c
}

@SuppressWarnings("unchecked")
private static JdbcMapping resolveFilterParamType(Class<?> type, MetadataBuildingContext context) {
public static JdbcMapping resolveFilterParamType(Class<?> type, MetadataBuildingContext context) {
if ( UserType.class.isAssignableFrom( type ) ) {
return resolveUserType( (Class<UserType<?>>) type, context );
}
Expand All @@ -702,7 +703,8 @@ else if ( JavaType.class.isAssignableFrom( type ) ) {
}
}

private static BasicType<Object> resolveBasicType(Class<?> type, MetadataBuildingContext context) {
@Internal
public static BasicType<Object> resolveBasicType(Class<?> type, MetadataBuildingContext context) {
final TypeConfiguration typeConfiguration = context.getBootstrapContext().getTypeConfiguration();
final JavaType<Object> jtd = typeConfiguration.getJavaTypeRegistry().findDescriptor( type );
if ( jtd != null ) {
Expand Down Expand Up @@ -751,7 +753,8 @@ public Dialect getDialect() {
}
}

private static JdbcMapping resolveUserType(Class<UserType<?>> userTypeClass, MetadataBuildingContext context) {
@Internal
public static JdbcMapping resolveUserType(Class<UserType<?>> userTypeClass, MetadataBuildingContext context) {
final UserType<?> userType = !context.getBuildingOptions().isAllowExtensionsInCdi()
? FallbackBeanInstanceProducer.INSTANCE.produceBeanInstance( userTypeClass )
: context.getBootstrapContext().getServiceRegistry()
Expand All @@ -760,7 +763,8 @@ private static JdbcMapping resolveUserType(Class<UserType<?>> userTypeClass, Met
return new CustomType<>( userType, context.getBootstrapContext().getTypeConfiguration() );
}

private static JdbcMapping resolveAttributeConverter(Class<AttributeConverter<?, ?>> type, MetadataBuildingContext context) {
@Internal
public static JdbcMapping resolveAttributeConverter(Class<AttributeConverter<?, ?>> type, MetadataBuildingContext context) {
final BootstrapContext bootstrapContext = context.getBootstrapContext();
final ManagedBeanRegistry beanRegistry =
bootstrapContext.getServiceRegistry().requireService( ManagedBeanRegistry.class );
Expand Down Expand Up @@ -793,7 +797,8 @@ private static JdbcMapping resolveAttributeConverter(Class<AttributeConverter<?,
);
}

private static JdbcMapping resolveJavaType(Class<JavaType<?>> type, MetadataBuildingContext context) {
@Internal
public static JdbcMapping resolveJavaType(Class<JavaType<?>> type, MetadataBuildingContext context) {
final TypeConfiguration typeConfiguration = context.getBootstrapContext().getTypeConfiguration();
final JavaType<?> jtd = getJavaType( type, context, typeConfiguration );
final JdbcType jdbcType = jtd.getRecommendedJdbcType( typeConfiguration.getCurrentBaseSqlTypeIndicators() );
Expand Down

0 comments on commit 1e5fb6f

Please sign in to comment.