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.
- Set up MySQL. - Set up the Sakila database (http://dev.mysql.com/doc/#sampledb) - Run the Entity Classes from Database wizard on all tables except film_text, creating a persistence unit with "None" for the table generation strategy. (You can put the generated entities in a package called "sakila".) - Take a look at Film.java, for instance. The id field is: @Id @Column(name = "film_id", nullable = false) private Short filmId; Notice there is nothing like @GeneratedValue(strategy = GenerationType.AUTO). I'm not sure this is correct, given that the column is auto-increment: CREATE TABLE film ( film_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT, ... Can this be addressed for 6.1? This issue affects the JSF Pages from Entity Class wizard.
Sorry, there is no way to fix this for 6.1. *** This issue has been marked as a duplicate of 76357 ***
I do not understand why this would be a difficult fix. Can't the IDE invoke java.sqlDatabaseMetaData.getColumns and look at the IS_AUTOINCREMENT value?
Not for 6.1 for a couple of reasons: - IS_AUTOINCREMENTED was added in JDBC 4. Older drivers won't support it, and even JDBC 4 drivers would need to be tested. This should be done at the beginning of the release, not at the end. - the entity class generator doesn't use the DMD directly. There is a database model layer in the middle that would need to be updated too.
For the record, though, the MySQL Connector/J driver does seem to support IS_AUTOINCREMENT.