Pessoal, do nada o meu mapeamento parou de funcionar…não entendo o que está errado mas tem duas classes que o hibernate acusa o seguintes erros:
Exception in thread "AWT-EventQueue-0" org.hibernate.hql.ast.QuerySyntaxException: Rua is not mapped [from Rua]
Exception in thread "AWT-EventQueue-0" org.hibernate.hql.ast.QuerySyntaxException: Bairro is not mapped [from Bairro]
Se alguem puder me ajudar…ai vai os xml e as classes:
Rua.hbm.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="pkgObjetos.Rua" table="ruas">
<id name="cod" type="int">
<generator class="increment"/>
</id>
<property name="cep" type="string"/>
<property name="bairro" type="int"/>
<property name="nome" type="string"/>
</class>
</hibernate-mapping>
Bairro.hbm.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="pkgObjetos.Bairro" table="bairros">
<id name="cod" type="int">
<generator class="increment"/>
</id>
<property name="nome" type="int"/>
</class>
</hibernate-mapping>
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.url">jdbc:mysql://localhost:3306/bancosocial</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">mysql</property>
<property name="hibernate.current_session_context_class">thread</property>
<mapping resource="pkgObjetos/Titular.hbm.xml"/>
<mapping resource="pkgObjetos/Dependente.hbm.xml"/>
<mapping resource="pkgObjetos/Atendente.hbm.xml"/>
<mapping resource="pkgObjetos/Familia.hbm.xml"/>
<mapping resource="pkgObjetos/EnderecoFamilia.hbm.xml"/>
<mapping resource="pkgObjetos/Area.hbm.xml"/>
<mapping resource="pkgObjetos/Bairro.hbm.xml"/>
<mapping resource="pkgObjetos/Rua.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Rua.java
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package pkgObjetos;
import pkgDatabaseKit.DatabaseObject;
/**
*
* @author ismael
*/
public class Rua extends DatabaseObject{
private int cod;
private String cep;
private int bairro;
private String nome;
public Rua() {
}
public Rua(String cep, int bairro, String nome) {
this.cep = cep;
this.bairro = bairro;
this.nome = nome;
}
public int getBairro() {
return bairro;
}
public String getCep() {
return cep;
}
public int getCod() {
return cod;
}
public String getNome() {
return nome;
}
public void setBairro(int bairro) {
this.bairro = bairro;
}
public void setCep(String cep) {
this.cep = cep;
}
public void setCod(int cod) {
this.cod = cod;
}
public void setNome(String nome) {
this.nome = nome;
}
@Override
public String toString(){
return getCod() + " - " + getNome();
}
}
Bairro.java
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package pkgObjetos;
import pkgDatabaseKit.DatabaseObject;
/**
*
* @author ismael
*/
public class Bairro extends DatabaseObject {
private int cod;
private String nome;
public Bairro() {
}
public Bairro(int cod, String nome) {
this.cod = cod;
this.nome = nome;
}
public int getCod() {
return cod;
}
public String getNome() {
return nome;
}
public void setCod(int cod) {
this.cod = cod;
}
public void setNome(String nome) {
this.nome = nome;
}
@Override
public String toString(){
return getCod() + " - " + getNome();
}
}