generic dao work

This commit is contained in:
eugenp 2013-06-01 15:09:13 +03:00
parent 044e6a3312
commit 2cf72a18ee
3 changed files with 21 additions and 1 deletions

View File

@ -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

View File

@ -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> {
//
}

View File

@ -0,0 +1,7 @@
package org.baeldung.persistence.dao.common;
import java.io.Serializable;
public interface IGenericDao<T extends Serializable> extends IOperations<T> {
//
}