I am trying to use Hibernate native queries to select a single column from the database. The column type is an enumeration.
Java
public interface TicketSummary {
TicketStatus getSummary();
}
@Repository
public interface TicketRepository extends JpaRepository<Ticket, TicketIdentity> {
@Query(value = "SELECT status AS summary FROM ticket_service.ticket WHERE entitlement_id IN (:entitlementId)", nativeQuery = true)
List<TicketSummary> findAllTicketsStatusSummary(UUID[] entitlementId);
}
SQL
CREATE TYPE ticket_service.ticket_state AS ENUM(
'CREATED',
'IN_PROGRESS',
'BLOCKED',
'CLOSED',
'COMPLETED'
);
I continuously get the following error when querying.
exception captured: No Dialect mapping for JDBC type: 1111; nested exception is org.hibernate.MappingException: No Dialect mapping for JDBC type: 1111
Debugging
Placing a breakpoint inside JdbcResultMetadata.getHibernateType displays the following
Kindly assist me in finding a solution to the same. Thank you in advance.