NutzCN Logo
问答 使用Trans.exec处理事物能不能得到返回值
发布于 2381天前 作者 撒哈拉来的企鹅 1592 次浏览 复制 上一个帖子 下一个帖子
标签:

在一个方法中的Trans.exec中执行多个update,能不能返回某一个update的返回值

2 回复

仔细看Trans类的方法

抱歉没有仔细看文档

public static int testexec(){
        Molecule<Object> molecule = new Molecule<Object>() {
            public void run() {
                setObj(123);
            }
        };
        Trans.exec(molecule);
        return Convert.toInt(molecule.getObj());

    }

    public static void main(String[] args) {
        System.out.println(testexec());
    }
添加回复
请先登陆
回到顶部