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.
Summary: | RESTful Wizard generates code that will not compile | ||
---|---|---|---|
Product: | webservices | Reporter: | nthompson <nthompson> |
Component: | REST | Assignee: | Milan Kuchtiak <mkuchtiak> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | rbalada |
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | Windows Vista | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | Zip file containing three NetBeans 6.5 projects to demonstrate problem. |
Description
nthompson
2008-12-23 03:11:54 UTC
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. 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 |