use of test.po.Master in project eweb4j-framework by laiweiwei.
the class TestCascadeDAO method testManyManyUpdate.
/**
* 测试多对多更新
*/
public static void testManyManyUpdate() {
Master master = new Master().find().first();
master.cascade().refresh(999, "pets");
}
use of test.po.Master in project eweb4j-framework by laiweiwei.
the class TestCascadeDAO method testManyManySelect.
public static void testManyManySelect() {
// List<Master> masterList = DAOFactory.getSelectDAO().selectAll(
// Master.class);
// if (masterList != null) {
// for (Master m : masterList) {
// System.out.println(m + "|" + m.getPets());
// DAOFactory.getCascadeDAO().select(m, "pets");
// System.out.println(m.getPets());
// break;
// }
// }
// List<Pet> petList;
// try {
// petList = DAOFactory.getSelectDAO().selectAll(Pet.class);
// if (petList != null) {
// for (Pet p : petList) {
// System.out.println(p + "|" + p.getMasters());
// DAOFactory.getCascadeDAO().select(p);
// System.out.println(p.getMasters());
// break;
// }
// }
// } catch (DAOException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
List<Master> masterList = DAOFactory.getSelectDAO().selectAll(Master.class);
if (masterList != null) {
for (Master m : masterList) {
System.out.println(m + "|" + m.getPets());
DAOFactory.getCascadeDAO().select(m);
System.out.println(m + "|" + m.getPets());
break;
}
}
}
use of test.po.Master in project eweb4j-framework by laiweiwei.
the class TestCascadeDAO method testManyDelete.
public static void testManyDelete() {
List<Master> masterList;
try {
masterList = DAOFactory.getSelectDAO().selectAll(Master.class);
if (masterList != null) {
for (Master m : masterList) {
System.out.println(m + "|" + m.getPets());
DAOFactory.getCascadeDAO().delete(m, "pets");
}
}
} catch (DAOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Aggregations