Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Character set / encoding in tables ?

Hi Tom,

Thanks for the info. I've done as you said, and made a class which can parse the generated file, adding the info (engine, auto_increment and character set) and writing it out to another file. That file is then being automatically executed in mysql. The process is started from a unit test, which tests and sets up my entire database for a development setup.


On Mon, Feb 9, 2009 at 2:42 PM, Tom Ware <tom.ware@xxxxxxxxxx> wrote:
Hi Kaspar,

 JPA table creation is intended to provide some basic table creation.  If you want something that goes beyond the basics, I suggest you use EclipseLink to output the DDL generation statements and then edit them to be what you want.

 You can do that by setting the following properties in your persistence.xml.

"eclipselink.ddl-generation" can be set to either "create-tables" or "drop-and-create-tables"

"eclipselink.ddl-generation.output-mode" can be set to "sql-script"

"eclipselink.create-ddl-jdbc-file-name" and "eclipselink.drop-ddl-jdbc-file-name" should be set to the appropriate file location.


Kasper Hansen wrote:

I can't seem to find anywhere to set what encoding I want in my tables (the DEFAULT CHARSET statement after a create table) ? Right now it's defaulted to "latin1" in my mySQL database. I would like it to be UTF-8.

Also, where do I specify InnoDB engine, and not the default MyISAM, if I want that (the ENGINE statement after a create table) ?


:-) Kasper


eclipselink-users mailing list
eclipselink-users mailing list

Back to the top