@@ -0,0 +1,711 @@
+/**%0A * Created by Siclait on 19/6/16.%0A */%0A%0Apackage Service;%0A%0Aimport org.hibernate.QueryException;%0A%0Aimport javax.persistence.*;%0Aimport javax.persistence.criteria.CriteriaQuery;%0A%0Apublic class GenericORMService%3CT%3E %7B%0A%0A    private static  EntityManagerFactory emf;%0A    private Class%3CT%3E classEntity;%0A%0A    // Consturctor%0A    public GenericORMService(Class%3CT%3E classEntity)%7B%0A%0A        if(emf == null)%0A            emf = Persistence.createEntityManagerFactory(%22PersistenceUnit%22);%0A%0A        this.classEntity = classEntity;%0A    %7D%0A%0A    public EntityManager GetEntityManager()%7B return emf.createEntityManager(); %7D%0A%0A    // Class Methods%0A    public void Create(T entity)%7B%0A%0A        EntityManager em = GetEntityManager();%0A%0A    %7D%0A%0A%7D%0A

Create GenericORMService