Hi,
I'm using Hibernate 3.0.5. Sometimes when I launch the following code:
Code:
System.out.println("Start");
List l = HibernateUtil.getSession()
.createQuery("from Entidad where idAnualidad = ?")
.setInteger(0, idAnualidad)
.list();
System.out.println("End");
I get the following log:
Code:
Start
Hibernate: update ca_entidad set nombre=?, observaciones=?, idProvincia=?, idTipoentidad=?, idAnualidad=? where identidad=?
Hibernate: select entidad0_.identidad as identidad, entidad0_.nombre as nombre3_, entidad0_.observaciones as observac3_3_, entidad0_.idProvincia as idProvin4_3_, entidad0_.idTipoentidad as idTipoen5_3_, entidad0_.idAnualidad as idAnuali6_3_ from ca_entidad entidad0_ where entidad0_.idAnualidad=?
End
An update before the select. Moreover: I didn't modify the entity class. The only "strange" thing is that it has spanish characters ("ñ" and "Ñ") in some properties.
Any comment here would be really welcome. As far as I know a createQuery() will never try to do an update, won't it ?
Regards,
- Juan
PS.: Just the plain simple mapping file being used:
Code:
<hibernate-mapping>
<class table="opcion_menu" name="comun.menu.modelo.Nodo">
<composite-id name="id" class="comun.menu.modelo.Nodo$ID">
<key-property name="codigoAplicacion" column="cod_aplicacion"/>
<key-property name="codigoMenu" column="cod_menu"/>
<key-property name="ordenOpcion" column="orden_opcion"/>
</composite-id>
<property name="codigoMenuSiguiente" column="cod_menu_siguiente" not-null="true"/>
<property name="etiqueta" column="lit_opcion" not-null="true"/>
<property name="programa" column="programa" not-null="true"/>
</class>
</hibernate-mapping>