实体类
package entity;
public class dl {
private String id;
private String name;
public dl() {
super();
// TODO Auto-generated constructor stub
}
public dl(String id, String name) {
super();
this.id = id;
this.name = name;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
util
package action;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import entity.dl;
public class test {
Configuration cf = null;
SessionFactory sf = null;
Session s = null;
Transaction tt = null;
@Before
public void before() {
//加载hibernate的配置文件
cf = new Configu