title: org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
body: <p>I am actually new to hibernate and tried to set up 1 class, supplier.
  Here are some details.</p>
  
  <p>hibernate.cfg.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt;
  &lt;hibernate-configuration&gt;
     &lt;session-factory&gt;
        &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
        &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
        &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://localhost:3306/transaksi?zeroDateTimeBehavior=convertToNull&lt;/property&gt;
        &lt;property name="hibernate.connection.username"&gt;root&lt;/property&gt;
        &lt;property name="hibernate.show_sql"&gt;true&lt;/property&gt;
        &lt;property name="hibernate.query.factory_class"&gt;org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory&lt;/property&gt;
        &lt;property name="hibernate.format_sql"&gt;true&lt;/property&gt;
        &lt;mapping resource="Pojo/Supplier.hbm.xml"/&gt;
     &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>hibernate.reveng.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd"&gt;
  &lt;hibernate-reverse-engineering&gt;
     &lt;schema-selection match-catalog="transaksi"/&gt;
     &lt;table-filter match-name="supplier"/&gt;
  &lt;/hibernate-reverse-engineering&gt;
  </code></pre>
  
  <p>Supplier.hbm.xml</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"&gt;
  &lt;!-- Generated Jun 1, 2016 9:01:44 PM by Hibernate Tools 4.3.1 --&gt;
  &lt;hibernate-mapping&gt;
  &lt;class name="Pojo.Supplier" table="supplier" catalog="transaksi"    optimistic-lock="version"&gt;
      &lt;id name="kdSup" type="string"&gt;
          &lt;column name="kd_sup" length="25" /&gt;
          &lt;generator class="assigned" /&gt;
      &lt;/id&gt;
      &lt;property name="nmSup" type="string"&gt;
          &lt;column name="nm_sup" length="25" not-null="true" /&gt;
      &lt;/property&gt;
      &lt;property name="nmBrg" type="string"&gt;
          &lt;column name="nm_brg" length="25" not-null="true" /&gt;
      &lt;/property&gt;
      &lt;property name="hrg" type="int"&gt;
          &lt;column name="hrg" not-null="true" /&gt;
      &lt;/property&gt;
      &lt;property name="jml" type="int"&gt;
          &lt;column name="jml" not-null="true" /&gt;
      &lt;/property&gt;
      &lt;property name="tgl" type="date"&gt;
          &lt;column name="tgl" length="10" not-null="true" /&gt;
      &lt;/property&gt;
      &lt;property name="FStatus" type="int"&gt;
          &lt;column name="f_status" not-null="true" /&gt;
      &lt;/property&gt;
      &lt;property name="FUpdate" type="int"&gt;
          &lt;column name="f_update" not-null="true" /&gt;
      &lt;/property&gt;
  &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>Supplier.java</p>
  
  <pre><code>package Pojo;
  
  import java.util.Date;
  import javax.persistence.Entity;
  import javax.persistence.Id;
  import javax.persistence.Table;
  
  @Entity
  @Table(name ="supplier")
  public class Supplier  implements java.io.Serializable {
  
  
   @Id
   private String kdSup;
   private String nmSup;
   private String nmBrg;
   private String hrg;
   private String jml;
   private Date tgl;
   private String FStatus;
   private String FUpdate;
  
  public Supplier() {
  }
  
  public Supplier(String kdSup, String nmSup, String nmBrg, String hrg, String jml, Date tgl, String FStatus, String FUpdate) {
     this.kdSup = kdSup;
     this.nmSup = nmSup;
     this.nmBrg = nmBrg;
     this.hrg = hrg;
     this.jml = jml;
     this.tgl = tgl;
     this.FStatus = FStatus;
     this.FUpdate = FUpdate;
  }
  
  public String getKdSup() {
      return this.kdSup;
  }
  
  public void setKdSup(String kdSup) {
      this.kdSup = kdSup;
  }
  public String getNmSup() {
      return this.nmSup;
  }
  
  public void setNmSup(String nmSup) {
      this.nmSup = nmSup;
  }
  public String getNmBrg() {
      return this.nmBrg;
  }
  
  public void setNmBrg(String nmBrg) {
      this.nmBrg = nmBrg;
  }
  public String getHrg() {
      return this.hrg;
  }
  
  public void setHrg(String hrg) {
      this.hrg = hrg;
  }
  public String getJml() {
      return this.jml;
  }
  
  public void setJml(String jml) {
      this.jml = jml;
  }
  public Date getTgl() {
      return this.tgl;
  }
  
  public void setTgl(Date tgl) {
      this.tgl = tgl;
  }
  public String getFStatus() {
      return this.FStatus;
  }
  
  public void setFStatus(String FStatus) {
      this.FStatus = FStatus;
  }
  public String getFUpdate() {
      return this.FUpdate;
  }
  
  public void setFUpdate(String FUpdate) {
      this.FUpdate = FUpdate;
  }
  
  }
  </code></pre>
  
  <p>SupplierGui.java</p>
  
  <pre><code>package Gui;
  import Pojo.Supplier;
  import java.util.List;
  
  public interface SupplierGui {
  
      List&lt;Supplier&gt; listSupplier(); 
  }
  </code></pre>
  
  <p>SupplierDAO.java</p>
  
  <pre><code>package DAO;
  import Pojo.Supplier;
  import Gui.SupplierGui;
  import Util.HibernateUtil;
  import java.util.ArrayList;
  import java.util.List;
  import java.util.logging.Level;
  import javax.persistence.EntityManager;
  import javax.swing.JOptionPane;
  import org.hibernate.HibernateException;
  import org.hibernate.Session;
  import org.hibernate.SessionFactory;
  import org.hibernate.Transaction;
  import org.hibernate.Criteria;
  import org.hibernate.Query;
  
  public class SupplierDAO implements SupplierGui {
  
  private SessionFactory sessionFactory;
  
  public SupplierDAO(SessionFactory sessionFactory) {
      this.sessionFactory = sessionFactory;
  }
  
  @Override
  public List&lt;Supplier&gt; listSupplier() {
      Session session = sessionFactory.openSession();
      session.beginTransaction();
      List list = new ArrayList();
      try {
          Query query = session.createQuery("from supplier where f_status = '1'");
          list = query.list();
          session.getTransaction().commit();
      } catch (IllegalStateException ex) {
          session.getTransaction().rollback();
          JOptionPane.showMessageDialog(null, ex);
      }
      return list;
   }
  
   } 
  </code></pre>
  
  <p>this is main class...</p>
  
  <p>frmSupplier.java</p>
  
  <pre><code>package Tampilan;
  import java.sql.*;
  import java.text.ParseException;
  import javax.swing.*;
  import java.lang.*;
  import java.awt.*;
  import javax.swing.table.DefaultTableModel;
  import java.text.SimpleDateFormat;
  import java.util.logging.Level;
  import java.util.logging.Logger;
  import java.util.Date;
  
  import Pojo.Supplier;
  import Gui.SupplierGui;
  import java.util.ArrayList;
  import java.util.List;
  import javax.swing.ImageIcon;
  import javax.swing.JOptionPane;
  import javax.swing.table.DefaultTableModel;
  import Util.HibernateUtil;
  import Util.SupplierTableModel;
  import java.util.Calendar;
  
  public class frmSupplier extends javax.swing.JFrame {
  
  private SupplierGui supplierInters = HibernateUtil.getSupplier();
  private Supplier sup;
  private List listSuplierAll = new ArrayList();
  
  String tanggal;
  
  public frmSupplier() {
      initComponents();
      BacaTabelSupplier();    }
  
  private void BacaTabelSupplier(){        
      try{
          listSuplierAll = supplierInters.listSupplier();
  
      } catch (Exception ex) {
          JOptionPane.showMessageDialog(null, ex);
      }
      String[][] data1 = new String[listSuplierAll.size()][6];
      for (int x = 0; x &lt; listSuplierAll.size(); x++) {
          Supplier tm1 = (Supplier) listSuplierAll.get(x);
          data1[x][0] = tm1.getKdSup();
          data1[x][1] = tm1.getNmSup();
          data1[x][2] = tm1.getNmBrg();
          data1[x][3] = tm1.getHrg();
          data1[x][4] = tm1.getJml();
          data1[x][5] = tm1.getTgl().toString();
      }
      String[] label = {"Kode Supplier","Nama Supplier","Nama Barang","Harga Satuan",
                          "Jumlah","Tanggal"};
      DefaultTableModel model = new DefaultTableModel(data1, label);
      tabel.setModel(model);
  
  }
  
  public static void main(String args[]) {
  
      java.awt.EventQueue.invokeLater(new Runnable() {
  
          public void run() {
              new frmSupplier().setVisible(true);
          }
      });
  }
  
  }
  </code></pre>
  
  <p>HibernateUtil.java</p>
  
  <pre><code>package Util;
  
  import DAO.SupplierDAO;
  import Gui.SupplierGui;
  import org.hibernate.cfg.AnnotationConfiguration;
  import org.hibernate.SessionFactory;
  
  public class HibernateUtil {
  
  private static final SessionFactory sessionFactory;
  private static final SupplierGui supplierInter;
  
  static {
          try{
          sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
          supplierInter = new SupplierDAO(sessionFactory);
          } catch (Throwable ex) {
          System.err.println("Initial SessionFactory creation failed." + ex);
          throw new ExceptionInInitializerError(ex);
      }
  }
  
  public static SessionFactory getSessionFactory() {
      return sessionFactory;
  }
  
  public static SupplierGui getSupplier() {
      return supplierInter;
  }
  
  }
  </code></pre>
  
  <p>and here is my problem.</p>
  
  <p><strong>org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister</strong></p>
  
  <pre><code>Initial SessionFactory creation failed.org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
  Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
  at Util.HibernateUtil.&lt;clinit&gt;(HibernateUtil.java:33)
  </code></pre>
  
  <p><a href="http://i.stack.imgur.com/L9jeL.jpg" rel="nofollow">this is my structure package</a></p>
  
  <p>i really don't know where is mistake in their code, can someone help me? i am new to try hibernate, i really happy if you want to help me.</p>
  
  <p>thanks =)</p>