In eclipse JPA Entities from Tables it's convert column byte from mysql to byte in java.
How can i change to boolean (Netbeans can generate correctly)?
Thanks in advance for answer.
In eclipse JPA Entities from Tables it's convert column byte from mysql to byte in java.
How can i change to boolean (Netbeans can generate correctly)?
Thanks in advance for answer.
[Hmmmm. I don't see that the MySQL documentation says it has a data type of BYTE
. Maybe you are mean BIT
?]
Either way:
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, for MySQL, the data type BIT
(along with BOOL
and BOOLEAN
) is mapped to the Java type byte
in the file
/runtime/vendors/MySql_5.1/MySql_5.1.xmi
in the plug-in jar
./plugins/org.eclipse.datatools.enablement.mysql.dbdefinition_1.0.4.v201109022331
.
You can extract the appropriate .xmi
file, edit it, and return it to its jar and this should alter how entities are generated.