sql简单学习---备忘

2:Hibernate

sql简单学习---备忘

    public boolean deleteFlowerById(int id) {
        Session session = sessionFactory.openSession();
        Transaction ts = session.beginTransaction();
        System.out.println("id--------:"+id);
        Query query=session.createQuery("from Flower where flowerid="+id);
        List flowers=query.list();
        session.delete((Flower) flowers.get(0));
        ts.commit();
        session.close();
        return true;
    }

 

相关文章:

  • 2021-07-26
  • 2021-11-17
  • 2021-11-13
  • 2021-08-26
  • 2022-12-23
  • 2022-12-23
  • 2022-01-30
  • 2022-01-15
猜你喜欢
  • 2022-02-22
  • 2021-11-09
  • 2021-09-01
  • 2022-12-23
  • 2021-10-18
  • 2021-08-06
相关资源
相似解决方案