Submitted by Marnix (not verified) on Fri, 2009-07-24 05:19.
Hi,
On the internet I see many examples of generic Hibernate dao's. Great! The examples I found use a class (Customer) to create the interface of the Hibernate dao to retrieve customers. In my code, I always use a interface for the pojo object and an implementation. So I want this code:
public interface CustomerDao extends GenericDao {
ICustomer getCustomerByName(String name);
List searchCustomersByName(String name);
}
The implementation should implement this CustomerDao interface and of course must know about the pojo class Customer (which implements ICustomer).
My question is: How can I create a generic interface for the Customer dao, which uses ICustomer objects in the interface, but let the implementation of this dao interface know about the pojo class it should use.
How about POJO Interface
Hi,
On the internet I see many examples of generic Hibernate dao's. Great! The examples I found use a class (Customer) to create the interface of the Hibernate dao to retrieve customers. In my code, I always use a interface for the pojo object and an implementation. So I want this code:
public interface CustomerDao extends GenericDao {
ICustomer getCustomerByName(String name);
List searchCustomersByName(String name);
}
The implementation should implement this CustomerDao interface and of course must know about the pojo class Customer (which implements ICustomer).
My question is: How can I create a generic interface for the Customer dao, which uses ICustomer objects in the interface, but let the implementation of this dao interface know about the pojo class it should use.