Unable to use Hibernate queries using datatype CHAR(5)

Solution Unverified - Updated -

Issue

We have a table with a column xy that has the datatype CHAR(5). When executing a sql query like e.g.

SELECT xy FROM abc WHERE...

A java.lang.Character is returned. This leads to returning just the first character of the value.

Environment

JBoss Enterprise Application Platform all versions

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.