?? createtestdata.java
字號(hào):
package com.xaccp.biz.test;
import java.io.FileInputStream;
import java.io.InputStream;
import java.sql.Blob;
import java.util.List;
import org.hibernate.lob.BlobImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import com.xaccp.biz.dao.*;
import com.xaccp.biz.po.*;
public class CreateTestData {
private static ApplicationContext context;
public static void 創(chuàng)建2個(gè)用戶() {
UserDAO userDAO = UserDAO.getFromApplicationContext(context);
try {
InputStream f1 = new FileInputStream("e:/temp/5.gif");
Blob b1 = new BlobImpl(f1, f1.available());
InputStream f2 = new FileInputStream("e:/temp/6.gif");
Blob b2 = new BlobImpl(f2, f2.available());
userDAO.save(new User("劉松", "123", b1, null, null));
userDAO.save(new User("吳青", "123", b2, null, null));
} catch (Exception e) {
e.printStackTrace();
}
}
public static void 創(chuàng)建10個(gè)功能節(jié)點(diǎn)() {
FunDAO funDAO = FunDAO.getFromApplicationContext(context);
funDAO.deleteAll();
Fun f0 = new Fun(null, "功能菜單","","","",null,null);
Fun f1 = new Fun(f0,"常規(guī)管理","","main","",null,null);
Fun f2 = new Fun(f1,"用戶管理","","main","",null,null);
Fun f3 = new Fun(f1,"權(quán)限管理","","main","",null,null);
Fun f4 = new Fun(f1,"白板筆管理","","","",null,null);
Fun f5 = new Fun(f0,"財(cái)務(wù)管理","","","",null,null);
Fun f6 = new Fun(f5,"工資管理","","","",null,null);
Fun f7 = new Fun(f5,"收費(fèi)管理","","","",null,null);
Fun f8 = new Fun(f6,"全職工資管理","","","",null,null);
Fun f9 = new Fun(f6,"兼職工資管理","","","",null,null);
funDAO.save(f0);
funDAO.save(f1);
funDAO.save(f2);
funDAO.save(f3);
funDAO.save(f4);
funDAO.save(f5);
funDAO.save(f6);
funDAO.save(f7);
funDAO.save(f8);
funDAO.save(f9);
}
public static void main(String[] args) {
context = new FileSystemXmlApplicationContext(new String[]{"WebRoot/WEB-INF/spring.xml","WebRoot/WEB-INF/spring_test.xml"});
//創(chuàng)建10個(gè)功能節(jié)點(diǎn)();
創(chuàng)建2個(gè)用戶();
System.out.println("完成........................................");
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -