Skip to content

Guschtel/enumconverter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EnumConverter

This repository demonstrates, that an enum field with a column definition with length of 1 cannot be persisted with Hibernate 6 when using the automatic Enum conversion provided by jakarta.persistence.Enumerated with jakarta.persistence.EnumType#STRING. See TestEntity#singleChar an SinglecharEnum

This is a reproducer for https://hibernate.atlassian.net/jira/software/c/projects/HHH/issues/HHH-17106?filter=reportedbyme

The failing example uses

  • EnumJunitTestCase.enumTestFailsWithEnumConverter
  • TestEntity
  • TestRepository

We also provide a simple workaround by using a simple AttributeConverter, that converts an enum to a Character. This is showcased with

  • EnumJunitTestCase.enumTestOkWithCustomConverter
  • TestWithConverterEntity
  • TestWithConverterRepository

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages