Could not instantiate persister org.hibernate.persister.entity.JoinedSubclassEntityPersister
<p>I am getting the following error while trying to connect to mysql using hibernate. I have a Super class Employee and three subclasses: SoftwareEmployee, HardWareEmployee and Admin.I also have two xml files:  hibernateisapersubclass.cfg.xml and employeeisapersubclass.hbm.xml. I am trying to populate data in 4 different table using 'joined-subclass' tag in my xml. Please help.</p>

<p>Error that I am getting are as follows:</p>

<pre><code>Dec 04, 2016 7:45:34 PM org.hibernate.Version logVersion
        INFO: HHH000412: Hibernate Core {5.2.5.Final}
        Dec 04, 2016 7:45:34 PM org.hibernate.cfg.Environment &lt;clinit&gt;
        INFO: HHH000206: hibernate.properties not found
        Dec 04, 2016 7:45:34 PM org.hibernate.annotations.common.reflection.java.JavaReflectionManager &lt;clinit&gt;
        INFO: HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
        Dec 04, 2016 7:45:35 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
        WARN: HHH10001002: Using Hibernate built-in connection pool (not for production use!)
        Dec 04, 2016 7:45:35 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
        INFO: HHH10001005: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql://localhost/hqlstudent]
        Dec 04, 2016 7:45:35 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
        INFO: HHH10001001: Connection properties: {user=root, password=****}
        Dec 04, 2016 7:45:35 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
        INFO: HHH10001003: Autocommit mode: false
        Dec 04, 2016 7:45:35 PM org.hibernate.engine.jdbc.connections.internal.PooledConnections &lt;init&gt;
        INFO: HHH000115: Hibernate connection pool size: 20 (min=1)
        Sun Dec 04 19:45:35 EST 2016 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
        Dec 04, 2016 7:45:35 PM org.hibernate.dialect.Dialect &lt;init&gt;
        INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
        Dec 04, 2016 7:45:36 PM org.hibernate.AssertionFailure &lt;init&gt;
        ERROR: HHH000099: an assertion failure occurred (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session): org.hibernate.AssertionFailure: Table hqlstudent.superemployee not found
        Dec 04, 2016 7:45:36 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl stop
        INFO: HHH10001008: Cleaning up connection pool [jdbc:mysql://localhost/hqlstudent]
        Exception in thread "main" org.hibernate.MappingException: Could not instantiate persister org.hibernate.persister.entity.JoinedSubclassEntityPersister
            at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:112)
            at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:77)
            at org.hibernate.metamodel.internal.MetamodelImpl.initialize(MetamodelImpl.java:128)
            at org.hibernate.internal.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:297)
            at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:445)
            at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:710)
            at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:726)
            at test.ClientIsAPerSubClass.main(ClientIsAPerSubClass.java:22)
        Caused by: org.hibernate.AssertionFailure: Table hqlstudent.superemployee not found
            at org.hibernate.persister.entity.AbstractEntityPersister.getTableId(AbstractEntityPersister.java:5168)
            at org.hibernate.persister.entity.JoinedSubclassEntityPersister.&lt;init&gt;(JoinedSubclassEntityPersister.java:433)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
            at java.lang.reflect.Constructor.newInstance(Unknown Source)
            at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:96)
            ... 7 more
</code></pre>

<p>Following are my five java files and two xml files:</p>

<pre><code>ClientIsAPerSubClass.java

package test;

import org.hibernate.Session;

import org.hibernate.SessionFactory;

import org.hibernate.Transaction;

import org.hibernate.cfg.Configuration;

import beans.Admin;
import beans.Admin1;
import beans.HardwareEmployee;
import beans.HardwareEmployee1;
import beans.SoftwareEmployee;
import beans.SoftwareEmployee1;


public class ClientIsAPerSubClass {

    public static void main(String [] args){

        Configuration configuration = new Configuration();
        configuration.configure("resources/hibernateisapersubclass.cfg.xml");
        SessionFactory sessionFactory  = configuration.buildSessionFactory();
        Session session = sessionFactory.openSession();
        Transaction transaction= session.beginTransaction();//student object will move database;
        SoftwareEmployee1 softwareEmployee= new SoftwareEmployee1();
        softwareEmployee.setId(1);
        softwareEmployee.setName("bishwash");
        softwareEmployee.setEmail("20wash.sharma@gmail.com");
        softwareEmployee.setSalary(60000);
        softwareEmployee.setTool("hibernate");
        HardwareEmployee1 hardwareEmployee = new HardwareEmployee1();
        hardwareEmployee.setId(2);
        hardwareEmployee.setName("mahendra");
        hardwareEmployee.setEmail("mahendra@mahendra.com");
        hardwareEmployee.setSalary(55000);
        hardwareEmployee.setWorkinghour(20);
        Admin1 admin= new Admin1();
        admin.setId(3);
        admin.setName("ashish@ashish.com");
        admin.setEmail("mahendra@mahendra.com");
        admin.setSalary(60000);
        admin.setBranchname("Kathmandu");;
        session.save(softwareEmployee);
        session.save(hardwareEmployee);
        session.save(admin);
        transaction.commit();
    session.close();
    sessionFactory.close();
        //System.out.println("no of rows dumped from old to new table"+i);

    }

}

Admin.java
package beans;

public class Admin extends Employee {
private String branchname;
    public Admin() {

    }

    public Admin(int id, String name, String email, double salary, String branchname) {
        super(id, name, email, salary);
        this.branchname= branchname;
    }

    public String getBranchname() {
        return branchname;
    }

    public void setBranchname(String branchname) {
        this.branchname = branchname;
    }

}


package beans;

public class HardwareEmployee extends Employee {
private int workinghour;

public HardwareEmployee() {
    super();
    // TODO Auto-generated constructor stub
}

public HardwareEmployee(int id, String name, String email, double salary, int workinghour) {
    super(id, name, email, salary);
    this.workinghour= workinghour;
}

public int getWorkinghour() {
    return workinghour;
}

public void setWorkinghour(int workinghour) {
    this.workinghour = workinghour;
}


}

SoftwareEmployee.java
package beans;

public class SoftwareEmployee extends Employee {
private String tool;

public SoftwareEmployee() {
    super();
    // TODO Auto-generated constructor stub
}

public SoftwareEmployee(int id, String name, String email, double salary ,String tool) {
    super(id, name, email, salary);
    this.tool= tool;
}

public String getTool() {
    return tool;
}

public void setTool(String tool) {
    this.tool = tool;
}
}


HardwareEmployee.java
package beans;

public class HardwareEmployee extends Employee {
private int workinghour;

public HardwareEmployee() {
    super();
    // TODO Auto-generated constructor stub
}

public HardwareEmployee(int id, String name, String email, double salary, int workinghour) {
    super(id, name, email, salary);
    this.workinghour= workinghour;
}

public int getWorkinghour() {
    return workinghour;
}

public void setWorkinghour(int workinghour) {
    this.workinghour = workinghour;
}


}

employeeisapersubclass.hbm.xml

&lt;!DOCTYPE hibernate-mapping PUBLIC 
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"&gt;
    &lt;hibernate-mapping&gt;
    &lt;class name="beans.Employee" table ="superemployee" schema="hqlstudent"&gt;
    &lt;id name="id"/&gt;


    &lt;property name="name" /&gt;
   &lt;property name="email" /&gt;
   &lt;property name="salary" /&gt;
   &lt;joined-subclass name="beans.SoftwareEmployee" table="softwareemployee"&gt;
   &lt;key column ="id"/&gt;
   &lt;property name="tool"/&gt;

   &lt;/joined-subclass&gt;
    &lt;joined-subclass name="beans.HardwareEmployee" table="hardwareemployee"&gt;
  &lt;key column ="id"/&gt;
   &lt;property name="workinghour"/&gt;

   &lt;/joined-subclass&gt;

   &lt;joined-subclass name="beans.Admin" table="admin"&gt;
   &lt;key column ="id"/&gt;
   &lt;property name="branchname"/&gt;

   &lt;/joined-subclass&gt;
    &lt;/class&gt;
    &lt;/hibernate-mapping&gt;



hibernateisapersubclass.cfg.xml

&lt;!DOCTYPE hibernate-configuration PUBLIC
    "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
    "http://www.hibernate.org/dtd/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.hbm2ddl.auto"&gt;
      create
   &lt;/property&gt;
   &lt;property name="hibernate.show_sql"&gt;
      true
   &lt;/property&gt;

   &lt;property name="hibernate.connection.driver_class"&gt;
      com.mysql.jdbc.Driver
   &lt;/property&gt;

   &lt;!-- Assume customstudent is the database name --&gt;
   &lt;property name="hibernate.connection.url"&gt;
      jdbc:mysql://localhost/hqlstudent
   &lt;/property&gt;
   &lt;property name="hibernate.connection.username"&gt;
      root
   &lt;/property&gt;
   &lt;property name="hibernate.connection.password"&gt;
      password
   &lt;/property&gt;

&lt;mapping resource="resources/employeeisapersubclass.hbm.xml"/&gt;


&lt;/session-factory&gt;
&lt;/hibernate-configuration&gt;
</code></pre>