@Entity @Table(name="orders") public class Order {  //1-m,多的一方为关系维护端,关系维护端负责外键记录的更新,关系被维护端没有权利更新外键记录  private String orderid;  private Float amount;  private Set<OrderItem> items = new HashSet<OrderIt

hibernate  

Hibernate的所有的操作都是通过Session完成的. 基本步骤如下: 1:通过配置文件得到SessionFactory: SessionFactory sessionFactory=new Configuration().configure().buildSessionFactory(); 2:通过SessionFactory 得到一个Session Session session=ses

hibernate   hql  

Hibernate执行sql语句: BasicServiceImpl basicServiceImpl = new BasicServiceImpl(); String hql = "select * from AccountInfo where selfId='0000100003' or(left(selfId,10)='0000100004' and? nodeSum=0)"; TManag

hibernate   sql