Closed blandger closed 6 years ago
After temporal replacing UUID to String type and tweaking other issues, I still have problem with code generation by Gradle.
@ProxyGen
@VertxGen
public interface MyEntityServiceAsynch {
void save(MyEntityDTO entity, Handler<AsyncResult<String>> resultHandler);
void retrieveByExample(MyEntityDTO entityQueryByExample, Handler<AsyncResult<List<MyEntityDTO>>> resultHandler);
....}
The gradle config example from : vertx-codegen/README.md produces the same error about 'incorrect outputDirectory'. Something has changed in gradle 4.3.1 probably...
service/MyEntityServiceAsynch.java:25: error: Could not generate model for ....service.MyEntityServiceAsynch: Overloaded method create must have the same return type .....service.MyEntityServiceAsynch != void
public interface MyEntityServiceAsynch {
^
warning: The following options were not recognized by any processor: '[outputDirectory]'
1 error
Could not generate model for ....service.MyEntityServiceAsynch: Overloaded methods are not allowed in ProxyGen interfaces create
io.vertx.codegen.GenException: Overloaded methods are not allowed in ProxyGen interfaces create
at io.vertx.codegen.ProxyModel.checkMethod(ProxyModel.java:111)
at io.vertx.codegen.ClassModel.addMethod(ClassModel.java:826)
........
Removing method:
void retrieveByExample(MyEntityDTO entityQueryByExample, Handler<AsyncResult<List<MyEntityDTO>>> resultHandler);
resolves problem, because it clashes with first method:
void save(MyEntityDTO entity, Handler<AsyncResult<String>> resultHandler);
The service interface constraints are listed here: https://github.com/vert-x3/vertx-service-proxy/blob/master/src/main/asciidoc/java/index.adoc#restrictions-for-service-interface
It's not possible to use UUID or a list/set of dataobjects. For UUID, going through String representation is a good idea. For dataobjects collections, you could create your own annotated with @Dataobject
Hi vertx folks, I would like to ask question related to Service Proxy java code generation. Gradle 4.3.1 is used.
1. How can I use UUID as part of ServiceProxy generation? (we use java UUID and Cassandra datastax driver time-based UUID classes) 2. Are Collection/List/Set/Stream with custom type supported as incoming and return parameters?
I'm trying to use example from here as reference: https://github.com/advantageous/vertx-node-ec2-eventbus-example/wiki/Step-5-Using-Vertx-Service-Proxies
e.g. I have DTO as:
Service Proxy Interface like:
I have 'package-info.java' files in folders, but don't understand how can I generate UUIDs as part of Service contract ? Can someone give a hint?
I'm appreciate for any hint.