sql简单学习---备忘
2:Hibernate
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;
}