⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 instructordaohibernate.java

📁 Sample for Spring coding
💻 JAVA
字号:
package com.springinaction.training.dao.hibernate;import java.util.List;import org.springframework.orm.hibernate.support.HibernateDaoSupport;import com.springinaction.training.dao.InstructorDao;import com.springinaction.training.model.Instructor;public class InstructorDaoHibernate extends HibernateDaoSupport    implements InstructorDao {  private static final org.apache.log4j.Logger LOGGER = org.apache.log4j.Logger      .getLogger(InstructorDaoHibernate.class);    public void createInstructor(Instructor instructor) {    getHibernateTemplate().save(instructor);  }    public void updateInstructor(Instructor instructor) {    getHibernateTemplate().update(instructor);  }      public List findAllInstructors() {    return getHibernateTemplate().find(        "from "+Instructor.class.getName() + " as i " +        " order by i.lastName,i.firstName");  }    public Instructor getInstructor(String login) {    return (Instructor)         getHibernateTemplate().get(Instructor.class, login);  }    public void deleteInstructor(Instructor instructor) {    getHibernateTemplate().delete(instructor);  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -