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.

Bug 154972

Summary: Metadata API: JDBC... Classes need sane implementation of hashCode/equals
Product: db Reporter: Rob Englander <mindstream>
Component: DB schemaAssignee: Libor Fischmeistr <lfischmeistr>
Status: NEW ---    
Severity: blocker    
Priority: P4    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Rob Englander 2008-12-08 22:19:28 UTC
The generation of the internalName using an incremented counter in JDBCForeignKey means that two equivalent instances
will have different hash codes.
Comment 1 David Vancouvering 2008-12-09 00:43:44 UTC
The problem here is that often a foreign key has no name; I guess I can give it an internal name based on the table and
column(s), rather than using a counter.  That way if the key is the same from refresh to refresh we'll detect it as the
same.

I'll look into this.
Comment 2 Jiri Rechtacek 2009-02-10 15:13:15 UTC
Reassigned to new owner.
Comment 3 matthias42 2012-03-17 22:00:56 UTC
The original reporter is right and wrong - if a sane implementation of hashCode was based on internalName, it would show the described error. But there is no implementation of HashCode or equals, so the object base implementations are invoked - with these the hashCode is _always_ different.

Still implementing the methods should be done and this should be considered.