Why does Eclipse propose “Object” as default mapping type for datatype “Text”?

后端 未结 1 1498
南笙
南笙 2020-12-04 03:31

When generating JPA Entities from tables with Eclipse (Juno 4.2 for Java EE Developers) it proposes Object as default mapping type for properties I set to be

相关标签:
1条回答
  • 2020-12-04 04:05

    Dali (the part of Eclipse that generates JPA entities) uses DTP (another part of Eclipse) to determine the Java attribute type for a particular data type. These mappings are database platform-specific and are specified in .xmi files in various DTP plug-ins.

    For example, in Juno, for PostgreSQL, the data type ABSTIME is mapped to the Java type java.lang.Object in the file /runtime/vendors/postgresql/postgresql_8.x.xmi in the plug-in jar ./plugins/org.eclipse.datatools.enablement.postgresql.dbdefinition_1.0.2.v201110070445.jar.

    Depending on your database platform and what other plug-ins you have installed, these settings could have changed between Indigo and Juno. You can extract the appropriate .xmi file, edit it, and return it to its jar and this should alter how entities are generated.

    0 讨论(0)
提交回复
热议问题