提交 d5658e2b 编写于 作者: W wangliang

6.0 原理论文.

上级 54bf0147
......@@ -8,7 +8,7 @@ import org.apache.ibatis.annotations.Options;
@Mapper
public interface DemoMapper {
@Insert("insert into t_demo(name,module) values(#{name},#{module})")
@Insert("insert into lcn_demo(name,module) values(#{name},#{module})")
@Options(useGeneratedKeys = true, keyProperty = "id")
int save(Demo demo);
......
......@@ -5,6 +5,8 @@ import com.codingapi.example.tc.db.mapper.DemoMapper;
import com.codingapi.example.tc2.vo.DemoReq;
import com.codingapi.example.tc2.vo.DemoRes;
import java.util.Date;
import com.codingapi.txlcn.tc.annotation.LcnTransaction;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
......@@ -18,6 +20,7 @@ public class DemoService {
private DemoMapper demoMapper;
@Transactional
@LcnTransaction
public DemoRes save(DemoReq demoReq) {
Demo demo = new Demo();
demo.setName(demoReq.getName());
......
......@@ -2,7 +2,6 @@ spring.application.name=example-tc-1
server.port=8099
logging.level.com.codingapi=debug
#txlcn.tc.tms=127.0.0.1:8070
#txlcn.tc.protocol.max-write-idle-seconds=10
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/test
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.password=root
......
......@@ -7,7 +7,7 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface DemoMapper {
@Insert("insert into t_demo(name,module) values(#{name},#{module})")
@Insert("insert into lcn_demo(name,module) values(#{name},#{module})")
int save(Demo demo);
}
......@@ -3,8 +3,7 @@ server.port=8090
logging.level.com.codingapi=debug
txlcn.tc.tms=127.0.0.1:8070
txlcn.tc.protocol.max-write-idle-seconds=10
#txlcn.tc.tms=127.0.0.1:8070
txlcn.tc.application-name=example-tc
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/test
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册