Hibernate version:
2.1
Mapping documents:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- properties -->
<property name = "hibernate.show_sql">false</property>
<property name = "hibernate.hbm2ddl.auto">update</property>
<!-- mapping files -->
<mapping resource = "escola/Relatorio.hbm.xml"/>
<mapping resource = "escola/Acessorios.hbm.xml"/>
<mapping resource = "escola/Turma.hbm.xml"/>
<mapping resource = "escola/EducacaoArtistica.hbm.xml"/>
<mapping resource = "escola/EducacaoFisica.hbm.xml"/>
<mapping resource = "escola/EducacaoMoralEReligiosa.hbm.xml"/>
<mapping resource = "escola/EducacaoMusical.hbm.xml"/>
<mapping resource = "escola/EducacaoTecnologica.hbm.xml"/>
<mapping resource = "escola/EducacaoVisualETecnologica.hbm.xml"/>
<mapping resource = "escola/EstudoDoMeio.hbm.xml"/>
<mapping resource = "escola/ExpressaoArtistica.hbm.xml"/>
<mapping resource = "escola/Matematica.hbm.xml"/>
<mapping resource = "escola/LinguaPortuguesa.hbm.xml"/>
<mapping resource = "escola/LEI.hbm.xml"/>
<mapping resource = "escola/Q9.hbm.xml"/>
<mapping resource = "escola/Q10.hbm.xml"/>
<mapping resource = "escola/Q12.hbm.xml"/>
<mapping resource = "escola/Q17.hbm.xml"/>
<mapping resource = "escola/Q19.hbm.xml"/>
<mapping resource = "escola/Q22Al.hbm.xml"/>
<mapping resource = "escola/Q22Disc.hbm.xml"/>
<mapping resource = "escola/Q22EE.hbm.xml"/>
<mapping resource = "escola/Q22Esc.hbm.xml"/>
<mapping resource = "escola/Q23.hbm.xml"/>
<mapping resource = "escola/Q34.hbm.xml"/>
<mapping resource = "escola/Utilizador.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
MySql 4.0.12-nt
Debug level Hibernate log excerpt:
I read in manual's ch 3.5 that we can use hibernate.hbm2ddl.auto with update, which i adopted:
<property name = "hibernate.hbm2ddl.auto">update</property>
This is great because i can have data in database and at the same time update it without any loss of data.
But i watched this:
...
19:33:03,375 DEBUG SchemaUpdate:133 - alter table q22Al add index (matematica_id), add constraint FK64FDE7C7F49A5CE foreign key (matematica_id) references matematica (id)
...
I mean, the database update creates a constraint: i wonder if i should worry about that, if that, in any way, may affect my data and the overall natural flow of my app
Thanks in advance
|