What type conversion functionality is supported with JPA 2.0 in JBoss EAP 6?

Solution Verified - Updated -

Issue

Does JPA 2.0 perform automatic data conversions (similar to those in JPA 2.1) between Java types and table column types or do I have to code the conversion explicitly using the @Convert and @Converter annotations? JPA 2.1, for instance, automatically handles the following conversions:

  • between boolean and numeric types: true == 1, false == 0
  • between java.sql.Timestamp and TIMESTAMP.

Environment

  • JBoss Enterprise Application Platform (EAP) 6
    • Hibernate 4/JPA 2.0

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.