0

少数のエンティティで GenericDao を使用しており、このエンティティを使用して単一のインターフェイスとその実装を作成したいと考えています。GenericDao を拡張する 2 つの Dao のインターフェイスとその実装があり、それらを 1 つのインターフェイスとその実装に結合したいと考えています。

そんな感じ:

Entity1Dao:

public interface Entity1Dao extends GenericDao<Entity1, String>{

public List<Entity1> getAllFromEntity1();
...
}

Entity2Dao:

public interface Entity2Dao extends GenericDao<Entity2, String>{

public List<Entity2> getAllFromEntity2();
...
}

そして、私はそれらを組み合わせて、次のようなものを作りたいです:

public interface MultyDao extends GenericDao<*I do not know what needs to be here*>{

public List<Entity1> getAllFromEntity1();

public List<Entity2> getAllFromEntity2();
}

そしてそれを実装する..

GenericDao は次のとおりです。

package org.dao.nci.person;

import java.io.Serializable;
import java.util.List;

import javax.jws.WebMethod;
import javax.jws.WebService;

import org.springframework.transaction.annotation.Transactional;
public interface GenericDao<E,K> {
@WebMethod(exclude = true)
public String add(List<E> entities) throws Exception;
@WebMethod(exclude = true)
public String saveOrUpdate(List<E> entity) throws Exception;
@WebMethod(exclude = true)
public String update(E entity, String whereClause) ;
@WebMethod(exclude = true)
public String remove(E entity) throws Exception;
@WebMethod(exclude = true)
public String removeWhereClause(String whereClause) throws Exception;
@WebMethod(exclude = true)
public E find(K key);
@WebMethod(exclude = true)
public List <E> get(String whereClause) throws Exception ;

public String addTest(List<E> entities) throws Exception;

}

そして、両方のエンティティに GenericDao のメソッドを使用したい..)

どういうわけかそれは可能ですか?

4

0 に答える 0