Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Commit

Permalink
生成的服务接口可以定义create方法的名字
Browse files Browse the repository at this point in the history
  • Loading branch information
codefollower committed Oct 31, 2022
1 parent 4f4d616 commit 36b0f0a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
package org.lealone.plugins.test.orm;

import org.lealone.db.service.ServiceSetting;
import org.lealone.plugins.test.service.ExecuteServiceTest;
import org.lealone.plugins.test.service.impl.AllTypeServiceImpl;
import org.lealone.plugins.test.service.impl.HelloWorldServiceImpl;
Expand Down Expand Up @@ -228,6 +229,7 @@ public static void createHelloWorldService(SqlExecutor executor) {
+ " say_goodbye_to(name varchar) varchar" //
+ " ) package '" + SERVICE_PACKAGE_NAME + "'" //
+ " implement by '" + HelloWorldServiceImpl.class.getName() + "'" //
+ " generate code '" + GENERATED_CODE_PATH + "'");
+ " generate code '" + GENERATED_CODE_PATH + "'" //
+ " parameters(" + ServiceSetting.CREATE_METHOD_NAME + "='_create')");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private static void createService(SqlExecutor executor) {
}

private static void executeService(String url) {
HelloWorldService helloWorldService = HelloWorldService.create(url);
HelloWorldService helloWorldService = HelloWorldService._create(url);
helloWorldService.sayHello();
String r = helloWorldService.sayGoodbyeTo("zhh");
System.out.println(r);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ public interface HelloWorldService {

String sayGoodbyeTo(String name);

static HelloWorldService create() {
return create(null);
static HelloWorldService _create() {
return _create(null);
}

static HelloWorldService create(String url) {
static HelloWorldService _create(String url) {
if (url == null)
url = ClientServiceProxy.getUrl();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private static void createService(SqlExecutor executor) {
}

private static void callService(String url) {
HelloWorldService helloWorldService = HelloWorldService.create(url);
HelloWorldService helloWorldService = HelloWorldService._create(url);
helloWorldService.sayHello();
String r = helloWorldService.sayGoodbyeTo("zhh");
System.out.println(r);
Expand Down

0 comments on commit 36b0f0a

Please sign in to comment.