@@ -0,0 +1,1482 @@
+/*%0A * To change this license header, choose License Headers in Project Properties.%0A * To change this template file, choose Tools %7C Templates%0A * and open the template in the editor.%0A */%0Apackage com.rizki.mufrizal.belajarHibernate.util;%0A%0Aimport com.rizki.mufrizal.belajarHibernate.repository.MahasiswaRepository;%0Aimport com.rizki.mufrizal.belajarHibernate.repository.MahasiswaRepositoryImpl;%0Aimport org.hibernate.cfg.AnnotationConfiguration;%0Aimport org.hibernate.SessionFactory;%0A%0A/**%0A * Hibernate Utility class with a convenient method to get Session Factory%0A * object.%0A *%0A * @author rizki%0A */%0Apublic class HibernateUtil %7B%0A%0A    private static final SessionFactory sessionFactory;%0A    private static final MahasiswaRepository MAHASISWA_REPOSITORY;%0A    %0A    static %7B%0A        try %7B%0A            // Create the SessionFactory from standard (hibernate.cfg.xml) %0A            // config file.%0A            sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();%0A            MAHASISWA_REPOSITORY = new MahasiswaRepositoryImpl(sessionFactory);%0A        %7D catch (Throwable ex) %7B%0A            // Log the exception. %0A            System.err.println(%22Initial SessionFactory creation failed.%22 + ex);%0A            throw new ExceptionInInitializerError(ex);%0A        %7D%0A    %7D%0A    %0A    public static SessionFactory getSessionFactory() %7B%0A        return sessionFactory;%0A    %7D%0A%0A    public static MahasiswaRepository getMahasiswaRepository() %7B%0A        return MAHASISWA_REPOSITORY;%0A    %7D%0A%7D%0A

add hibernate util