Reply to comment

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.

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.