Hibernate is treating Collections as String in Criteria subsystem

Solution Verified - Updated -

Issue

  • In Hibernate 6, when calling "get()" on a root entity with a plural attribute, Hibernate treats that path as if it is a single attribute, and because the underlying elements are Strings, the path will report String.class as its Java type.
  • This issue only occurs when the @ElementCollection annotation is used.

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 8
  • Hiberante 6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content