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.
The RESTful Web Service from Entity Classes Wizard was being used against a Derby database table that employs a composite primary key. When the entity classes are contained within the same NetBeans project as the RESTful web service classes, the project build successfully and rund correctly. When the entity classes are in a linked project's jar file, then the composite key is not handled properly and the generated RESTful web service code will not compile.
Created attachment 75260 [details] Zip file containing three NetBeans 6.5 projects to demonstrate problem.
Here is the AircraftConverter constructor code from the RestServerWithoutEntityClasses project. It fails to compile. In this case the entity classes are located in an external jar file (in the RestServerWithoutEntityClasses project). public AircraftConverter(Aircraft entity, URI uri, int expandLevel, boolean isUriExtendable) { this.entity = entity; this.uri = (isUriExtendable) ? UriBuilder.fromUri(uri).path(entity.getAircraftPK().getAircraftPK() + "," + entity.getAircraftPK().getManufacturer() + "," + entity.getAircraftPK().getType() + "," + entity.getAircraftPK().getModel() + "/").build() : uri; this.expandLevel = expandLevel; } The following is the AircraftConverter constructor code from the RestServerWithEntityClasses project. This is the case where the entity classes are located in the same project as the RESTful web service classes. This example compiles correctly. public AircraftConverter(Aircraft entity, URI uri, int expandLevel, boolean isUriExtendable) { this.entity = entity; this.uri = (isUriExtendable) ? UriBuilder.fromUri(uri).path(entity.getAircraftPK().getOperatorIcaoCode() + "," + entity.getAircraftPK().getTailNumber() + "/").build() : uri; this.expandLevel = expandLevel; } As previously mentioned, if the primary key is removed from the database table design, then this problem disappears. It is possible to place the entity classes in an external jar file and use the "RESTful Web Services from Entity Classes" wizard to generate the code.
The issue is still valid.
Fixed: http://hg.netbeans.org/main/rev/7d1664cf1fdd
Integrated into 'main-golden', will be available in build *201005260001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/7d1664cf1fdd User: mkuchtiak@netbeans.org Log: #155972: fixed problem with fields for Primary keys
v.
main #7d1664cf1fdd transplanted to release691 #419c6ba3e06d