generic dao work
This commit is contained in:
parent
044e6a3312
commit
2cf72a18ee
|
@ -24,7 +24,7 @@ public abstract class AbstractHibernateDao<T extends Serializable> implements IO
|
|||
|
||||
@Override
|
||||
public final T findOne(final long id) {
|
||||
return ((T) getCurrentSession().get(clazz, id));
|
||||
return (T) getCurrentSession().get(clazz, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
package org.baeldung.persistence.dao.common;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
|
||||
public class GenericHibernateDao<T extends Serializable> extends AbstractHibernateDao<T> implements IGenericDao<T> {
|
||||
//
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package org.baeldung.persistence.dao.common;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public interface IGenericDao<T extends Serializable> extends IOperations<T> {
|
||||
//
|
||||
}
|
Loading…
Reference in New Issue