This commit is contained in:
@@ -74,7 +74,7 @@ public class SncpTest {
|
||||
callbean.setId(1);
|
||||
callbean.setContent("数据X");
|
||||
|
||||
service.updateBean(callbean);
|
||||
service.insert(callbean);
|
||||
System.out.println("bean.id应该会被修改: " + callbean);
|
||||
System.out.println("---------------------------------------------------");
|
||||
final int count = 10;
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.wentch.redkale.convert.bson.*;
|
||||
import com.wentch.redkale.convert.json.*;
|
||||
import com.wentch.redkale.source.*;
|
||||
import com.wentch.redkale.util.*;
|
||||
import javax.persistence.*;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -16,6 +17,7 @@ import com.wentch.redkale.util.*;
|
||||
*/
|
||||
public class SncpTestBean implements FilterBean {
|
||||
|
||||
@Id
|
||||
private long id;
|
||||
|
||||
private String content;
|
||||
|
||||
@@ -7,6 +7,7 @@ package com.wentch.redkale.test.sncp;
|
||||
|
||||
import com.wentch.redkale.net.sncp.*;
|
||||
import com.wentch.redkale.service.*;
|
||||
import com.wentch.redkale.source.*;
|
||||
import com.wentch.redkale.util.*;
|
||||
|
||||
/**
|
||||
@@ -34,16 +35,24 @@ public class SncpTestService implements Service {
|
||||
|
||||
@Override
|
||||
public Long get(SncpTestBean obj) {
|
||||
System.out.println("返回ID: " + obj.getId());
|
||||
return obj.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(SncpTestBean obj, Long value) {
|
||||
System.out.println("设置ID: " + value);
|
||||
obj.setId(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void insert(@SncpCall(EntityCallAttribute.class) SncpTestBean... beans) {
|
||||
for (SncpTestBean bean : beans) {
|
||||
bean.setId(System.currentTimeMillis());
|
||||
}
|
||||
}
|
||||
|
||||
public String queryResult(SncpTestBean bean) {
|
||||
System.out.println(Thread.currentThread().getName() + " 运行了queryResult方法");
|
||||
return "result: " + bean;
|
||||
@@ -55,4 +64,5 @@ public class SncpTestService implements Service {
|
||||
System.out.println(Thread.currentThread().getName() + " 运行了updateBean方法");
|
||||
return "result: " + bean;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user