Search in sources :

Example 1 with EntityWithAggregateId

use of org.hibernate.testing.orm.domain.gambit.EntityWithAggregateId in project hibernate-orm by hibernate.

the class MultiIdEntityLoadTests method prepareTestData.

@BeforeEach
public void prepareTestData(SessionFactoryScope scope) {
    scope.inTransaction(session -> {
        final BasicEntity first = new BasicEntity(1, "first");
        final BasicEntity second = new BasicEntity(2, "second");
        final BasicEntity third = new BasicEntity(3, "third");
        session.save(first);
        session.save(second);
        session.save(third);
        session.save(new EntityWithAggregateId(new EntityWithAggregateId.Key("abc", "def"), "ghi"));
        session.save(new EntityWithAggregateId(new EntityWithAggregateId.Key("123", "456"), "789"));
    });
}
Also used : EntityWithAggregateId(org.hibernate.testing.orm.domain.gambit.EntityWithAggregateId) BasicEntity(org.hibernate.testing.orm.domain.gambit.BasicEntity) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

BasicEntity (org.hibernate.testing.orm.domain.gambit.BasicEntity)1 EntityWithAggregateId (org.hibernate.testing.orm.domain.gambit.EntityWithAggregateId)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1