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.
Use database schema attached in issue 76916, generate entity class for Table713 -> IOException is thrown
IOE is caused by NPE, null is passed in list of Fields to createConstructor method
The problem is that Table713 has no primary key in the dbschema (the index has a unique true, but not primary true). This table should be grayed out in the available tables panel with the (no primary key) note.
More info: When debugging in DbSchemaEjbGenerator, the pk is not null (so maybe it really has one which is why it's not grayed out), *but* the test for pk.getColumn(cols[col].getName()) != null for the column involved (ID) fails because the column is named like this "newSchema.table713.ID" as it should be, but the column in the pk is named like this "newSchema.table294.ID" which is definitely wrong! Where did you get this dbschema? Is it possible it was corrupted or modified by hand?
Jan Horvath generated a 1000 tables database using a script and generated the schema from that database. I have asked, but it is quite unlikely that he modified it by hand.
Changing to db/dbschema - this is either a corrupt dbschema or a problem reading it in.
dprusa: Is this still an issue, or can we close it? If it's still an issue, can someone please give me a reproduction? Thanks.
I think, this issue is no longer relevant for nb 6.x, we can close it.
I think someone should try it before deciding it's not relevant. There are very clear instructions and dbschema code hasn't changed, so chances are the bug still exists.
OK, thanks, I'll try it.
Phew! The schema file is indeed corrupted because of a bug in the XML serializer. The serializer uses the FQN and hash code of an object in an attempt to generate an unique name for this object. This is obviously not enough, since two objects, even of the same class, can have the same hash code. In this case it seems the UniqueKeyElementImpl of table294 and that of table713 had the same identity hash code (the hashCode() method for this class is not overridden). So the UKEI of table294 was serialized, but that of table713 wasn't and the one of table294 was used instead. 21cdf8a16221
Integrated into 'main-golden', available in build *200808080201* on http://bits.netbeans.org/dev/nightly/ Changeset: http://hg.netbeans.org/main/rev/21cdf8a16221 User: Andrei Badea <abadea@netbeans.org> Log: #80307: IOException while generating entity class