Exception in thread "main" org.hibernate.MappingNotFoundException: resource: entidades.Aluno not found
<!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.connection.url">jdbc:mysql://localhost/teste</property>
<property name="hibernate.connection.driver_class">org.mysql.jdbc.Driver</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">rute</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.format_sql">true</property>
<property name="hibernate.hbm2ddl.auto">create</property>
<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.max_size">20</property>
<property name="hibernate.c3p0.timeout">180</property>
<property name="hibernate.c3p0.idle_test_period">100</property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
<!-- SQL to stdout logging
<property name="show_sql">true</property>
<property name="format_sql">true</property>
<property name="use_sql_comments">true</property>
-->
<mapping resource="entidades.Aluno"/>
<mapping resource="entidades.Curso"/>
<mapping resource="entidades.Matricula"/>
</session-factory>
</hibernate-configuration>
package entidades;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
//Essa anotação identifica que essa classe eh uma classe persistente
@Entity
public class Aluno {
@Id //O atributo abaixo dessa anotação é a chave primaria da tabela
@GeneratedValue //Essa anotação define q nossa chave primaria eh de auto incremento
private int id;
private String nome;
private int idade;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public int getIdade() {
return idade;
}
public void setIdade(int idade) {
this.idade = idade;
}
}
package exec;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
public class GeraBanco {
public static void main(String[] args){
AnnotationConfiguration configuration = new AnnotationConfiguration();
configuration.configure();
SchemaExport se = new SchemaExport(configuration);
//O primeiro true verifica se desejo executar os comandos no banco e o segundo true mostra o sql gerado
se.create(true, true);
System.out.println("Terminou!");
}
}
Abaixo a estrutura dos arquivos nesse projeto.
[IMG]http://i293.photobucket.com/albums/mm75/Hazeo_Exo/estruturadosarquivos.jpg[/IMG]
Tentei trocar o "." do entidades.Aluno por "/' mas também não funcionou :cry: