Created
August 30, 2012 04:08
-
-
Save wendal/3522223 to your computer and use it in GitHub Desktop.
nutz 测试删除后再插入原本的记录
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DaoTest { | |
@Test | |
public void test_insert_after_del() { | |
dao.create(Pet.class, true); | |
dao.insert(Pet.create("wendal")); | |
Trans.exec(new Atom() { | |
public void run() { | |
dao.execute(Sqls.create("delete from t_pet")); | |
dao.insert(Pet.create("wendal")); | |
} | |
}); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Table("t_pet") | |
public class Pet { | |
@Id | |
private long id; | |
@Name | |
private String name; | |
public static Pet create(String name) { | |
Pet pet = new Pet(); | |
pet.name = name; | |
return pet; | |
} | |
//getter or setter | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment