java - Unable to load class declared as < mapping class="Package.Class" /> in the configuration -
hibernate.cfg.xml
?xml version="1.0" encoding="utf-8"?> <!doctype hibernate-configuration public "-//hibernate/hibernate configuration dtd 3.0//en" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.dialect">org.hibernate.dialect.mysqldialect</property> <property name="hibernate.connection.driver_class">com.mysql.jdbc.driver</property> <property name="hibernate.connection.charset">utf8</property> <property name="hibernate.connection.characterencoding">utf8</property> <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/usosurvey</property> <property name="hibernate.connection.username">usosurvey</property> <property name="hibernate.connection.password">usosurvey</property> <property name="hibernate.hbm2ddl.auto">update</property> <property name="hibernate.show_sql">true</property> <property name="hbm2ddl.auto">update</property> <property name="hibernate.transaction.factory_class">org.hibernate.transaction.jdbctransactionfactory</property> <property name="hibernate.current_session_context_class">thread</property> <!-- configuration pool via c3p0--> <property name="c3p0.acquire_increment">1</property> <property name="c3p0.idle_test_period">100</property> <!-- seconds --> <property name="c3p0.max_size">10</property> <property name="c3p0.max_statements">0</property> <property name="c3p0.min_size">1</property> <property name="c3p0.timeout">100</property> <!-- seconds --> <mapping class="modelo.grpusuario"/> <mapping class="modelo.menu"/> <mapping class="modelo.encuesta"/> ...
in ireport tools->options->ireport->classpath
c:\users\administrador\documents\netbeansprojects\usosurvey\src\java\util -> i*n folder mapping class*
c:\users\administrador\documents\netbeansprojects\usosurvey\src\java\modelo -> in folder model classes
grpusuario.java
/* * change template, choose tools | templates * , open template in editor. */ package modelo; import java.io.serializable; import java.util.collection; import javax.persistence.*; import javax.validation.constraints.notnull; import javax.validation.constraints.size; import javax.xml.bind.annotation.xmlrootelement; import javax.xml.bind.annotation.xmltransient; /** * * @author administrador */ @entity @table(name = "grpusuarios", catalog = "usosurvey", schema = "") @xmlrootelement @namedqueries({ @namedquery(name = "grpusuario.findall", query = "select g grpusuario g"), @namedquery(name = "grpusuario.findbygrupo", query = "select g grpusuario g g.grupo = :grupo"), @namedquery(name = "grpusuario.findbydescripcion", query = "select g grpusuario g g.descripcion = :descripcion")}) public class grpusuario implements serializable { private static final long serialversionuid = 1l; @id @basic(optional = false) @notnull @column(name = "grupo") private integer grupo; @basic(optional = false) @notnull @size(min = 1, max = 64) @column(name = "descripcion") private string descripcion; @onetomany(cascade = cascadetype.all, mappedby = "seclevel") private collection<menu> menucollection; @onetomany(cascade = cascadetype.all, mappedby = "grupo", orphanremoval = true) private collection<usuario> usuariocollection; public grpusuario() { } ....
but when trying create connection following error: unable load class declared < mapping class="modelo.grpusuario" />
in configuration
Comments
Post a Comment