Search in sources :

Example 6 with RootGraphImplementor

use of org.hibernate.graph.spi.RootGraphImplementor in project hibernate-orm by hibernate.

the class LoaderSelectBuilder method determineGraphTraversalState.

private static EntityGraphTraversalState determineGraphTraversalState(LoadQueryInfluencers loadQueryInfluencers) {
    if (loadQueryInfluencers != null) {
        final EffectiveEntityGraph effectiveEntityGraph = loadQueryInfluencers.getEffectiveEntityGraph();
        if (effectiveEntityGraph != null) {
            final GraphSemantic graphSemantic = effectiveEntityGraph.getSemantic();
            final RootGraphImplementor rootGraphImplementor = effectiveEntityGraph.getGraph();
            if (graphSemantic != null && rootGraphImplementor != null) {
                return new StandardEntityGraphTraversalStateImpl(graphSemantic, rootGraphImplementor);
            }
        }
    }
    return null;
}
Also used : RootGraphImplementor(org.hibernate.graph.spi.RootGraphImplementor) EffectiveEntityGraph(org.hibernate.engine.spi.EffectiveEntityGraph) GraphSemantic(org.hibernate.graph.GraphSemantic) StandardEntityGraphTraversalStateImpl(org.hibernate.sql.results.internal.StandardEntityGraphTraversalStateImpl)

Example 7 with RootGraphImplementor

use of org.hibernate.graph.spi.RootGraphImplementor in project hibernate-orm by hibernate.

the class CriteriaEntityGraphTest method testSemanticsWithSubgraph.

@ParameterizedTest
@EnumSource(GraphSemantic.class)
void testSemanticsWithSubgraph(GraphSemantic graphSemantic) {
    scope.inTransaction(session -> {
        final RootGraphImplementor<Cat> eg = session.createEntityGraph(Cat.class);
        eg.addSubgraph("owner", Person.class);
        final SelectStatement sqlAst = buildSqlSelectAst(Cat.class, eg, graphSemantic, session);
        // Check the from-clause
        assertEntityValuedJoinedGroup(sqlAst, "owner", Person.class, this::assertPersonHomeAddressJoinedGroup);
        // Check the domain-result graph
        assertDomainResult(sqlAst, Cat.class, "owner", Person.class, entityFetch -> {
            if (graphSemantic == GraphSemantic.LOAD) {
                assertThat(entityFetch, instanceOf(EntityFetchJoinedImpl.class));
                final EntityResult entityResult = ((EntityFetchJoinedImpl) entityFetch).getEntityResult();
                final Map<String, Class<? extends Fetch>> fetchClassByAttributeName = entityResult.getFetches().stream().collect(Collectors.toMap(fetch -> fetch.getFetchedMapping().getPartName(), Fetch::getClass));
                final Map<String, Class<? extends Fetch>> expectedFetchClassByAttributeName = new HashMap<>();
                expectedFetchClassByAttributeName.put("pets", DelayedCollectionFetch.class);
                expectedFetchClassByAttributeName.put("homeAddress", EmbeddableFetchImpl.class);
                expectedFetchClassByAttributeName.put("company", EntityDelayedFetchImpl.class);
                assertThat(fetchClassByAttributeName, is(expectedFetchClassByAttributeName));
            }
        });
    });
}
Also used : EntityFetchJoinedImpl(org.hibernate.sql.results.graph.entity.internal.EntityFetchJoinedImpl) DelayedCollectionFetch(org.hibernate.sql.results.graph.collection.internal.DelayedCollectionFetch) Fetch(org.hibernate.sql.results.graph.Fetch) EntityFetch(org.hibernate.sql.results.graph.entity.EntityFetch) CoreMatchers.is(org.hamcrest.CoreMatchers.is) Entity(jakarta.persistence.Entity) AssignableMatcher.assignableTo(org.hibernate.testing.hamcrest.AssignableMatcher.assignableTo) EntityPersister(org.hibernate.persister.entity.EntityPersister) GraphSemantic(org.hibernate.graph.GraphSemantic) DelayedCollectionFetch(org.hibernate.sql.results.graph.collection.internal.DelayedCollectionFetch) TableGroupJoin(org.hibernate.sql.ast.tree.from.TableGroupJoin) EntityValuedModelPart(org.hibernate.metamodel.mapping.EntityValuedModelPart) CoreMatchers.notNullValue(org.hamcrest.CoreMatchers.notNullValue) CoreMatchers.instanceOf(org.hamcrest.CoreMatchers.instanceOf) Assert.assertThat(org.junit.Assert.assertThat) PluralAttributeMapping(org.hibernate.metamodel.mapping.PluralAttributeMapping) TestForIssue(org.hibernate.testing.TestForIssue) SqmQueryImplementor(org.hibernate.query.hql.spi.SqmQueryImplementor) SessionFactoryScopeAware(org.hibernate.testing.orm.junit.SessionFactoryScopeAware) Map(java.util.Map) EntityResult(org.hibernate.sql.results.graph.entity.EntityResult) FetchType(jakarta.persistence.FetchType) Fetchable(org.hibernate.sql.results.graph.Fetchable) EntityDelayedFetchImpl(org.hibernate.sql.results.graph.entity.internal.EntityDelayedFetchImpl) SqmSelectStatement(org.hibernate.query.sqm.tree.select.SqmSelectStatement) CollectionUtils(org.junit.platform.commons.util.CollectionUtils) LazyTableGroup(org.hibernate.sql.ast.tree.from.LazyTableGroup) Collection(java.util.Collection) DomainResult(org.hibernate.sql.results.graph.DomainResult) Set(java.util.Set) Id(jakarta.persistence.Id) DomainModel(org.hibernate.testing.orm.junit.DomainModel) QuerySqmImpl(org.hibernate.query.sqm.internal.QuerySqmImpl) Collectors(java.util.stream.Collectors) EmbeddableFetchImpl(org.hibernate.sql.results.graph.embeddable.internal.EmbeddableFetchImpl) SelectStatement(org.hibernate.sql.ast.tree.select.SelectStatement) Test(org.junit.jupiter.api.Test) LoadQueryInfluencers(org.hibernate.engine.spi.LoadQueryInfluencers) List(java.util.List) SessionImplementor(org.hibernate.engine.spi.SessionImplementor) FromClause(org.hibernate.sql.ast.tree.from.FromClause) EmbeddedAttributeMapping(org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping) OneToMany(jakarta.persistence.OneToMany) ManyToOne(jakarta.persistence.ManyToOne) HashMap(java.util.HashMap) EnumSource(org.junit.jupiter.params.provider.EnumSource) Embedded(jakarta.persistence.Embedded) RootGraphImplementor(org.hibernate.graph.spi.RootGraphImplementor) QueryImplementor(org.hibernate.query.spi.QueryImplementor) CollectionMatchers.hasSize(org.hibernate.testing.hamcrest.CollectionMatchers.hasSize) StandardSqmTranslator(org.hibernate.query.sqm.sql.internal.StandardSqmTranslator) Embeddable(jakarta.persistence.Embeddable) CollectionMatchers.isEmpty(org.hibernate.testing.hamcrest.CollectionMatchers.isEmpty) ElementCollection(jakarta.persistence.ElementCollection) SqmTranslation(org.hibernate.query.sqm.sql.SqmTranslation) Fetch(org.hibernate.sql.results.graph.Fetch) Consumer(java.util.function.Consumer) EntityFetch(org.hibernate.sql.results.graph.entity.EntityFetch) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) CriteriaQuery(jakarta.persistence.criteria.CriteriaQuery) StandardVirtualTableGroup(org.hibernate.sql.ast.tree.from.StandardVirtualTableGroup) SessionFactoryScope(org.hibernate.testing.orm.junit.SessionFactoryScope) CriteriaBuilder(jakarta.persistence.criteria.CriteriaBuilder) AttributeMapping(org.hibernate.metamodel.mapping.AttributeMapping) SessionFactory(org.hibernate.testing.orm.junit.SessionFactory) TableGroup(org.hibernate.sql.ast.tree.from.TableGroup) EntityFetchJoinedImpl(org.hibernate.sql.results.graph.entity.internal.EntityFetchJoinedImpl) SqmSelectStatement(org.hibernate.query.sqm.tree.select.SqmSelectStatement) SelectStatement(org.hibernate.sql.ast.tree.select.SelectStatement) HashMap(java.util.HashMap) EntityResult(org.hibernate.sql.results.graph.entity.EntityResult) EnumSource(org.junit.jupiter.params.provider.EnumSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 8 with RootGraphImplementor

use of org.hibernate.graph.spi.RootGraphImplementor in project hibernate-reactive by hibernate.

the class ReactiveStatelessSessionImpl method reactiveGet.

@Override
public <T> CompletionStage<T> reactiveGet(Class<? extends T> entityClass, Object id, LockMode lockMode, EntityGraph<T> fetchGraph) {
    checkOpen();
    if (fetchGraph != null) {
        getLoadQueryInfluencers().getEffectiveEntityGraph().applyGraph((RootGraphImplementor<T>) fetchGraph, GraphSemantic.FETCH);
    }
    ReactiveEntityPersister persister = (ReactiveEntityPersister) getFactory().getMetamodel().entityPersister(entityClass);
    LockOptions lockOptions = getNullSafeLockOptions(lockMode);
    return persister.reactiveLoad((Serializable) id, null, lockOptions, this).whenComplete((v, e) -> {
        if (getPersistenceContext().isLoadFinished()) {
            getPersistenceContext().clear();
        }
        getLoadQueryInfluencers().getEffectiveEntityGraph().clear();
    }).thenApply(entity -> (T) entity);
}
Also used : CompletionStages.completedFuture(org.hibernate.reactive.util.impl.CompletionStages.completedFuture) BatchingConnection(org.hibernate.reactive.pool.BatchingConnection) NamedQueryDefinition(org.hibernate.engine.spi.NamedQueryDefinition) EntityPersister(org.hibernate.persister.entity.EntityPersister) NativeQueryTupleTransformer(org.hibernate.jpa.spi.NativeQueryTupleTransformer) GraphSemantic(org.hibernate.graph.GraphSemantic) IdentifierGeneration.assignIdIfNecessary(org.hibernate.reactive.id.impl.IdentifierGeneration.assignIdIfNecessary) Log(org.hibernate.reactive.logging.impl.Log) PersistenceContext(org.hibernate.engine.spi.PersistenceContext) LoggerFactory(org.hibernate.reactive.logging.impl.LoggerFactory) PersistentCollection(org.hibernate.collection.spi.PersistentCollection) SQLCustomQuery(org.hibernate.loader.custom.sql.SQLCustomQuery) ReactiveCustomLoader(org.hibernate.reactive.loader.custom.impl.ReactiveCustomLoader) HibernateProxy(org.hibernate.proxy.HibernateProxy) CustomQuery(org.hibernate.loader.custom.CustomQuery) HQLQueryPlan(org.hibernate.engine.query.spi.HQLQueryPlan) SessionFactoryImpl(org.hibernate.internal.SessionFactoryImpl) ReactiveNativeQuery(org.hibernate.reactive.session.ReactiveNativeQuery) BytecodeEnhancementMetadata(org.hibernate.bytecode.spi.BytecodeEnhancementMetadata) EntityGraph(javax.persistence.EntityGraph) ParameterMetadata(org.hibernate.query.ParameterMetadata) LockOptions(org.hibernate.LockOptions) MethodHandles(java.lang.invoke.MethodHandles) ResultSetMapping(org.hibernate.reactive.common.ResultSetMapping) ReactiveStatelessSession(org.hibernate.reactive.session.ReactiveStatelessSession) Serializable(java.io.Serializable) List(java.util.List) CompletionStages.failedFuture(org.hibernate.reactive.util.impl.CompletionStages.failedFuture) CompletionStage(java.util.concurrent.CompletionStage) Dialect(org.hibernate.dialect.Dialect) CompletionStages.loop(org.hibernate.reactive.util.impl.CompletionStages.loop) ReactiveEntityPersister(org.hibernate.reactive.persister.entity.impl.ReactiveEntityPersister) HibernateException(org.hibernate.HibernateException) SharedSessionContractImplementor(org.hibernate.engine.spi.SharedSessionContractImplementor) Criteria(org.hibernate.reactive.session.Criteria) NamedSQLQueryDefinition(org.hibernate.engine.spi.NamedSQLQueryDefinition) SessionUtil.checkEntityFound(org.hibernate.reactive.session.impl.SessionUtil.checkEntityFound) RootGraphImpl(org.hibernate.graph.internal.RootGraphImpl) EntityDataAccess(org.hibernate.cache.spi.access.EntityDataAccess) CompletableFuture(java.util.concurrent.CompletableFuture) UnresolvableObjectException(org.hibernate.UnresolvableObjectException) RootGraphImplementor(org.hibernate.graph.spi.RootGraphImplementor) CriteriaQueryTupleTransformer(org.hibernate.jpa.spi.CriteriaQueryTupleTransformer) ReactiveQuery(org.hibernate.reactive.session.ReactiveQuery) IdentifierGeneration.generateId(org.hibernate.reactive.id.impl.IdentifierGeneration.generateId) BulkOperationCleanupAction(org.hibernate.action.internal.BulkOperationCleanupAction) StatelessSessionImpl(org.hibernate.internal.StatelessSessionImpl) MetamodelImplementor(org.hibernate.metamodel.spi.MetamodelImplementor) Tuple(javax.persistence.Tuple) QueryParameters(org.hibernate.engine.spi.QueryParameters) LockMode(org.hibernate.LockMode) LazyInitializer(org.hibernate.proxy.LazyInitializer) Versioning(org.hibernate.engine.internal.Versioning) ReactiveCollectionPersister(org.hibernate.reactive.persister.collection.impl.ReactiveCollectionPersister) EntityKey(org.hibernate.engine.spi.EntityKey) EntityMetamodel(org.hibernate.tuple.entity.EntityMetamodel) CriteriaQueryOptions(org.hibernate.reactive.session.CriteriaQueryOptions) ReactivePersistenceContextAdapter(org.hibernate.reactive.engine.impl.ReactivePersistenceContextAdapter) SessionCreationOptions(org.hibernate.internal.SessionCreationOptions) NativeSQLQuerySpecification(org.hibernate.engine.query.spi.sql.NativeSQLQuerySpecification) ReactiveConnection(org.hibernate.reactive.pool.ReactiveConnection) LockOptions(org.hibernate.LockOptions) ReactiveEntityPersister(org.hibernate.reactive.persister.entity.impl.ReactiveEntityPersister)

Example 9 with RootGraphImplementor

use of org.hibernate.graph.spi.RootGraphImplementor in project hibernate-reactive by hibernate.

the class ReactiveSessionImpl method reactiveInternalLoad.

@Override
public CompletionStage<Object> reactiveInternalLoad(String entityName, Serializable id, boolean eager, boolean nullable) {
    final EffectiveEntityGraph effectiveEntityGraph = getLoadQueryInfluencers().getEffectiveEntityGraph();
    final GraphSemantic semantic = effectiveEntityGraph.getSemantic();
    final RootGraphImplementor<?> graph = effectiveEntityGraph.getGraph();
    boolean clearedEffectiveGraph;
    if (semantic == null || graph.appliesTo(entityName)) {
        clearedEffectiveGraph = false;
    } else {
        // log.debug( "Clearing effective entity graph for subsequent-select" );
        clearedEffectiveGraph = true;
        effectiveEntityGraph.clear();
    }
    final LoadEventListener.LoadType type;
    if (nullable) {
        type = LoadEventListener.INTERNAL_LOAD_NULLABLE;
    } else {
        type = eager ? LoadEventListener.INTERNAL_LOAD_EAGER : LoadEventListener.INTERNAL_LOAD_LAZY;
    }
    threadCheck();
    LoadEvent event = new LoadEvent(id, entityName, true, this, getReadOnlyFromLoadQueryInfluencers());
    return fireLoadNoChecks(event, type).thenApply(v -> {
        Object result = event.getResult();
        if (!nullable) {
            UnresolvableObjectException.throwIfNull(result, id, entityName);
        }
        return result;
    }).whenComplete((v, x) -> {
        if (clearedEffectiveGraph) {
            effectiveEntityGraph.applyGraph(graph, semantic);
        }
    });
}
Also used : LoadEventListener(org.hibernate.event.spi.LoadEventListener) ReactiveLoadEventListener(org.hibernate.reactive.event.ReactiveLoadEventListener) CompletionStages.completedFuture(org.hibernate.reactive.util.impl.CompletionStages.completedFuture) BatchingConnection(org.hibernate.reactive.pool.BatchingConnection) NamedQueryDefinition(org.hibernate.engine.spi.NamedQueryDefinition) ExceptionConverter(org.hibernate.engine.spi.ExceptionConverter) NativeQueryTupleTransformer(org.hibernate.jpa.spi.NativeQueryTupleTransformer) EventSource(org.hibernate.event.spi.EventSource) Log(org.hibernate.reactive.logging.impl.Log) CompletionStages.returnNullorRethrow(org.hibernate.reactive.util.impl.CompletionStages.returnNullorRethrow) PersistenceContext(org.hibernate.engine.spi.PersistenceContext) LoggerFactory(org.hibernate.reactive.logging.impl.LoggerFactory) InitializeCollectionEvent(org.hibernate.event.spi.InitializeCollectionEvent) ReactivePersistEventListener(org.hibernate.reactive.event.ReactivePersistEventListener) MergeContext(org.hibernate.event.internal.MergeContext) SQLCustomQuery(org.hibernate.loader.custom.sql.SQLCustomQuery) Map(java.util.Map) HQLQueryPlan(org.hibernate.engine.query.spi.HQLQueryPlan) InternalStateAssertions.assertUseOnEventLoop(org.hibernate.reactive.common.InternalStateAssertions.assertUseOnEventLoop) CompletionStages.voidFuture(org.hibernate.reactive.util.impl.CompletionStages.voidFuture) ResolveNaturalIdEvent(org.hibernate.event.spi.ResolveNaturalIdEvent) LockOptions(org.hibernate.LockOptions) MethodHandles(java.lang.invoke.MethodHandles) FlushEvent(org.hibernate.event.spi.FlushEvent) Set(java.util.Set) RefreshEvent(org.hibernate.event.spi.RefreshEvent) ResultSetMapping(org.hibernate.reactive.common.ResultSetMapping) CacheMode(org.hibernate.CacheMode) Serializable(java.io.Serializable) CompletionStage(java.util.concurrent.CompletionStage) Dialect(org.hibernate.dialect.Dialect) ObjectNotFoundException(org.hibernate.ObjectNotFoundException) AutoFlushEvent(org.hibernate.event.spi.AutoFlushEvent) ReactiveEntityPersister(org.hibernate.reactive.persister.entity.impl.ReactiveEntityPersister) HibernateException(org.hibernate.HibernateException) CompletionStages(org.hibernate.reactive.util.impl.CompletionStages) TypeMismatchException(org.hibernate.TypeMismatchException) RootGraph(org.hibernate.graph.RootGraph) SessionUtil.checkEntityFound(org.hibernate.reactive.session.impl.SessionUtil.checkEntityFound) Supplier(java.util.function.Supplier) RootGraphImplementor(org.hibernate.graph.spi.RootGraphImplementor) ReactiveResolveNaturalIdEventListener(org.hibernate.reactive.event.ReactiveResolveNaturalIdEventListener) IdentitySet(org.hibernate.internal.util.collections.IdentitySet) Status(org.hibernate.engine.spi.Status) ReactiveSession(org.hibernate.reactive.session.ReactiveSession) Tuple(javax.persistence.Tuple) ReactiveFlushEventListener(org.hibernate.reactive.event.ReactiveFlushEventListener) CompletionStages.rethrow(org.hibernate.reactive.util.impl.CompletionStages.rethrow) EntityKey(org.hibernate.engine.spi.EntityKey) CriteriaQueryOptions(org.hibernate.reactive.session.CriteriaQueryOptions) ReactiveMergeEventListener(org.hibernate.reactive.event.ReactiveMergeEventListener) StatefulPersistenceContext(org.hibernate.engine.internal.StatefulPersistenceContext) SessionImpl(org.hibernate.internal.SessionImpl) SessionCreationOptions(org.hibernate.internal.SessionCreationOptions) ReactiveDeleteEventListener(org.hibernate.reactive.event.ReactiveDeleteEventListener) EffectiveEntityGraph(org.hibernate.engine.spi.EffectiveEntityGraph) NativeSQLQuerySpecification(org.hibernate.engine.query.spi.sql.NativeSQLQuerySpecification) LoadEvent(org.hibernate.event.spi.LoadEvent) ReactiveConnection(org.hibernate.reactive.pool.ReactiveConnection) EntityPersister(org.hibernate.persister.entity.EntityPersister) GraphSemantic(org.hibernate.graph.GraphSemantic) MessageHelper(org.hibernate.pretty.MessageHelper) MergeEvent(org.hibernate.event.spi.MergeEvent) DefaultReactiveAutoFlushEventListener(org.hibernate.reactive.event.impl.DefaultReactiveAutoFlushEventListener) PersistentCollection(org.hibernate.collection.spi.PersistentCollection) ObjectDeletedException(org.hibernate.ObjectDeletedException) ReactiveCustomLoader(org.hibernate.reactive.loader.custom.impl.ReactiveCustomLoader) HibernateProxy(org.hibernate.proxy.HibernateProxy) JDBCException(org.hibernate.JDBCException) LockEvent(org.hibernate.event.spi.LockEvent) SessionFactoryImpl(org.hibernate.internal.SessionFactoryImpl) ReactiveNativeQuery(org.hibernate.reactive.session.ReactiveNativeQuery) EntityGraph(javax.persistence.EntityGraph) ParameterMetadata(org.hibernate.query.ParameterMetadata) Attribute(javax.persistence.metamodel.Attribute) CompletionException(java.util.concurrent.CompletionException) LoadEventListener(org.hibernate.event.spi.LoadEventListener) List(java.util.List) ReactiveLockEventListener(org.hibernate.reactive.event.ReactiveLockEventListener) ReactiveRefreshEventListener(org.hibernate.reactive.event.ReactiveRefreshEventListener) MappingException(org.hibernate.MappingException) SessionImplementor(org.hibernate.engine.spi.SessionImplementor) ReactiveLoadEventListener(org.hibernate.reactive.event.ReactiveLoadEventListener) Criteria(org.hibernate.reactive.session.Criteria) ReactiveActionQueue(org.hibernate.reactive.engine.ReactiveActionQueue) NamedSQLQueryDefinition(org.hibernate.engine.spi.NamedSQLQueryDefinition) INVALID_NATURAL_ID_REFERENCE(org.hibernate.engine.spi.PersistenceContext.NaturalIdHelper.INVALID_NATURAL_ID_REFERENCE) PersistEvent(org.hibernate.event.spi.PersistEvent) InternalStateAssertions(org.hibernate.reactive.common.InternalStateAssertions) UnresolvableObjectException(org.hibernate.UnresolvableObjectException) CriteriaQueryTupleTransformer(org.hibernate.jpa.spi.CriteriaQueryTupleTransformer) MultiLoadOptions(org.hibernate.persister.entity.MultiLoadOptions) ReactiveQuery(org.hibernate.reactive.session.ReactiveQuery) EntityNotFoundException(javax.persistence.EntityNotFoundException) BulkOperationCleanupAction(org.hibernate.action.internal.BulkOperationCleanupAction) DeleteEvent(org.hibernate.event.spi.DeleteEvent) QueryParameters(org.hibernate.engine.spi.QueryParameters) LockMode(org.hibernate.LockMode) LazyInitializer(org.hibernate.proxy.LazyInitializer) FlushMode(org.hibernate.FlushMode) CompletionStages.returnOrRethrow(org.hibernate.reactive.util.impl.CompletionStages.returnOrRethrow) ReactivePersistenceContextAdapter(org.hibernate.reactive.engine.impl.ReactivePersistenceContextAdapter) DefaultReactiveInitializeCollectionEventListener(org.hibernate.reactive.event.impl.DefaultReactiveInitializeCollectionEventListener) EntityEntry(org.hibernate.engine.spi.EntityEntry) LoadEvent(org.hibernate.event.spi.LoadEvent) EffectiveEntityGraph(org.hibernate.engine.spi.EffectiveEntityGraph) GraphSemantic(org.hibernate.graph.GraphSemantic)

Aggregations

GraphSemantic (org.hibernate.graph.GraphSemantic)9 RootGraphImplementor (org.hibernate.graph.spi.RootGraphImplementor)9 List (java.util.List)8 EntityPersister (org.hibernate.persister.entity.EntityPersister)8 Map (java.util.Map)7 Set (java.util.Set)7 ElementCollection (jakarta.persistence.ElementCollection)5 Embeddable (jakarta.persistence.Embeddable)5 Embedded (jakarta.persistence.Embedded)5 Entity (jakarta.persistence.Entity)5 FetchType (jakarta.persistence.FetchType)5 Id (jakarta.persistence.Id)5 ManyToOne (jakarta.persistence.ManyToOne)5 OneToMany (jakarta.persistence.OneToMany)5 Collection (java.util.Collection)5 HashMap (java.util.HashMap)5 Consumer (java.util.function.Consumer)5 Collectors (java.util.stream.Collectors)5 CoreMatchers.instanceOf (org.hamcrest.CoreMatchers.instanceOf)5 CoreMatchers.is (org.hamcrest.CoreMatchers.is)5