Index: src/main/resources/net/sf/ehcache/pool/builtin-sizeof.filter =================================================================== --- src/main/resources/net/sf/ehcache/pool/builtin-sizeof.filter (révision 5109) +++ src/main/resources/net/sf/ehcache/pool/builtin-sizeof.filter (copie de travail) @@ -24,3 +24,15 @@ # This TC internal field is shared amongst all clustered entries org.terracotta.cache.serialization.SerializedEntry.tcClazz + + +org.hibernate.proxy.AbstractLazyInitializer.session +org.hibernate.proxy.AbstractLazyInitializer.entityName +org.hibernate.proxy.pojo.BasicLazyInitializer.persistentClass +org.hibernate.proxy.pojo.BasicLazyInitializer.getIdentifierMethod +org.hibernate.proxy.pojo.BasicLazyInitializer.setIdentifierMethod +org.hibernate.proxy.pojo.BasicLazyInitializer.componentIdType +org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.interfaces +org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.interfaces + +org.hibernate.collection.AbstractPersistentCollection.session Index: src/test/resources/hibernate-config/ehcache.xml =================================================================== --- src/test/resources/hibernate-config/ehcache.xml (révision 5109) +++ src/test/resources/hibernate-config/ehcache.xml (copie de travail) @@ -1,7 +1,8 @@ - + Index: src/test/resources/hibernate-config/domain/PhoneNumber.hbm.xml =================================================================== --- src/test/resources/hibernate-config/domain/PhoneNumber.hbm.xml (révision 5109) +++ src/test/resources/hibernate-config/domain/PhoneNumber.hbm.xml (copie de travail) @@ -6,8 +6,9 @@ + - + Index: src/test/resources/hibernate-config/domain/Person.hbm.xml =================================================================== --- src/test/resources/hibernate-config/domain/Person.hbm.xml (révision 5109) +++ src/test/resources/hibernate-config/domain/Person.hbm.xml (copie de travail) @@ -30,6 +30,7 @@ + Index: src/test/java/net/sf/ehcache/hibernate/domain/PhoneNumber.java =================================================================== --- src/test/java/net/sf/ehcache/hibernate/domain/PhoneNumber.java (révision 5109) +++ src/test/java/net/sf/ehcache/hibernate/domain/PhoneNumber.java (copie de travail) @@ -22,16 +22,16 @@ * PhoneNumber */ public class PhoneNumber implements Serializable { - private long personId = 0; + private Person person = null; private String numberType = "home"; private long phone = 0; - public long getPersonId() { - return personId; + public Person getPerson() { + return person; } - public void setPersonId(long personId) { - this.personId = personId; + public void setPerson(Person person) { + this.person = person; } public String getNumberType() { @@ -50,16 +50,18 @@ this.phone = phone; } + @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((numberType == null) ? 0 : numberType.hashCode()); - result = prime * result + (int) (personId ^ (personId >>> 32)); + result = prime * result + (int) (person.getId() ^ (person.getId() >>> 32)); result = prime * result + (int) (phone ^ (phone >>> 32)); return result; } + @Override public boolean equals(Object obj) { if (this == obj) return true; @@ -73,13 +75,14 @@ return false; } else if (!numberType.equals(other.numberType)) return false; - if (personId != other.personId) + if (person.getId() != other.person.getId()) return false; if (phone != other.phone) return false; return true; } + @Override public String toString() { return numberType + ":" + phone; } Index: src/test/java/net/sf/ehcache/hibernate/domain/EventManager.java =================================================================== --- src/test/java/net/sf/ehcache/hibernate/domain/EventManager.java (révision 5109) +++ src/test/java/net/sf/ehcache/hibernate/domain/EventManager.java (copie de travail) @@ -198,7 +198,7 @@ session.beginTransaction(); Person aPerson = (Person) session.load(Person.class, personId); - pN.setPersonId(personId.longValue()); + pN.setPerson(aPerson); aPerson.getPhoneNumbers().add(pN); session.getTransaction().commit();