Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HHH-15495 - add test case #5276

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package org.hibernate.orm.test.aggregation;

import java.util.UUID;

import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.query.SelectionQuery;
import org.hibernate.testing.TestForIssue;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.Test;

import jakarta.persistence.Entity;
import jakarta.persistence.Id;

public class UuidAggregationTest extends BaseCoreFunctionalTestCase {

@Entity
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 hhh15495Test() throws Exception {
final Session s = openSession();
final Transaction tx = s.beginTransaction();
final SelectionQuery<UUID> query = s.createSelectionQuery( "SELECT MAX(id) from UuidIdentifiedEntity;", UUID.class );
query.getSingleResult();
tx.commit();
s.close();
}

@Override
protected Class<?>[] getAnnotatedClasses() {
return new Class[]{ UuidIdentifiedEntity.class };
}
}