@@ -0,0 +1,2393 @@
+/*%0A * Copyright 2016 Gustavo Pacheco %3Cryctabo@gmail.com%3E.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage co.edu.unicartagena.platf.dao;%0A%0Aimport co.edu.unicartagena.platf.entity.IEntity;%0Aimport java.util.List;%0Aimport javax.persistence.EntityManagerFactory;%0Aimport javax.persistence.Persistence;%0A%0A/**%0A * @param %3CT%3E Entity Class%0A * @param %3CI%3E Data type of primary key or id of entity%0A *%0A * @author Gustavo Pacheco %3Cryctabo@gmail.com%3E%0A * @version 0.1%0A */%0Apublic class EntityDAO%3CT extends IEntity, I%3E implements DataAccessObject%3CT, I%3E %7B%0A    %0A    /**%0A     * Entity class.%0A     */%0A    protected Class%3CT%3E entityClass;%0A    %0A    /**%0A     * the name of persistence unit of datasource for connection in the database.%0A     */%0A    public static final String PERSISTENCE_UNIT = %22unicartagenaPU%22;%0A%0A    /**%0A     * The entity manager factory created by persistence unit.%0A     */%0A    private static final EntityManagerFactory FACTORY = %0A            Persistence.createEntityManagerFactory(PERSISTENCE_UNIT);%0A%0A    public EntityDAO(Class%3CT%3E entityClass) %7B%0A        this.entityClass = entityClass;%0A    %7D%0A    %0A    @Override%0A    public List%3CT%3E findAll() %7B%0A        throw new UnsupportedOperationException(%22Not supported yet.%22);%0A        //To change body of generated methods, choose Tools %7C Templates.%0A    %7D%0A%0A    @Override%0A    public T find(I id) %7B%0A        throw new UnsupportedOperationException(%22Not supported yet.%22);%0A        //To change body of generated methods, choose Tools %7C Templates.%0A    %7D%0A%0A    @Override%0A    public T save(T entity) %7B%0A        throw new UnsupportedOperationException(%22Not supported yet.%22);%0A        //To change body of generated methods, choose Tools %7C Templates.%0A    %7D%0A%0A    @Override%0A    public void delete(I id) %7B%0A        throw new UnsupportedOperationException(%22Not supported yet.%22);%0A        //To change body of generated methods, choose Tools %7C Templates.%0A    %7D%0A    %0A%7D%0A

Create EntityDAO