It looks like you have forgotten to add a mapping in the hibernate configuration for your MisRecords.
Variant a) hibernate.cfg.xml with separate mapping file:
If you have configured your hibernate context manually by hibernate.cfg.xml you have add your mapping in that file as seen below:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration SYSTEM
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- Default Database Dialect in Hibernate -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<!-- Schema -->
<property name="hibernate.default_schema">YOUR_DB_SCHEME</property>
...
<!-- Your mapping for your model goes after -->
<mapping class="coolproject.modelpackage.ModelEntity1"/>
<mapping class="coolproject.modelpackage.ModelEntity2"/>
<mapping class="coolproject.modelpackage.ModelEntity3"/>
<mapping class="coolproject.modelpackage.ModelEntity4"/>
</session-factory>
</hibernate-configuration>
Variant b) Spring ORM with JPA
If you have a spring web framework context running, you could enable automated scanning for @Entity classes by configuring an entity manager factory in a spring persistence configuration bean:
import java.util.Properties;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.JpaVendorAdapter;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@Configuration
@EnableTransactionManagement
public class PersistenceJPAConfig {
...
/**
* EntityManager Factory Bean
*
* @return
* {@link LocalContainerEntityManagerFactoryBean}
*/
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setDataSource(dataSource());
// add base packages containing @Entity annotated classes here
em.setPackagesToScan(new String[] { "packages", "to.scan", "for.Entity.annotated.classes" });
JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
em.setJpaVendorAdapter(vendorAdapter);
em.setJpaProperties(additionalProperties());
return em;
}
...
}
cheers,
ceth