public long testCodeTable() throws DAOException {
long start = System.currentTimeMillis();
@SuppressWarnings("unchecked")
List list =
getHibernateTemplate().find("from ActiveCodeTable");
HashSet tset = new HashSet(list);
String chars = "abcdefghijklmnopqrstuvwx
yzABCDEFGHIJKLMNOPQRSTUV
WXYZ0123456789";
String str="";
for (int j = 0; j < 10000; j++) {
ActiveCodeTable activeCodeTable= new ActiveCodeTable();
str="dvlt";
for (int i = 0; i < 12; i++) {
char a = chars.charAt((int)(Math.random() * 62));
str=str+String.valueOf(a);
}
activeCodeTable.setActiveCode(str);
tset.add(activeCodeTable);
}
getHibernateTemplate().saveOrUpdateAll(tset);
long end = System.currentTimeMillis();
System.out.println(end-start);
return end-start;
}
11294
11321
11547
11294
11321
11547