A question I've seen show up quite often in Hibernate forums is 'How do
I get Hibernate to generate UTF-8 Compliant Tables and/or columns when
it generates my database tables when using mySQL?'
actually, quite easy to do, but often (myself included), people end up
looking deep into Hibernate for some mysterious setting.
reality, it's just a question of setting up your database correctly.
The first thing you need to do is set your database to use UTF-8
character coding as its default, like so, when creating it:
create database my_new_database default CHARACTER SET = utf8 default COLLATE = utf8_general_ci;
This will ensure all tables that are created by ColdFusion's ORM are created with a UTF-8 character set.
That being said, I have seen issues when data is being sent up to MySQL in UTF-8 form getting corrupted. To ensure the database drivers use the correct character set as well we add useUnicode=true&characterEncoding=UTF-8 to our MySQL connection string in the ColdFusion Admin under the datasource's Advanced Settings.
There you go! UTF-8 support in mySQL with ColdFusion ORM!