Viva!
Estou a tentar colocar o Hibernate a funcionar, mas na hora de funcionar recorrendo a funções do proprio, get de um objecto por Primary Key, ele da algo como
2007-06-13 16:19:13,078 ERROR hibernate.util.JDBCExceptionReporter -> You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.lect_docente lectdocent0_ where lectdocent0_.id_docente=1' at line 1
eu sei, é um pouca mais estranho se atender que a linha que da erro é esta:
return (LectDocente)getSession().get(LectDocente.class, num);
os meus ficheiros xml são :
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 name="LDHibernate">
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.password">ld9499</property>
<property name="hibernate.connection.url">jdbc:mysql://capsi-5:3306/ld_publication</property>
<property name="hibernate.connection.username">helio</property>
<property name="hibernate.default_schema">ld_publication</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>
<mapping resource="pt/VO/LectRegenteUc.hbm.xml" />
<mapping resource="pt/VO/LectCurso.hbm.xml" />
<mapping resource="pt/VO/LectFichaUcBibliografia.hbm.xml" />
<mapping resource="pt/VO/LectFichaTipoHoras.hbm.xml" />
<mapping resource="pt/VO/LectDocente.hbm.xml" />
<mapping resource="pt/VO/LectFichaUc.hbm.xml" />
<mapping resource="pt/VO/LectAnoLectivo.hbm.xml" />
<mapping resource="pt/VO/LectHorarioAtendimento.hbm.xml" />
<mapping resource="pt/VO/LectFichaUcUnidade.hbm.xml" />
<mapping resource="pt/VO/LectFichaHorasContacto.hbm.xml" />
<mapping resource="pt/VO/LectFichaUcAvaliacao.hbm.xml" />
<mapping resource="pt/VO/LectFichaTipoContacto.hbm.xml" />
<mapping resource="pt/VO/LectFichUcActividade.hbm.xml" />
<mapping resource="pt/VO/LectDisciplina.hbm.xml" />
</session-factory>
</hibernate-configuration>
Os POJOs são gerados pelo Eclipse, assim como os seus HBM.XML
Gostaria da vossa opinião, pois ainda nao percebi qual a causa dessa falha.
Obrigado