|
20 | 20 | import java.util.regex.Pattern;
|
21 | 21 |
|
22 | 22 | import org.hibernate.HibernateException;
|
| 23 | +import org.hibernate.Internal; |
23 | 24 | import org.hibernate.MappingException;
|
24 | 25 | import org.hibernate.SessionFactory;
|
25 | 26 | import org.hibernate.boot.SessionFactoryBuilder;
|
@@ -109,7 +110,6 @@ public class MetadataImpl implements MetadataImplementor, Serializable {
|
109 | 110 | private final Map<String, SqmFunctionDescriptor> sqlFunctionMap;
|
110 | 111 | private final Database database;
|
111 | 112 |
|
112 |
| - // note that this "internal" constructor is called by the Quarkus extension! |
113 | 113 | public MetadataImpl(
|
114 | 114 | UUID uuid,
|
115 | 115 | MetadataBuildingOptions metadataBuildingOptions,
|
@@ -680,4 +680,32 @@ public Map<Class<?>, Component> getGenericComponentsMap() {
|
680 | 680 | public Map<Class<?>, DiscriminatorType<?>> getEmbeddableDiscriminatorTypesMap() {
|
681 | 681 | return embeddableDiscriminatorTypesMap;
|
682 | 682 | }
|
| 683 | + |
| 684 | + @Internal |
| 685 | + // called by the Quarkus extension |
| 686 | + public MetadataImpl trim() { |
| 687 | + return new MetadataImpl( |
| 688 | + getUUID(), |
| 689 | + getMetadataBuildingOptions(), //TODO Replace this |
| 690 | + getEntityBindingMap(), |
| 691 | + getComposites(), |
| 692 | + getGenericComponentsMap(), |
| 693 | + getEmbeddableDiscriminatorTypesMap(), |
| 694 | + getMappedSuperclassMap(), |
| 695 | + getCollectionBindingMap(), |
| 696 | + getTypeDefinitionMap(), |
| 697 | + getFilterDefinitions(), |
| 698 | + getFetchProfileMap(), |
| 699 | + getImports(), // ok |
| 700 | + getIdGeneratorDefinitionMap(), |
| 701 | + getNamedQueryMap(), |
| 702 | + getNamedNativeQueryMap(), // TODO might contain references to org.hibernate.loader.custom.ConstructorResultColumnProcessor, org.hibernate.type.TypeStandardSQLFunction |
| 703 | + getNamedProcedureCallMap(), |
| 704 | + getSqlResultSetMappingMap(), //TODO might contain NativeSQLQueryReturn (as namedNativeQueryMap above) |
| 705 | + getNamedEntityGraphs(), //TODO reference to *annotation* instance ! FIXME or ignore feature? |
| 706 | + getSqlFunctionMap(), // ok |
| 707 | + getDatabase(), // Cleaned up: used to include references to MetadataBuildingOptions, etc. |
| 708 | + getBootstrapContext() //FIXME WHOA! |
| 709 | + ); |
| 710 | + } |
683 | 711 | }
|
0 commit comments