Search code examples
javahibernategrailsgrails-orm

hibernate type yes_no with 'J' instead of 'Y'


I have to map a character(1) field in the database to a gorm attribute. The field in the database is clearly a "yes_no" type, but with the exception, that the 'Y' should have the german expression 'J'.

Is there a way to handle it, or should I use a char field instead of a boolean in my gorm-class?

Thanks in advance,


Solution

  • I solved this issue with a Custom-User-Type which uses a boolean type in the grails/gorm domain class and the 'J'/'N' representation on the database side.

    Prepared a github rep under:

    grails-gorm-ja_nein_type