Hi!
I'm having problems with a collecction of composite-id objects.
To symplify things, I have created this 3 simple classes.
Prueba1 is a simple class with a normal id and a collection of Prueba2(
pruebas2).
Prueba2 has a Prueba1 property (
prueba1) and a composite id (prueba1, codigo). It also has a collection of Prueba3 (
pruebas3)
Prueba3 has a Prueba2 property (
prueba2) and a composite id (prueba1, codigo).
All of this classes have a property called
hibVersion for use with the
version mapping.
Since Prueba2 is composite-id entity, in order to load it using
Session.get(Class, Serializable) I have to create an instance of Prueba2 to use as Id, but before I have to load the Prueba1 object that is part of the id. Because of the architecture of my application, I do this in two separate sessions. I create a session, load the Prueba1 entity, close the session, then I open another session and I attempt to load the Prueba2 entity.
The Prueba2 entity is loaded fine, but the collection of Prueba3(
pruebas3) object is empty when it should have at least one object.
If I do all this in a single session, the collection is loaded just fine.
I've seen a couple of posts that had problems with equals() or hashCode() but I don't think that's the problem here.
If anyone can give me a clue as to why this doesn't work in two sessions (its seems to me it shouldn't be an issue) I'd be very gratefull.
Thanks in advance,
JJ
Hibernate version:
2.1.8
Mapping documents:
Code:
<hibernate-mapping>
<class name="pruebas.Prueba1" table="PRUEBA_1">
<id name="codigo" type="integer" unsaved-value="-1">
<column name="CODIGO" sql-type="NUMBER(5)" not-null="true"/>
<generator class="assigned"/>
</id>
<version
name="hibVersion"
column="HIB_VERSION"
type="integer"
unsaved-value="undefined"
/>
<bag name="pruebas2"
table="PRUEBA_2"
lazy="false"
inverse="true"
>
<key column="PR1_CODIGO"/>
<one-to-many class="pruebas.Prueba2"/>
</bag>
</class>
<class name="pruebas.Prueba2" table="PRUEBA_2">
<composite-id>
<key-many-to-one name="prueba1"
class="pruebas.Prueba1"
column="PR1_CODIGO"
/>
<key-property name="codigo"
column="CODIGO"
type="integer"
length="5"
/>
</composite-id>
<version
name="hibVersion"
column="HIB_VERSION"
type="integer"
unsaved-value="negative"
/>
<bag name="pruebas3"
table="PRUEBA_3"
lazy="false"
inverse="true"
cascade="all-delete-orphan"
>
<key>
<column name="PR2_PR1_CODIGO"/>
<column name="PR2_CODIGO"/>
</key>
<one-to-many class="pruebas.Prueba3"/>
</bag>
</class>
<class name="pruebas.Prueba3" table="PRUEBA_3">
<composite-id>
<key-many-to-one name="prueba2"
class="pruebas.Prueba2"
>
<column name="PR2_PR1_CODIGO"/>
<column name="PR2_CODIGO"/>
</key-many-to-one>
<key-property name="codigo"
column="CODIGO"
type="integer"
length="5"
/>
</composite-id>
<version
name="hibVersion"
column="HIB_VERSION"
type="integer"
unsaved-value="negative"
/>
</class>
</hibernate-mapping>
Class definitions:Prueba1.java
Code:
package pruebas;
import java.util.ArrayList;
import java.util.List;
public class Prueba1 {
private int codigo;
private int hibVersion;
private List pruebas2;
public Prueba1() {
codigo = -1;
pruebas2 = new ArrayList();
}
public boolean equals(Object o){
if( o instanceof Prueba1)
return getCodigo() == ((Prueba1)o).getCodigo();
else
return false;
}
public int getCodigo() {
return this.codigo;
}
public void setCodigo(int codigo) {
this.codigo = codigo;
}
public int getHibVersion() {
return this.hibVersion;
}
public void setHibVersion(int hibVersion) {
this.hibVersion = hibVersion;
}
public List getPruebas2() {
return this.pruebas2;
}
public void setPruebas2(List pruebas2) {
this.pruebas2 = pruebas2;
}
}
Prueba2.java
Code:
package pruebas;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
public class Prueba2 implements Serializable {
private int codigo;
private Prueba1 prueba1;
private int hibVersion;
private List pruebas3;
public Prueba2() {
prueba1 = null;
codigo = -1;
pruebas3 = new ArrayList();
}
public boolean equals(Object obj) {
if( obj instanceof Prueba2 ) {
Prueba2 objp2 = (Prueba2)obj;
boolean res;
if( getPrueba1() != null )
res = getPrueba1().equals( objp2.getPrueba1() );
else
res = getPrueba1() == objp2.getPrueba1();
return res && getCodigo() == objp2.getCodigo();
}
else
return false;
}
public int hashCode() {
if( getPrueba1() != null )
return getPrueba1().hashCode() + getCodigo();
else
return getCodigo();
}
public int getCodigo() {
return this.codigo;
}
public void setCodigo(int codigo) {
this.codigo = codigo;
}
public Prueba1 getPrueba1() {
return this.prueba1;
}
public void setPrueba1(Prueba1 prueba1) {
this.prueba1 = prueba1;
}
public int getHibVersion() {
return this.hibVersion;
}
public void setHibVersion(int hibVersion) {
this.hibVersion = hibVersion;
}
public List getPruebas3() {
return this.pruebas3;
}
public void setPruebas3(List pruebas3) {
this.pruebas3 = pruebas3;
}
}
Prueba3.java
Code:
package pruebas;
import java.io.Serializable;
public class Prueba3 implements Serializable{
private int codigo;
private Prueba2 prueba2;
private int hibVersion;
public Prueba3() {
prueba2 = null;
codigo = -1;
}
public boolean equals(Object obj) {
if( obj instanceof Prueba3 ) {
Prueba3 objp3 = (Prueba3)obj;
boolean res;
if( getPrueba2() != null )
res = getPrueba2().equals( objp3.getPrueba2() );
else
res = getPrueba2() == objp3.getPrueba2();
return res && getCodigo() == objp3.getCodigo();
}
else
return false;
}
public int hashCode() {
if( getPrueba2() != null )
return getPrueba2().hashCode() + getCodigo();
else
return getCodigo();
}
public int getCodigo() {
return this.codigo;
}
public void setCodigo(int codigo) {
this.codigo = codigo;
}
public Prueba2 getPrueba2() {
return this.prueba2;
}
public void setPrueba2(Prueba2 prueba2) {
this.prueba2 = prueba2;
}
public int getHibVersion() {
return this.hibVersion;
}
public void setHibVersion(int hibVersion) {
this.hibVersion = hibVersion;
}
}
Code between sessionFactory.openSession() and session.close():This is not the actual code of my application :)
Its a very simplified version designed to isolate the problem.
Code:
Session sesion = HibernateUtil.currentSession();
Transaction tx = sesion.beginTransaction();
Prueba1 p1 = (Prueba1)sesion.get( Prueba1.class, new Integer(1) );
tx.commit();
HibernateUtil.closeSession();
sesion = HibernateUtil.currentSession();
tx = sesion.beginTransaction();
Prueba2 p2 = new Prueba2();
p2.setPrueba1( p1 );
p2.setCodigo( 10 );
p2 = (Prueba2)sesion.get( Prueba2.class, p2 );
tx.commit();
HibernateUtil.closeSession();
If I comment lines 5 to 7 it works just fine.
Name and version of the database you are using:Oracle 9i
The generated SQL (show_sql=true):Code:
Hibernate: select prueba10_.CODIGO as CODIGO0_, prueba10_.HIB_VERSION as HIB_VERS2_0_ from PRUEBA_1 prueba10_ where prueba10_.CODIGO=?
Hibernate: select pruebas20_.PR1_CODIGO as PR1_CODIGO__, pruebas20_.CODIGO as CODIGO__, pruebas20_.PR1_CODIGO as PR1_CODIGO0_, pruebas20_.CODIGO as CODIGO0_, pruebas20_.HIB_VERSION as HIB_VERS3_0_ from PRUEBA_2 pruebas20_ where pruebas20_.PR1_CODIGO=?
Hibernate: select pruebas30_.PR2_PR1_CODIGO as PR2_PR1_1___, pruebas30_.PR2_CODIGO as PR2_CODIGO__, pruebas30_.CODIGO as CODIGO__, pruebas30_.PR2_PR1_CODIGO as PR2_PR1_1_0_, pruebas30_.PR2_CODIGO as PR2_CODIGO0_, pruebas30_.CODIGO as CODIGO0_, pruebas30_.HIB_VERSION as HIB_VERS4_0_ from PRUEBA_3 pruebas30_ where pruebas30_.PR2_PR1_CODIGO=? and pruebas30_.PR2_CODIGO=?
Hibernate: select prueba20_.PR1_CODIGO as PR1_CODIGO0_, prueba20_.CODIGO as CODIGO0_, prueba20_.HIB_VERSION as HIB_VERS3_0_ from PRUEBA_2 prueba20_ where prueba20_.PR1_CODIGO=? and prueba20_.CODIGO=?
Hibernate: select pruebas30_.PR2_PR1_CODIGO as PR2_PR1_1___, pruebas30_.PR2_CODIGO as PR2_CODIGO__, pruebas30_.CODIGO as CODIGO__, pruebas30_.PR2_PR1_CODIGO as PR2_PR1_1_0_, pruebas30_.PR2_CODIGO as PR2_CODIGO0_, pruebas30_.CODIGO as CODIGO0_, pruebas30_.HIB_VERSION as HIB_VERS4_0_ from PRUEBA_3 pruebas30_ where pruebas30_.PR2_PR1_CODIGO=? and pruebas30_.PR2_CODIGO=?
Hibernate: select prueba10_.CODIGO as CODIGO0_, prueba10_.HIB_VERSION as HIB_VERS2_0_ from PRUEBA_1 prueba10_ where prueba10_.CODIGO=?
Hibernate: select prueba20_.PR1_CODIGO as PR1_CODIGO0_, prueba20_.CODIGO as CODIGO0_, prueba20_.HIB_VERSION as HIB_VERS3_0_ from PRUEBA_2 prueba20_ where prueba20_.PR1_CODIGO=? and prueba20_.CODIGO=?
Hibernate: select pruebas20_.PR1_CODIGO as PR1_CODIGO__, pruebas20_.CODIGO as CODIGO__, pruebas20_.PR1_CODIGO as PR1_CODIGO0_, pruebas20_.CODIGO as CODIGO0_, pruebas20_.HIB_VERSION as HIB_VERS3_0_ from PRUEBA_2 pruebas20_ where pruebas20_.PR1_CODIGO=?
Hibernate: select prueba10_.CODIGO as CODIGO0_, prueba10_.HIB_VERSION as HIB_VERS2_0_ from PRUEBA_1 prueba10_ where prueba10_.CODIGO=?
Hibernate: select pruebas20_.PR1_CODIGO as PR1_CODIGO__, pruebas20_.CODIGO as CODIGO__, pruebas20_.PR1_CODIGO as PR1_CODIGO0_, pruebas20_.CODIGO as CODIGO0_, pruebas20_.HIB_VERSION as HIB_VERS3_0_ from PRUEBA_2 pruebas20_ where pruebas20_.PR1_CODIGO=?
Hibernate: select pruebas30_.PR2_PR1_CODIGO as PR2_PR1_1___, pruebas30_.PR2_CODIGO as PR2_CODIGO__, pruebas30_.CODIGO as CODIGO__, pruebas30_.PR2_PR1_CODIGO as PR2_PR1_1_0_, pruebas30_.PR2_CODIGO as PR2_CODIGO0_, pruebas30_.CODIGO as CODIGO0_, pruebas30_.HIB_VERSION as HIB_VERS4_0_ from PRUEBA_3 pruebas30_ where pruebas30_.PR2_PR1_CODIGO=? and pruebas30_.PR2_CODIGO=?
Hibernate: select prueba20_.PR1_CODIGO as PR1_CODIGO0_, prueba20_.CODIGO as CODIGO0_, prueba20_.HIB_VERSION as HIB_VERS3_0_ from PRUEBA_2 prueba20_ where prueba20_.PR1_CODIGO=? and prueba20_.CODIGO=?
Hibernate: select pruebas30_.PR2_PR1_CODIGO as PR2_PR1_1___, pruebas30_.PR2_CODIGO as PR2_CODIGO__, pruebas30_.CODIGO as CODIGO__, pruebas30_.PR2_PR1_CODIGO as PR2_PR1_1_0_, pruebas30_.PR2_CODIGO as PR2_CODIGO0_, pruebas30_.CODIGO as CODIGO0_, pruebas30_.HIB_VERSION as HIB_VERS4_0_ from PRUEBA_3 pruebas30_ where pruebas30_.PR2_PR1_CODIGO=? and pruebas30_.PR2_CODIGO=?
Hibernate: select prueba10_.CODIGO as CODIGO0_, prueba10_.HIB_VERSION as HIB_VERS2_0_ from PRUEBA_1 prueba10_ where prueba10_.CODIGO=?
Hibernate: select prueba20_.PR1_CODIGO as PR1_CODIGO0_, prueba20_.CODIGO as CODIGO0_, prueba20_.HIB_VERSION as HIB_VERS3_0_ from PRUEBA_2 prueba20_ where prueba20_.PR1_CODIGO=? and prueba20_.CODIGO=?
Hibernate: select pruebas20_.PR1_CODIGO as PR1_CODIGO__, pruebas20_.CODIGO as CODIGO__, pruebas20_.PR1_CODIGO as PR1_CODIGO0_, pruebas20_.CODIGO as CODIGO0_, pruebas20_.HIB_VERSION as HIB_VERS3_0_ from PRUEBA_2 pruebas20_ where pruebas20_.PR1_CODIGO=?
Debug level Hibernate log excerpt:
17:54:55,093 DEBUG SessionImpl:560 - opened session
17:54:55,109 DEBUG JDBCTransaction:37 - begin
17:54:55,109 DEBUG JDBCTransaction:41 - current autocommit status:true
17:54:55,109 DEBUG JDBCTransaction:43 - disabling autocommit
17:54:55,125 DEBUG SessionImpl:1996 - loading [pruebas.Prueba1#1]
17:54:55,125 DEBUG SessionImpl:2094 - attempting to resolve [pruebas.Prueba1#1]
17:54:55,125 DEBUG SessionImpl:2130 - object not resolved in any cache [pruebas.Prueba1#1]
17:54:55,125 DEBUG EntityPersister:410 - Materializing entity: [pruebas.Prueba1#1]
17:54:55,125 DEBUG BatcherImpl:204 - about to open: 0 open PreparedStatements, 0 open ResultSets
17:54:55,125 DEBUG SQL:230 - select prueba10_.CODIGO as CODIGO0_, prueba10_.HIB_VERSION as HIB_VERS2_0_ from PRUEBA_1 prueba10_ where prueba10_.CODIGO=?
17:54:55,125 DEBUG BatcherImpl:253 - preparing statement
17:54:55,140 DEBUG Loader:281 - processing result set
17:54:55,140 DEBUG Loader:484 - result row: 1
17:54:55,140 DEBUG Loader:615 - Initializing object from ResultSet: 1
17:54:55,140 DEBUG Loader:684 - Hydrating entity: pruebas.Prueba1#1
17:54:55,140 DEBUG SessionImpl:1920 - Version: 0
17:54:55,140 DEBUG Loader:298 - done processing result set (1 rows)
17:54:55,140 DEBUG BatcherImpl:211 - done closing: 0 open PreparedStatements, 0 open ResultSets
17:54:55,156 DEBUG BatcherImpl:275 - closing statement
17:54:55,156 DEBUG Loader:318 - total objects hydrated: 1
17:54:55,171 DEBUG SessionImpl:2216 - resolving associations for [pruebas.Prueba1#1]
17:54:55,171 DEBUG SessionImpl:3994 - creating collection wrapper:[pruebas.Prueba1.pruebas2#1]
17:54:55,171 DEBUG SessionImpl:2247 - done materializing entity [pruebas.Prueba1#1]
17:54:55,171 DEBUG SessionImpl:3161 - initializing non-lazy collections
17:54:55,171 DEBUG SessionImpl:3307 - initializing collection [pruebas.Prueba1.pruebas2#1]
17:54:55,171 DEBUG SessionImpl:3308 - checking second-level cache
17:54:55,171 DEBUG SessionImpl:3314 - collection not cached
17:54:55,171 DEBUG BatcherImpl:204 - about to open: 0 open PreparedStatements, 0 open ResultSets
17:54:55,187 DEBUG SQL:230 - select pruebas20_.PR1_CODIGO as PR1_CODIGO__, pruebas20_.CODIGO as CODIGO__, pruebas20_.PR1_CODIGO as PR1_CODIGO0_, pruebas20_.CODIGO as CODIGO0_, pruebas20_.HIB_VERSION as HIB_VERS3_0_ from PRUEBA_2 pruebas20_ where pruebas20_.PR1_CODIGO=?
17:54:55,187 DEBUG BatcherImpl:253 - preparing statement
17:54:55,218 DEBUG Loader:406 - result set contains (possibly empty) collection: [pruebas.Prueba1.pruebas2#1]
17:54:55,218 DEBUG SessionImpl:3050 - uninitialized collection: initializing
17:54:55,218 DEBUG Loader:281 - processing result set
17:54:55,234 DEBUG SessionImpl:1996 - loading [pruebas.Prueba1#1]
17:54:55,234 DEBUG SessionImpl:2094 - attempting to resolve [pruebas.Prueba1#1]
17:54:55,234 DEBUG SessionImpl:2110 - resolved object in session cache [pruebas.Prueba1#1]
17:54:55,234 DEBUG Loader:484 - result row: pruebas.Prueba2@a2da11
17:54:55,234 DEBUG Loader:615 - Initializing object from ResultSet: pruebas.Prueba2@a2da11
17:54:55,234 DEBUG Loader:684 - Hydrating entity: pruebas.Prueba2#pruebas.Prueba2@a2da11
17:54:55,250 DEBUG SessionImpl:1920 - Version: 0
17:54:55,250 DEBUG Loader:371 - found row of collection: [pruebas.Prueba1.pruebas2#1]
17:54:55,250 DEBUG SessionImpl:3073 - reading row
17:54:55,250 DEBUG SessionImpl:1996 - loading [pruebas.Prueba1#1]
17:54:55,250 DEBUG SessionImpl:2094 - attempting to resolve [pruebas.Prueba1#1]
17:54:55,250 DEBUG SessionImpl:2110 - resolved object in session cache [pruebas.Prueba1#1]
17:54:55,250 DEBUG SessionImpl:1996 - loading [pruebas.Prueba2#pruebas.Prueba2@a2da11]
17:54:55,265 DEBUG SessionImpl:2094 - attempting to resolve [pruebas.Prueba2#pruebas.Prueba2@a2da11]
17:54:55,265 DEBUG SessionImpl:2110 - resolved object in session cache [pruebas.Prueba2#pruebas.Prueba2@a2da11]
17:54:55,281 DEBUG Loader:298 - done processing result set (1 rows)
17:54:55,281 DEBUG BatcherImpl:211 - done closing: 0 open PreparedStatements, 0 open ResultSets
17:54:55,296 DEBUG BatcherImpl:275 - closing statement
17:54:55,296 DEBUG Loader:318 - total objects hydrated: 1
17:54:55,296 DEBUG SessionImpl:2216 - resolving associations for [pruebas.Prueba2#pruebas.Prueba2@a2da11]
17:54:55,296 DEBUG SessionImpl:3994 - creating collection wrapper:[pruebas.Prueba2.pruebas3#pruebas.Prueba2@a2da11]
17:54:55,296 DEBUG SessionImpl:2247 - done materializing entity [pruebas.Prueba2#pruebas.Prueba2@a2da11]
17:54:55,296 DEBUG SessionImpl:3109 - 1 collections were found in result set
17:54:55,312 DEBUG SessionImpl:3140 - collection fully initialized: [pruebas.Prueba1.pruebas2#1]
17:54:55,312 DEBUG SessionImpl:3143 - 1 collections initialized
17:54:55,312 DEBUG SessionImpl:3316 - collection initialized
17:54:55,312 DEBUG SessionImpl:3307 - initializing collection [pruebas.Prueba2.pruebas3#pruebas.Prueba2@a2da11]
17:54:55,312 DEBUG SessionImpl:3308 - checking second-level cache
17:54:55,312 DEBUG SessionImpl:3314 - collection not cached
17:54:55,312 DEBUG BatcherImpl:204 - about to open: 0 open PreparedStatements, 0 open ResultSets
17:54:55,328 DEBUG SQL:230 - select pruebas30_.PR2_PR1_CODIGO as PR2_PR1_1___, pruebas30_.PR2_CODIGO as PR2_CODIGO__, pruebas30_.CODIGO as CODIGO__, pruebas30_.PR2_PR1_CODIGO as PR2_PR1_1_0_, pruebas30_.PR2_CODIGO as PR2_CODIGO0_, pruebas30_.CODIGO as CODIGO0_, pruebas30_.HIB_VERSION as HIB_VERS4_0_ from PRUEBA_3 pruebas30_ where pruebas30_.PR2_PR1_CODIGO=? and pruebas30_.PR2_CODIGO=?
17:54:55,328 DEBUG BatcherImpl:253 - preparing statement
17:54:55,328 DEBUG Loader:406 - result set contains (possibly empty) collection: [pruebas.Prueba2.pruebas3#pruebas.Prueba2@a2da11]
17:54:55,328 DEBUG SessionImpl:3050 - uninitialized collection: initializing
17:54:55,343 DEBUG Loader:281 - processing result set
17:54:55,343 DEBUG SessionImpl:1996 - loading [pruebas.Prueba1#1]
17:54:55,343 DEBUG SessionImpl:2094 - attempting to resolve [pruebas.Prueba1#1]
17:54:55,343 DEBUG SessionImpl:2110 - resolved object in session cache [pruebas.Prueba1#1]
17:54:55,343 DEBUG SessionImpl:1996 - loading [pruebas.Prueba2#pruebas.Prueba2@a2da11]
17:54:55,343 DEBUG SessionImpl:2094 - attempting to resolve [pruebas.Prueba2#pruebas.Prueba2@a2da11]
17:54:55,343 DEBUG SessionImpl:2110 - resolved object in session cache [pruebas.Prueba2#pruebas.Prueba2@a2da11]
17:54:55,359 DEBUG Loader:484 - result row: pruebas.Prueba3@a2da75
17:54:55,359 DEBUG Loader:615 - Initializing object from ResultSet: pruebas.Prueba3@a2da75
17:54:55,359 DEBUG Loader:684 - Hydrating entity: pruebas.Prueba3#pruebas.Prueba3@a2da75
17:54:55,359 DEBUG SessionImpl:1920 - Version: 0
17:54:55,375 DEBUG SessionImpl:1996 - loading [pruebas.Prueba1#1]
17:54:55,375 DEBUG SessionImpl:2094 - attempting to resolve [pruebas.Prueba1#1]
17:54:55,375 DEBUG SessionImpl:2110 - resolved object in session cache [pruebas.Prueba1#1]
17:54:55,375 DEBUG Loader:371 - found row of collection: [pruebas.Prueba2.pruebas3#pruebas.Prueba2@a2da11]
17:54:55,375 DEBUG SessionImpl:3073 - reading row
17:54:55,375 DEBUG SessionImpl:1996 - loading [pruebas.Prueba1#1]
17:54:55,375 DEBUG SessionImpl:2094 - attempting to resolve [pruebas.Prueba1#1]
17:54:55,437 DEBUG SessionImpl:2110 - resolved object in session cache [pruebas.Prueba1#1]
17:54:55,437 DEBUG SessionImpl:1996 - loading [pruebas.Prueba2#pruebas.Prueba2@a2da11]
17:54:55,437 DEBUG SessionImpl:2094 - attempting to resolve [pruebas.Prueba2#pruebas.Prueba2@a2da11]
17:54:55,437 DEBUG SessionImpl:2110 - resolved object in session cache [pruebas.Prueba2#pruebas.Prueba2@a2da11]
17:54:55,437 DEBUG SessionImpl:1996 - loading [pruebas.Prueba3#pruebas.Prueba3@a2da75]
17:54:55,468 DEBUG SessionImpl:2094 - attempting to resolve [pruebas.Prueba3#pruebas.Prueba3@a2da75]
17:54:55,468 DEBUG SessionImpl:2110 - resolved object in session cache [pruebas.Prueba3#pruebas.Prueba3@a2da75]
17:54:55,468 DEBUG Loader:298 - done processing result set (1 rows)
17:54:55,484 DEBUG BatcherImpl:211 - done closing: 0 open PreparedStatements, 0 open ResultSets
17:54:55,484 DEBUG BatcherImpl:275 - closing statement
17:54:55,484 DEBUG Loader:318 - total objects hydrated: 1
17:54:55,484 DEBUG SessionImpl:2216 - resolving associations for [pruebas.Prueba3#pruebas.Prueba3@a2da75]
17:54:55,484 DEBUG SessionImpl:2247 - done materializing entity [pruebas.Prueba3#pruebas.Prueba3@a2da75]
17:54:55,484 DEBUG SessionImpl:3109 - 1 collections were found in result set
17:54:55,484 DEBUG SessionImpl:3140 - collection fully initialized: [pruebas.Prueba2.pruebas3#pruebas.Prueba2@a2da11]
17:54:55,484 DEBUG SessionImpl:3143 - 1 collections initialized
17:54:55,500 DEBUG SessionImpl:3316 - collection initialized
17:54:55,500 DEBUG JDBCTransaction:59 - commit
17:54:55,500 DEBUG SessionImpl:2267 - flushing session
17:54:55,500 DEBUG Cascades:497 - processing cascades for: pruebas.Prueba2
17:54:55,515 DEBUG Cascades:524 - cascading to collection: pruebas.Prueba2.pruebas3
17:54:55,531 DEBUG Cascades:113 - cascading to saveOrUpdate()
17:54:55,531 DEBUG SessionImpl:1382 - saveOrUpdate() persistent instance
17:54:55,531 DEBUG Cascades:506 - done processing cascades for: pruebas.Prueba2
17:54:55,531 DEBUG SessionImpl:2467 - Flushing entities and processing referenced collections
17:54:55,546 DEBUG SessionImpl:2916 - Collection found: [pruebas.Prueba1.pruebas2#1], was: [pruebas.Prueba1.pruebas2#1]
17:54:55,562 DEBUG SessionImpl:2916 - Collection found: [pruebas.Prueba2.pruebas3#pruebas.Prueba2@a2da11], was: [pruebas.Prueba2.pruebas3#pruebas.Prueba2@a2da11]
17:54:55,562 DEBUG SessionImpl:2808 - Processing unreferenced collections
17:54:55,562 DEBUG SessionImpl:2822 - Scheduling collection removes/(re)creates/updates
17:54:55,562 DEBUG SessionImpl:2291 - Flushed: 0 insertions, 0 updates, 0 deletions to 3 objects
17:54:55,562 DEBUG SessionImpl:2296 - Flushed: 0 (re)creations, 0 updates, 0 removals to 2 collections
17:54:55,562 DEBUG Printer:75 - listing entities:
17:54:55,562 DEBUG Printer:82 - pruebas.Prueba2{hibVersion=0, pruebas3=[Prueba3]}
17:54:55,578 DEBUG Printer:82 - pruebas.Prueba3{hibVersion=0}
17:54:55,578 DEBUG Printer:82 - pruebas.Prueba1{hibVersion=0, pruebas2=[Prueba2], codigo=1}
17:54:55,578 DEBUG SessionImpl:2380 - executing flush
17:54:55,593 DEBUG SessionImpl:2852 - post flush
17:54:55,593 DEBUG SessionImpl:596 - transaction completion
17:54:55,593 DEBUG JDBCTransaction:103 - re-enabling autocommit
17:54:55,609 DEBUG SessionImpl:578 - closing session
17:54:55,609 DEBUG SessionImpl:3383 - disconnecting session
17:54:55,609 DEBUG SessionImpl:596 - transaction completion
17:54:55,609 DEBUG SessionImpl:560 - opened session
17:54:55,609 DEBUG JDBCTransaction:37 - begin
17:54:55,609 DEBUG JDBCTransaction:41 - current autocommit status:true
17:54:55,609 DEBUG JDBCTransaction:43 - disabling autocommit
17:54:55,609 DEBUG SessionImpl:1996 - loading [pruebas.Prueba2#pruebas.Prueba2@a2da11]
17:54:55,625 DEBUG SessionImpl:2094 - attempting to resolve [pruebas.Prueba2#pruebas.Prueba2@a2da11]
17:54:55,625 DEBUG SessionImpl:2130 - object not resolved in any cache [pruebas.Prueba2#pruebas.Prueba2@a2da11]
17:54:55,625 DEBUG EntityPersister:410 - Materializing entity: [pruebas.Prueba2#pruebas.Prueba2@a2da11]
17:54:55,625 DEBUG BatcherImpl:204 - about to open: 0 open PreparedStatements, 0 open ResultSets
17:54:55,625 DEBUG SQL:230 - select prueba20_.PR1_CODIGO as PR1_CODIGO0_, prueba20_.CODIGO as CODIGO0_, prueba20_.HIB_VERSION as HIB_VERS3_0_ from PRUEBA_2 prueba20_ where prueba20_.PR1_CODIGO=? and prueba20_.CODIGO=?
17:54:55,640 DEBUG BatcherImpl:253 - preparing statement
17:54:55,640 DEBUG Cascades:396 - version unsaved-value strategy UNDEFINED
17:54:55,640 DEBUG Cascades:312 - id unsaved-value: -1
17:54:55,640 DEBUG Loader:281 - processing result set
17:54:55,640 DEBUG Loader:484 - result row: pruebas.Prueba2@a2da11
17:54:55,656 DEBUG Loader:615 - Initializing object from ResultSet: pruebas.Prueba2@a2da11
17:54:55,656 DEBUG Loader:684 - Hydrating entity: pruebas.Prueba2#pruebas.Prueba2@a2da11
17:54:55,656 DEBUG SessionImpl:1920 - Version: 0
17:54:55,656 DEBUG Loader:298 - done processing result set (1 rows)
17:54:55,656 DEBUG BatcherImpl:211 - done closing: 0 open PreparedStatements, 0 open ResultSets
17:54:55,656 DEBUG BatcherImpl:275 - closing statement
17:54:55,656 DEBUG Loader:318 - total objects hydrated: 1
17:54:55,656 DEBUG SessionImpl:2216 - resolving associations for [pruebas.Prueba2#pruebas.Prueba2@a2da11]
17:54:55,671 DEBUG SessionImpl:3994 - creating collection wrapper:[pruebas.Prueba2.pruebas3#pruebas.Prueba2@a2da11]
17:54:55,671 DEBUG SessionImpl:2247 - done materializing entity [pruebas.Prueba2#pruebas.Prueba2@a2da11]
17:54:55,671 DEBUG SessionImpl:3161 - initializing non-lazy collections
17:54:55,671 DEBUG SessionImpl:3307 - initializing collection [pruebas.Prueba2.pruebas3#pruebas.Prueba2@a2da11]
17:54:55,671 DEBUG SessionImpl:3308 - checking second-level cache
17:54:55,687 DEBUG SessionImpl:3314 - collection not cached
17:54:55,687 DEBUG BatcherImpl:204 - about to open: 0 open PreparedStatements, 0 open ResultSets
17:54:55,687 DEBUG SQL:230 - select pruebas30_.PR2_PR1_CODIGO as PR2_PR1_1___, pruebas30_.PR2_CODIGO as PR2_CODIGO__, pruebas30_.CODIGO as CODIGO__, pruebas30_.PR2_PR1_CODIGO as PR2_PR1_1_0_, pruebas30_.PR2_CODIGO as PR2_CODIGO0_, pruebas30_.CODIGO as CODIGO0_, pruebas30_.HIB_VERSION as HIB_VERS4_0_ from PRUEBA_3 pruebas30_ where pruebas30_.PR2_PR1_CODIGO=? and pruebas30_.PR2_CODIGO=?
17:54:55,703 DEBUG BatcherImpl:253 - preparing statement
17:54:55,703 DEBUG Cascades:396 - version unsaved-value strategy UNDEFINED
17:54:55,703 DEBUG Cascades:312 - id unsaved-value: -1
17:54:55,718 DEBUG Loader:406 - result set contains (possibly empty) collection: [pruebas.Prueba2.pruebas3#pruebas.Prueba2@a2da11]
17:54:55,718 DEBUG SessionImpl:3050 - uninitialized collection: initializing
17:54:55,718 DEBUG Loader:281 - processing result set
17:54:55,718 DEBUG SessionImpl:1996 - loading [pruebas.Prueba1#1]
17:54:55,718 DEBUG SessionImpl:2094 - attempting to resolve [pruebas.Prueba1#1]
17:54:55,750 DEBUG SessionImpl:2130 - object not resolved in any cache [pruebas.Prueba1#1]
17:54:55,750 DEBUG EntityPersister:410 - Materializing entity: [pruebas.Prueba1#1]
17:54:55,750 DEBUG BatcherImpl:204 - about to open: 1 open PreparedStatements, 1 open ResultSets
17:54:55,765 DEBUG SQL:230 - select prueba10_.CODIGO as CODIGO0_, prueba10_.HIB_VERSION as HIB_VERS2_0_ from PRUEBA_1 prueba10_ where prueba10_.CODIGO=?
17:54:55,765 DEBUG BatcherImpl:253 - preparing statement
17:54:55,765 DEBUG Loader:281 - processing result set
17:54:55,781 DEBUG Loader:484 - result row: 1
17:54:55,781 DEBUG Loader:615 - Initializing object from ResultSet: 1
17:54:55,781 DEBUG Loader:684 - Hydrating entity: pruebas.Prueba1#1
17:54:55,781 DEBUG SessionImpl:1920 - Version: 0
17:54:55,781 DEBUG Loader:298 - done processing result set (1 rows)
17:54:55,781 DEBUG BatcherImpl:211 - done closing: 1 open PreparedStatements, 1 open ResultSets
17:54:55,812 DEBUG BatcherImpl:275 - closing statement
17:54:55,812 DEBUG Loader:318 - total objects hydrated: 1
17:54:55,812 DEBUG SessionImpl:2216 - resolving associations for [pruebas.Prueba1#1]
17:54:55,812 DEBUG SessionImpl:3994 - creating collection wrapper:[pruebas.Prueba1.pruebas2#1]
17:54:55,812 DEBUG SessionImpl:2247 - done materializing entity [pruebas.Prueba1#1]
17:54:55,812 DEBUG SessionImpl:1996 - loading [pruebas.Prueba2#pruebas.Prueba2@33505d]
17:54:55,828 DEBUG SessionImpl:2094 - attempting to resolve [pruebas.Prueba2#pruebas.Prueba2@33505d]
17:54:55,828 DEBUG SessionImpl:2130 - object not resolved in any cache [pruebas.Prueba2#pruebas.Prueba2@33505d]
17:54:55,828 DEBUG EntityPersister:410 - Materializing entity: [pruebas.Prueba2#pruebas.Prueba2@33505d]
17:54:55,828 DEBUG BatcherImpl:204 - about to open: 1 open PreparedStatements, 1 open ResultSets
17:54:55,828 DEBUG SQL:230 - select prueba20_.PR1_CODIGO as PR1_CODIGO0_, prueba20_.CODIGO as CODIGO0_, prueba20_.HIB_VERSION as HIB_VERS3_0_ from PRUEBA_2 prueba20_ where prueba20_.PR1_CODIGO=? and prueba20_.CODIGO=?
17:54:55,828 DEBUG BatcherImpl:253 - preparing statement
17:54:55,843 DEBUG Loader:281 - processing result set
17:54:55,843 DEBUG Loader:484 - result row: pruebas.Prueba2@33505d
17:54:55,859 DEBUG Loader:615 - Initializing object from ResultSet: pruebas.Prueba2@33505d
17:54:55,859 DEBUG Loader:684 - Hydrating entity: pruebas.Prueba2#pruebas.Prueba2@33505d
17:54:55,859 DEBUG SessionImpl:1920 - Version: 0
17:54:55,859 DEBUG Loader:298 - done processing result set (1 rows)
17:54:55,859 DEBUG BatcherImpl:211 - done closing: 1 open PreparedStatements, 1 open ResultSets
17:54:55,859 DEBUG BatcherImpl:275 - closing statement
17:54:55,875 DEBUG Loader:318 - total objects hydrated: 1
17:54:55,875 DEBUG SessionImpl:2216 - resolving associations for [pruebas.Prueba2#pruebas.Prueba2@33505d]
17:54:55,875 DEBUG SessionImpl:3994 - creating collection wrapper:[pruebas.Prueba2.pruebas3#pruebas.Prueba2@33505d]
17:54:55,875 DEBUG SessionImpl:2247 - done materializing entity [pruebas.Prueba2#pruebas.Prueba2@33505d]
17:54:55,890 DEBUG Loader:484 - result row: pruebas.Prueba3@3350c1
17:54:55,890 DEBUG Loader:615 - Initializing object from ResultSet: pruebas.Prueba3@3350c1
17:54:55,890 DEBUG Loader:684 - Hydrating entity: pruebas.Prueba3#pruebas.Prueba3@3350c1
17:54:55,890 DEBUG SessionImpl:1920 - Version: 0
17:54:55,890 DEBUG SessionImpl:1996 - loading [pruebas.Prueba1#1]
17:54:55,890 DEBUG SessionImpl:2094 - attempting to resolve [pruebas.Prueba1#1]
17:54:55,890 DEBUG SessionImpl:2110 - resolved object in session cache [pruebas.Prueba1#1]
17:54:55,906 DEBUG Loader:371 - found row of collection: [pruebas.Prueba2.pruebas3#pruebas.Prueba2@33505d]
17:54:55,906 DEBUG SessionImpl:3050 - uninitialized collection: initializing
17:54:55,906 DEBUG SessionImpl:1996 - loading [pruebas.Prueba1#1]
17:54:55,906 DEBUG SessionImpl:2094 - attempting to resolve [pruebas.Prueba1#1]
17:54:55,906 DEBUG SessionImpl:2110 - resolved object in session cache [pruebas.Prueba1#1]
17:54:55,906 DEBUG SessionImpl:1996 - loading [pruebas.Prueba2#pruebas.Prueba2@33505d]
17:54:55,906 DEBUG SessionImpl:2094 - attempting to resolve [pruebas.Prueba2#pruebas.Prueba2@33505d]
17:54:55,937 DEBUG SessionImpl:2110 - resolved object in session cache [pruebas.Prueba2#pruebas.Prueba2@33505d]
17:54:55,937 DEBUG SessionImpl:1996 - loading [pruebas.Prueba3#pruebas.Prueba3@3350c1]
17:54:55,937 DEBUG SessionImpl:2094 - attempting to resolve [pruebas.Prueba3#pruebas.Prueba3@3350c1]
17:54:55,937 DEBUG SessionImpl:2110 - resolved object in session cache [pruebas.Prueba3#pruebas.Prueba3@3350c1]
17:54:55,953 DEBUG Loader:298 - done processing result set (1 rows)
17:54:55,953 DEBUG BatcherImpl:211 - done closing: 0 open PreparedStatements, 0 open ResultSets
17:54:55,953 DEBUG BatcherImpl:275 - closing statement
17:54:55,953 DEBUG Loader:318 - total objects hydrated: 1
17:54:55,953 DEBUG SessionImpl:2216 - resolving associations for [pruebas.Prueba3#pruebas.Prueba3@3350c1]
17:54:55,953 DEBUG SessionImpl:2247 - done materializing entity [pruebas.Prueba3#pruebas.Prueba3@3350c1]
17:54:55,968 DEBUG SessionImpl:3109 - 2 collections were found in result set
17:54:55,968 DEBUG SessionImpl:3140 - collection fully initialized: [pruebas.Prueba2.pruebas3#pruebas.Prueba2@a2da11]
17:54:55,968 DEBUG SessionImpl:3140 - collection fully initialized: [pruebas.Prueba2.pruebas3#pruebas.Prueba2@33505d]
17:54:55,968 DEBUG SessionImpl:3143 - 2 collections initialized
17:54:55,968 DEBUG SessionImpl:3316 - collection initialized
17:54:55,984 DEBUG SessionImpl:3307 - initializing collection [pruebas.Prueba1.pruebas2#1]
17:54:55,984 DEBUG SessionImpl:3308 - checking second-level cache
17:54:55,984 DEBUG SessionImpl:3314 - collection not cached
17:54:55,984 DEBUG BatcherImpl:204 - about to open: 0 open PreparedStatements, 0 open ResultSets
17:54:55,984 DEBUG SQL:230 - select pruebas20_.PR1_CODIGO as PR1_CODIGO__, pruebas20_.CODIGO as CODIGO__, pruebas20_.PR1_CODIGO as PR1_CODIGO0_, pruebas20_.CODIGO as CODIGO0_, pruebas20_.HIB_VERSION as HIB_VERS3_0_ from PRUEBA_2 pruebas20_ where pruebas20_.PR1_CODIGO=?
17:54:55,984 DEBUG BatcherImpl:253 - preparing statement
17:54:56,000 DEBUG Loader:406 - result set contains (possibly empty) collection: [pruebas.Prueba1.pruebas2#1]
17:54:56,015 DEBUG SessionImpl:3050 - uninitialized collection: initializing
17:54:56,015 DEBUG Loader:281 - processing result set
17:54:56,015 DEBUG SessionImpl:1996 - loading [pruebas.Prueba1#1]
17:54:56,015 DEBUG SessionImpl:2094 - attempting to resolve [pruebas.Prueba1#1]
17:54:56,015 DEBUG SessionImpl:2110 - resolved object in session cache [pruebas.Prueba1#1]
17:54:56,015 DEBUG Loader:484 - result row: pruebas.Prueba2@33505d
17:54:56,015 DEBUG Loader:371 - found row of collection: [pruebas.Prueba1.pruebas2#1]
17:54:56,031 DEBUG SessionImpl:3073 - reading row
17:54:56,031 DEBUG SessionImpl:1996 - loading [pruebas.Prueba1#1]
17:54:56,031 DEBUG SessionImpl:2094 - attempting to resolve [pruebas.Prueba1#1]
17:54:56,031 DEBUG SessionImpl:2110 - resolved object in session cache [pruebas.Prueba1#1]
17:54:56,031 DEBUG SessionImpl:1996 - loading [pruebas.Prueba2#pruebas.Prueba2@33505d]
17:54:56,062 DEBUG SessionImpl:2094 - attempting to resolve [pruebas.Prueba2#pruebas.Prueba2@33505d]
17:54:56,062 DEBUG SessionImpl:2110 - resolved object in session cache [pruebas.Prueba2#pruebas.Prueba2@33505d]
17:54:56,062 DEBUG Loader:298 - done processing result set (1 rows)
17:54:56,062 DEBUG BatcherImpl:211 - done closing: 0 open PreparedStatements, 0 open ResultSets
17:54:56,062 DEBUG BatcherImpl:275 - closing statement
17:54:56,078 DEBUG Loader:318 - total objects hydrated: 0
17:54:56,078 DEBUG SessionImpl:3109 - 1 collections were found in result set
17:54:56,078 DEBUG SessionImpl:3140 - collection fully initialized: [pruebas.Prueba1.pruebas2#1]
17:54:56,078 DEBUG SessionImpl:3143 - 1 collections initialized
17:54:56,078 DEBUG SessionImpl:3316 - collection initialized
17:54:56,093 DEBUG JDBCTransaction:59 - commit
17:54:56,093 DEBUG SessionImpl:2267 - flushing session
17:54:56,093 DEBUG Cascades:497 - processing cascades for: pruebas.Prueba2
17:54:56,093 DEBUG Cascades:524 - cascading to collection: pruebas.Prueba2.pruebas3
17:54:56,093 DEBUG Cascades:506 - done processing cascades for: pruebas.Prueba2
17:54:56,093 DEBUG Cascades:497 - processing cascades for: pruebas.Prueba2
17:54:56,093 DEBUG Cascades:524 - cascading to collection: pruebas.Prueba2.pruebas3
17:54:56,093 DEBUG Cascades:113 - cascading to saveOrUpdate()
17:54:56,093 DEBUG SessionImpl:1382 - saveOrUpdate() persistent instance
17:54:56,093 DEBUG Cascades:506 - done processing cascades for: pruebas.Prueba2
17:54:56,109 DEBUG SessionImpl:2467 - Flushing entities and processing referenced collections
17:54:56,109 DEBUG SessionImpl:2916 - Collection found: [pruebas.Prueba2.pruebas3#pruebas.Prueba2@a2da11], was: [pruebas.Prueba2.pruebas3#pruebas.Prueba2@a2da11]
17:54:56,109 DEBUG SessionImpl:2916 - Collection found: [pruebas.Prueba1.pruebas2#1], was: [pruebas.Prueba1.pruebas2#1]
17:54:56,109 DEBUG SessionImpl:2916 - Collection found: [pruebas.Prueba2.pruebas3#pruebas.Prueba2@33505d], was: [pruebas.Prueba2.pruebas3#pruebas.Prueba2@33505d]
17:54:56,109 DEBUG SessionImpl:2808 - Processing unreferenced collections
17:54:56,109 DEBUG SessionImpl:2822 - Scheduling collection removes/(re)creates/updates
17:54:56,109 DEBUG SessionImpl:2291 - Flushed: 0 insertions, 0 updates, 0 deletions to 4 objects
17:54:56,125 DEBUG SessionImpl:2296 - Flushed: 0 (re)creations, 0 updates, 0 removals to 3 collections
17:54:56,125 DEBUG Printer:75 - listing entities:
17:54:56,125 DEBUG Printer:82 - pruebas.Prueba2{hibVersion=0, pruebas3=[]}
17:54:56,125 DEBUG Printer:82 - pruebas.Prueba2{hibVersion=0, pruebas3=[Prueba3]}
17:54:56,125 DEBUG Printer:82 - pruebas.Prueba3{hibVersion=0}
17:54:56,125 DEBUG Printer:82 - pruebas.Prueba1{hibVersion=0, pruebas2=[Prueba2], codigo=1}
17:54:56,125 DEBUG SessionImpl:2380 - executing flush
17:54:56,125 DEBUG SessionImpl:2852 - post flush
17:54:56,140 DEBUG SessionImpl:596 - transaction completion
17:54:56,140 DEBUG JDBCTransaction:103 - re-enabling autocommit
17:54:56,140 DEBUG SessionImpl:578 - closing session
17:54:56,140 DEBUG SessionImpl:3383 - disconnecting session
17:54:56,140 DEBUG SessionImpl:596 - transaction completion