This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I generated a new Entity class from a MySQL database table. According to MySQL JDBC spec, the unsigned field is returned as a Long. But the Entity class generated by NetBeans 6.0 creates an Integer, instead of Long. This causes run time exceptions when a value larger than 2^31 is returned. The behavior is the same for 5.5.
I believe this belongs to j2ee support.
Just to be clear, is this about the "EJB entity beans" in an J2EE 1.4 EJB module? Or does this relate to the "Java Persistence", which is a part of Java EE 5?
I was generating classes for Java EE5.
Ok, in this case this belongs to Java Persistence, changing the category accordingly.
I don't know a database-independent way to detect an unsigned column. Both INT and INT UNSIGNED are mapped to java.sql.Types.INTEGER, and both have a column size of 10. The only way I can think of is to look at the TYPE_NAME column of java.sql.DatabasMetaData.getColumns(), but that would make the generation process database-dependent. It currently isn't, and there is no clean, practical way to make it so for 6.1. I would prefer avoiding a hack like if (isMySQL() && typeName.contains("UNSIGNED")).