HHH-15495 - add test case

This commit is contained in:
The-Arne 2022-09-12 17:31:18 +02:00 committed by Andrea Boriero
parent c23a982318
commit 8b9b02b8b8
1 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,47 @@
package org.hibernate.orm.test.aggregation;
import java.util.UUID;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.orm.junit.DomainModel;
import org.hibernate.testing.orm.junit.SessionFactory;
import org.hibernate.testing.orm.junit.SessionFactoryScope;
import org.junit.jupiter.api.Test;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
@DomainModel(annotatedClasses = { UuidAggregationTest.UuidIdentifiedEntity.class })
@SessionFactory
public class UuidAggregationTest {
@Entity(name = "UuidIdentifiedEntity")
public static class UuidIdentifiedEntity {
@Id
private UUID id;
public UuidIdentifiedEntity() {
super();
}
public UUID getId() {
return id;
}
public void setId(final UUID id) {
this.id = id;
}
}
@Test
@TestForIssue(jiraKey = "HHH-15495")
public void testMaxUuid(SessionFactoryScope scope) {
scope.inTransaction(
s -> {
s.createSelectionQuery( "select max(id) from UuidIdentifiedEntity", UUID.class ).getSingleResult();
}
);
}
}