public class GenericDaoHibernate<T, PK extends Serializable>
-------------------------------抽象方法-------------------------------------
public GenericDaoHibernate(final Class<T> persistentClass) {
this.persistentClass = persistentClass;
} /**
* Constructor that takes in a class and sessionFactory for easy creation of DAO.
*
* @param persistentClass the class type you'd like to persist
* @param sessionFactory the pre-configured Hibernate SessionFactory
*/
public GenericDaoHibernate(final Class<T> persistentClass, SessionFactory sessionFactory) {
this.persistentClass = persistentClass;
this.sessionFactory = sessionFactory;
this.hibernateTemplate = new HibernateTemplate(sessionFactory);
}
-------------------------------------------------------------------------------------------
这个T和PK是什么东西啊,有什么用,应该传什么值进去。
T是泛型应该,那PK呢????求大神
-------------------------------抽象方法-------------------------------------
public GenericDaoHibernate(final Class<T> persistentClass) {
this.persistentClass = persistentClass;
} /**
* Constructor that takes in a class and sessionFactory for easy creation of DAO.
*
* @param persistentClass the class type you'd like to persist
* @param sessionFactory the pre-configured Hibernate SessionFactory
*/
public GenericDaoHibernate(final Class<T> persistentClass, SessionFactory sessionFactory) {
this.persistentClass = persistentClass;
this.sessionFactory = sessionFactory;
this.hibernateTemplate = new HibernateTemplate(sessionFactory);
}
-------------------------------------------------------------------------------------------
这个T和PK是什么东西啊,有什么用,应该传什么值进去。
T是泛型应该,那PK呢????求大神
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货