-
Notifications
You must be signed in to change notification settings - Fork 1
CodeGenerationPlatform_IDAO
Base idea behind the portlable applications/architecture is to have interface upon the each layer. Like a domain object has data interface, also the Data Access Object (DAO) has appropriate interface. This allows you to switch the implementation from one type to the another (e.g. from Hibernate implementation to App engine implementation). Like on the image above you can choose whether you want to use App engine schema ( Appengine DAO & Appengine entity) or hibernate schema (Hibernate DAO & Hibernate entity). This everything is possible thanks to two common interfaces - DAO interface and Data interface.
This interface can be pregenerated by annotation processor named sk.seges.corpis.core.pap.dao.DaoApiProcessor located in sk.seges.corpis:corpis-dao-api-processor:1.1.0-SNAPHOST jar.
Right after you annotate you Data interface with @DataAccessObject(provider = Provider.INTERFACE) annotation, DAO interface is generated.
package ...;
import sk.seges.corpis.core.shared.annotation.dao.DataAccessObject;
import sk.seges.corpis.core.shared.annotation.dao.DataAccessObject.Provider;
import sk.seges.sesam.domain.IDomainObject;
@DataAccessObject(provider = Provider.INTERFACE)
public interface PersonData extends IDomainObject<Long> {
String getName();
void setName(String name);
String getSurname();
void setSurname(String surname);
String getFax();
void setFax(String fax);
}
and the result should looks like this:
package ...;
import sk.seges.corpis.shared.model.PersonData;
import sk.seges.sesam.dao.ICrudDAO;
public interface IPersonDataDao<T extends PersonData> extends ICrudDAO<PersonData> {
}
