Register JPA embeddable types properly, allow access to functions in registry and fix AttributeClassifications

This commit is contained in:
Christian Beikov 2020-01-28 22:37:40 +01:00 committed by Steve Ebersole
parent 98414b1a92
commit 31377b1423
3 changed files with 7 additions and 2 deletions

View File

@ -13,9 +13,9 @@ public enum AttributeClassification {
EMBEDDED( PersistentAttributeType.EMBEDDED ),
ANY( null ),
ONE_TO_ONE( PersistentAttributeType.ONE_TO_ONE ),
MANY_TO_ONE( PersistentAttributeType.EMBEDDED ),
MANY_TO_ONE( PersistentAttributeType.MANY_TO_ONE ),
ELEMENT_COLLECTION( PersistentAttributeType.ELEMENT_COLLECTION ),
ONE_TO_MANY( PersistentAttributeType.MANY_TO_ONE ),
ONE_TO_MANY( PersistentAttributeType.ONE_TO_MANY ),
MANY_TO_MANY( PersistentAttributeType.MANY_TO_MANY );
private final PersistentAttributeType jpaClassification;

View File

@ -344,6 +344,7 @@ public class MetadataContext {
}
( ( AttributeContainer) embeddable ).getInFlightAccess().finishUp();
embeddables.put( embeddable.getJavaType(), embeddable );
if ( staticMetamodelScanEnabled ) {
populateStaticMetamodel( embeddable );

View File

@ -36,6 +36,10 @@ public class SqmFunctionRegistry {
log.tracef( "SqmFunctionRegistry created" );
}
public Map<String, SqmFunctionDescriptor> getFunctions() {
return functionMap;
}
/**
* Find a SqmFunctionTemplate by name. Returns {@code null} if
* no such function is found.