Skip to content

Commit

Permalink
#50 - Pre-process and categorize id mappings from EntityHierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
sebersole committed Oct 30, 2023
1 parent 044ad96 commit f5ccef4
Show file tree
Hide file tree
Showing 46 changed files with 1,223 additions and 646 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.hibernate.boot.spi.BootstrapContext;
import org.hibernate.models.orm.bind.spi.BindingContext;
import org.hibernate.models.orm.categorize.spi.CategorizedDomainModel;
import org.hibernate.models.orm.categorize.spi.GlobalRegistrations;
import org.hibernate.models.source.spi.AnnotationDescriptorRegistry;
import org.hibernate.models.source.spi.ClassDetailsRegistry;

Expand All @@ -21,13 +22,15 @@
public class BindingContextImpl implements BindingContext {
private final ClassDetailsRegistry classDetailsRegistry;
private final AnnotationDescriptorRegistry annotationDescriptorRegistry;
private final GlobalRegistrations globalRegistrations;
private final ClassmateContext classmateContext;
private final SharedCacheMode sharedCacheMode;

public BindingContextImpl(CategorizedDomainModel categorizedDomainModel, BootstrapContext bootstrapContext) {
this(
categorizedDomainModel.getClassDetailsRegistry(),
categorizedDomainModel.getAnnotationDescriptorRegistry(),
categorizedDomainModel.getGlobalRegistrations(),
bootstrapContext.getClassmateContext(),
bootstrapContext.getMetadataBuildingOptions().getSharedCacheMode()
);
Expand All @@ -36,17 +39,20 @@ public BindingContextImpl(CategorizedDomainModel categorizedDomainModel, Bootstr
public BindingContextImpl(
ClassDetailsRegistry classDetailsRegistry,
AnnotationDescriptorRegistry annotationDescriptorRegistry,
GlobalRegistrations globalRegistrations,
ClassmateContext classmateContext) {
this( classDetailsRegistry, annotationDescriptorRegistry, classmateContext, SharedCacheMode.UNSPECIFIED );
this( classDetailsRegistry, annotationDescriptorRegistry, globalRegistrations, classmateContext, SharedCacheMode.UNSPECIFIED );
}

public BindingContextImpl(
ClassDetailsRegistry classDetailsRegistry,
AnnotationDescriptorRegistry annotationDescriptorRegistry,
GlobalRegistrations globalRegistrations,
ClassmateContext classmateContext,
SharedCacheMode sharedCacheMode) {
this.classDetailsRegistry = classDetailsRegistry;
this.annotationDescriptorRegistry = annotationDescriptorRegistry;
this.globalRegistrations = globalRegistrations;
this.classmateContext = classmateContext;
this.sharedCacheMode = sharedCacheMode;
}
Expand All @@ -61,6 +67,11 @@ public AnnotationDescriptorRegistry getAnnotationDescriptorRegistry() {
return annotationDescriptorRegistry;
}

@Override
public GlobalRegistrations getGlobalRegistrations() {
return globalRegistrations;
}

@Override
public ClassmateContext getClassmateContext() {
return classmateContext;
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package org.hibernate.models.orm.bind.spi;

import org.hibernate.boot.internal.ClassmateContext;
import org.hibernate.models.orm.categorize.spi.GlobalRegistrations;
import org.hibernate.models.source.spi.AnnotationDescriptorRegistry;
import org.hibernate.models.source.spi.ClassDetailsRegistry;

Expand All @@ -24,6 +25,8 @@ public interface BindingContext {

AnnotationDescriptorRegistry getAnnotationDescriptorRegistry();

GlobalRegistrations getGlobalRegistrations();

ClassmateContext getClassmateContext();

SharedCacheMode getSharedCacheMode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,17 @@
*/
package org.hibernate.models.orm.bind.spi;

import org.hibernate.models.orm.bind.internal.HierarchyMetadataProcessor;
import java.util.ArrayList;
import java.util.List;

import org.hibernate.models.orm.categorize.spi.CategorizedDomainModel;
import org.hibernate.models.orm.categorize.spi.GlobalRegistrations;
import org.hibernate.models.orm.categorize.spi.IdentifiableTypeMetadata;
import org.hibernate.models.orm.categorize.spi.JpaEventListener;
import org.hibernate.models.source.spi.ClassDetails;

import jakarta.persistence.ExcludeDefaultListeners;
import jakarta.persistence.ExcludeSuperclassListeners;

/**
* Responsible for processing {@linkplain org.hibernate.boot.model.process.spi.ManagedResources managed-resources}
Expand All @@ -27,7 +36,6 @@ public static void coordinateBinding(
CategorizedDomainModel categorizedDomainModel,
BindingOptions options,
BindingContext bindingContext) {
HierarchyMetadataProcessor.preBindHierarchyAttributes( categorizedDomainModel, bindingContext );
// Processor.process( managedResources, bindingContext, options );
}
}

This file was deleted.

This file was deleted.

Loading

0 comments on commit f5ccef4

Please sign in to comment.