当我启动我的应用程序时,eclipselink 设置为自动删除并在数据库中创建表。我已将其设置为使用表创建后缀创建 InnoDB 引擎。但是,我希望文本编码为 utf8_unicode_ci。我如何设置我的 xml 文件来实现这一点。现在,它默认为 utf8_general_ci。
<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSc...>
<persistence-unit name="Data">
<class>com.core.objects.StandardObject</class>
<properties>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/data" />
<property name="javax.persistence.jdbc.user" value="username" />
<property name="javax.persistence.jdbc.password" value="password" />
<!-- EclipseLink should create the database schema automatically -->
<property name="eclipselink.ddl-generation" value="drop-and-create-tables" />
<property name="eclipselink.ddl-generation.output-mode" value="database" />
<property name="eclipselink.ddl-generation.table-creation-suffix" value="engine=InnoDB " />
</properties>
</persistence-unit>
</persistence>