Hello,
when I try to persist a new instance of a class named EstatConnectat and Hibernate is preparing SQL Statement with 3 parameters, I don't know why dehydrating class, it finishes prematurely after binding the second parameter and I don't get any error log line.
The code I try to execute is:
Code:
EstatConnectat estat = new EstatConnectat();
estat.setOID(user.getOID());
estat.setIp("255.255.255.255");
estat.setPort(1234);
estat.setUsuari(user);
this.gestioUsuarisService.getUsuarisDAO().createEstatConnectat(estat);
The hibernate mapping file is:
Code:
<class name="projecte.appweb.domain.EstatConnectat" table="ESTAT_CONNECTAT">
<id name="OID" column="OID">
<generator class="foreign">
<param name="property">usuari</param>
</generator>
</id>
<one-to-one name="usuari" class="projecte.appweb.domain.Usuari" constrained="true" />
<property name="ip" type="java.lang.String" column="IP" length="15" not-null="true" />
<property name="port" type="integer" column="PORT" not-null="true" />
<!--<property name="horaConnexio" type="java.util.Date" column="HORA_CONNEXIO" not-null="true" />-->
</class>
This is the log i get:
Code:
2005-11-23 19:00:04,390 [DEBUG] - opened session
2005-11-23 19:00:04,390 [DEBUG] - begin
2005-11-23 19:00:04,390 [DEBUG] - current autocommit status:true
2005-11-23 19:00:04,390 [DEBUG] - disabling autocommit
2005-11-23 19:00:04,390 [DEBUG] - commit
2005-11-23 19:00:04,390 [DEBUG] - transaction completion
2005-11-23 19:00:04,390 [DEBUG] - re-enabling autocommit
2005-11-23 19:00:04,390 [DEBUG] - closing session
2005-11-23 19:00:04,390 [DEBUG] - disconnecting session
2005-11-23 19:00:04,390 [DEBUG] - transaction completion
2005-11-23 19:00:04,390 [DEBUG] - opened session
2005-11-23 19:00:04,390 [DEBUG] - id unsaved-value: 0
2005-11-23 19:00:04,421 [DEBUG] - generated identifier: 1
2005-11-23 19:00:04,421 [DEBUG] - saving [projecte.appweb.domain.EstatConnectat#1]
2005-11-23 19:00:04,421 [DEBUG] - id unsaved-value: 0
2005-11-23 19:00:04,421 [DEBUG] - flushing session
2005-11-23 19:00:04,421 [DEBUG] - Flushing entities and processing referenced collections
2005-11-23 19:00:04,421 [DEBUG] - Processing unreferenced collections
2005-11-23 19:00:04,421 [DEBUG] - Scheduling collection removes/(re)creates/updates
2005-11-23 19:00:04,421 [DEBUG] - Flushed: 1 insertions, 0 updates, 0 deletions to 1 objects
2005-11-23 19:00:04,421 [DEBUG] - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
2005-11-23 19:00:04,421 [DEBUG] - listing entities:
2005-11-23 19:00:04,421 [DEBUG] - projecte.appweb.domain.EstatConnectat{usuari=Usuari#1, OID=1, port=1234, ip=255.255.255.255}
2005-11-23 19:00:04,421 [DEBUG] - executing flush
2005-11-23 19:00:04,421 [DEBUG] - Inserting entity: [projecte.appweb.domain.EstatConnectat#1]
2005-11-23 19:00:04,421 [DEBUG] - about to open: 1 open PreparedStatements, 0 open ResultSets
2005-11-23 19:00:04,421 [DEBUG] - insert into ESTAT_CONNECTAT (IP, PORT, OID) values (?, ?, ?)
2005-11-23 19:00:04,421 [DEBUG] - preparing statement
2005-11-23 19:00:04,421 [DEBUG] - Dehydrating entity: [projecte.appweb.domain.EstatConnectat#1]
2005-11-23 19:00:04,421 [DEBUG] - binding '255.255.255.255' to parameter: 1
2005-11-23 19:00:04,421 [DEBUG] - binding '1234' to parameter: 2
2005-11-23 19:00:04,421 [DEBUG] - closing session
2005-11-23 19:00:04,421 [DEBUG] - disconnecting session
2005-11-23 19:00:04,421 [DEBUG] - transaction completion
Can anyone help me? Thx very much,
Albert
Hibernate version: 2.1.8
Name and version of the database you are using:Firebird 1.5.2.4731
Debug level Hibernate log excerpt:ALL