[
  [
    "Documents and Settings/Alex Burgel/workspace/Hibernate3.2/test/org/hibernate/test/AllTests.java", 
    "Documents and Settings/Alex Burgel/workspace/Hibernate3.2/test/org/hibernate/test/AllTests.java", 
    [
      "Index: C:/Documents and Settings/Alex Burgel/workspace/Hibernate3.2/test/org/hibernate/test/AllTests.java", 
      "===================================================================", 
      "--- Documents and Settings/Alex Burgel/workspace/Hibernate3.2/test/org/hibernate/test/AllTests.java", 
      "+++ Documents and Settings/Alex Burgel/workspace/Hibernate3.2/test/org/hibernate/test/AllTests.java", 
      "@@ -88,6 +88,7 @@", 
      "import org.hibernate.test.mapping.ValueVisitorTest;", 
      "import org.hibernate.test.mappingexception.MappingExceptionTest;", 
      "import org.hibernate.test.mixed.MixedTest;", 
      "+import org.hibernate.test.naturalid.EntityNaturalIdTest;", 
      "import org.hibernate.test.naturalid.NaturalIdTest;", 
      "import org.hibernate.test.ondelete.OnDeleteTest;", 
      "import org.hibernate.test.onetomany.OneToManyTest;", 
      "@@ -176,6 +177,7 @@", 
      "suite.addTest( SaveOrUpdateTest.suite() );", 
      "suite.addTest( MergeTest.suite() );", 
      "suite.addTest( NaturalIdTest.suite() );", 
      "+\t\t\tsuite.addTest( EntityNaturalIdTest.suite() );", 
      "suite.addTest( ComponentTest.suite() );", 
      "suite.addTest( ProxyTest.suite() );", 
      "suite.addTest( VersionTest.suite() );"
    ]
  ], 
  [
    "Documents and Settings/Alex Burgel/workspace/Hibernate3.2/test/org/hibernate/test/naturalid/EntityNaturalIdTest.java", 
    "Documents and Settings/Alex Burgel/workspace/Hibernate3.2/test/org/hibernate/test/naturalid/EntityNaturalIdTest.java", 
    [
      "Index: C:/Documents and Settings/Alex Burgel/workspace/Hibernate3.2/test/org/hibernate/test/naturalid/EntityNaturalIdTest.java", 
      "===================================================================", 
      "--- Documents and Settings/Alex Burgel/workspace/Hibernate3.2/test/org/hibernate/test/naturalid/EntityNaturalIdTest.java", 
      "+++ Documents and Settings/Alex Burgel/workspace/Hibernate3.2/test/org/hibernate/test/naturalid/EntityNaturalIdTest.java", 
      "@@ -0,0 +1,105 @@", 
      "+package org.hibernate.test.naturalid;", 
      "+", 
      "+import java.lang.reflect.Field;", 
      "+", 
      "+import junit.framework.Test;", 
      "+import junit.framework.TestSuite;", 
      "+", 
      "+import org.hibernate.FetchMode;", 
      "+import org.hibernate.HibernateException;", 
      "+import org.hibernate.Session;", 
      "+import org.hibernate.Transaction;", 
      "+import org.hibernate.cfg.Configuration;", 
      "+import org.hibernate.cfg.Environment;", 
      "+import org.hibernate.criterion.Restrictions;", 
      "+import org.hibernate.test.TestCase;", 
      "+", 
      "+/**", 
      "+ * @author Alex Burgel", 
      "+ */", 
      "+public class EntityNaturalIdTest extends TestCase {", 
      "+", 
      "+    public EntityNaturalIdTest(String str) {", 
      "+        super(str);", 
      "+    }", 
      "+", 
      "+    public void testNaturalIdCheck() throws Exception {", 
      "+        Session s = openSession();", 
      "+        Transaction t = s.beginTransaction();", 
      "+", 
      "+        Parent p = new Parent(\"alex\");", 
      "+        Child c = new Child(\"billy\", p);", 
      "+", 
      "+        s.persist(p);", 
      "+        s.persist(c);", 
      "+        Field name = c.getClass().getDeclaredField(\"name\");", 
      "+        name.setAccessible(true);", 
      "+        name.set(c, \"phil\");", 
      "+        try {", 
      "+            s.flush();", 
      "+            fail();", 
      "+        }", 
      "+        catch (HibernateException he) {}", 
      "+        name.set(c, \"billy\");", 
      "+        s.delete(c);", 
      "+        s.delete(p);", 
      "+        t.commit();", 
      "+        s.close();", 
      "+    }", 
      "+", 
      "+    public void testSaveParentWithDetachedChildren() throws Exception {", 
      "+        Session s = openSession();", 
      "+        Transaction t = s.beginTransaction();", 
      "+", 
      "+        Parent p = new Parent(\"alex\");", 
      "+        Child c = new Child(\"billy\", p);", 
      "+", 
      "+        s.persist(p);", 
      "+        s.persist(c);", 
      "+        t.commit();", 
      "+        s.close();", 
      "+", 
      "+        s = openSession();", 
      "+        t = s.beginTransaction();", 
      "+", 
      "+        p = (Parent) s.createCriteria(Parent.class)", 
      "+        .add( Restrictions.eq(\"name\", \"alex\") )", 
      "+        .setFetchMode(\"children\", FetchMode.JOIN)", 
      "+        .setCacheable(true)", 
      "+        .uniqueResult();", 
      "+", 
      "+        t.commit();", 
      "+        s.close();", 
      "+", 
      "+        s = openSession();", 
      "+        t = s.beginTransaction();", 
      "+", 
      "+        Child c2 = new Child(\"joey\", p);", 
      "+        p.getChildren().add(c2);", 
      "+", 
      "+        s.update(p);", 
      "+", 
      "+        // this fails if AbstractEntityPersister returns identifiers instead of entities from", 
      "+        // AbstractEntityPersister.getNaturalIdSnapshot()", 
      "+        s.flush();", 
      "+", 
      "+        s.delete(p);", 
      "+        t.commit();", 
      "+        s.close();", 
      "+    }", 
      "+", 
      "+    protected void configure(Configuration cfg) {", 
      "+        cfg.setProperty(Environment.USE_SECOND_LEVEL_CACHE, \"true\");", 
      "+        cfg.setProperty(Environment.USE_QUERY_CACHE, \"true\");", 
      "+        cfg.setProperty(Environment.GENERATE_STATISTICS, \"true\");", 
      "+    }", 
      "+", 
      "+    protected String[] getMappings() {", 
      "+        return new String[] { \"naturalid/Parent.hbm.xml\" };", 
      "+    }", 
      "+", 
      "+    public static Test suite() {", 
      "+        return new TestSuite(EntityNaturalIdTest.class);", 
      "+    }", 
      "+", 
      "+}"
    ]
  ], 
  [
    "Documents and Settings/Alex Burgel/workspace/Hibernate3.2/test/org/hibernate/test/naturalid/Child.java", 
    "Documents and Settings/Alex Burgel/workspace/Hibernate3.2/test/org/hibernate/test/naturalid/Child.java", 
    [
      "Index: C:/Documents and Settings/Alex Burgel/workspace/Hibernate3.2/test/org/hibernate/test/naturalid/Child.java", 
      "===================================================================", 
      "--- Documents and Settings/Alex Burgel/workspace/Hibernate3.2/test/org/hibernate/test/naturalid/Child.java", 
      "+++ Documents and Settings/Alex Burgel/workspace/Hibernate3.2/test/org/hibernate/test/naturalid/Child.java", 
      "@@ -0,0 +1,20 @@", 
      "+//$Id$", 
      "+package org.hibernate.test.naturalid;", 
      "+", 
      "+/**", 
      "+ * @author Alex Burgel", 
      "+ */", 
      "+public class Child {", 
      "+", 
      "+\tprivate Long id;", 
      "+    private Parent parent;", 
      "+\tprivate String name;", 
      "+", 
      "+\tChild() {}", 
      "+", 
      "+\tpublic Child(String name, Parent parent) {", 
      "+\t\tthis.name = name;", 
      "+        this.parent = parent;", 
      "+\t}", 
      "+", 
      "+}"
    ]
  ], 
  [
    "Documents and Settings/Alex Burgel/workspace/Hibernate3.2/test/org/hibernate/test/naturalid/Parent.java", 
    "Documents and Settings/Alex Burgel/workspace/Hibernate3.2/test/org/hibernate/test/naturalid/Parent.java", 
    [
      "Index: C:/Documents and Settings/Alex Burgel/workspace/Hibernate3.2/test/org/hibernate/test/naturalid/Parent.java", 
      "===================================================================", 
      "--- Documents and Settings/Alex Burgel/workspace/Hibernate3.2/test/org/hibernate/test/naturalid/Parent.java", 
      "+++ Documents and Settings/Alex Burgel/workspace/Hibernate3.2/test/org/hibernate/test/naturalid/Parent.java", 
      "@@ -0,0 +1,35 @@", 
      "+//$Id$", 
      "+package org.hibernate.test.naturalid;", 
      "+", 
      "+import java.util.ArrayList;", 
      "+import java.util.List;", 
      "+", 
      "+/**", 
      "+ * @author Alex Burgel", 
      "+ */", 
      "+public class Parent {", 
      "+", 
      "+\tprivate Long id;", 
      "+\tprivate String name;", 
      "+\tprivate List children = new ArrayList();", 
      "+", 
      "+\tParent() {}", 
      "+", 
      "+\tpublic Parent(String name) {", 
      "+\t\tthis.name = name;", 
      "+\t}", 
      "+", 
      "+    public void setName(String name) {", 
      "+        this.name = name;", 
      "+    }", 
      "+", 
      "+    public List getChildren() {", 
      "+        return children;", 
      "+    }", 
      "+", 
      "+    public void setChildren(List children) {", 
      "+        this.children = children;", 
      "+    }", 
      "+", 
      "+", 
      "+}"
    ]
  ], 
  [
    "Documents and Settings/Alex Burgel/workspace/Hibernate3.2/test/org/hibernate/test/naturalid/Parent.hbm.xml", 
    "Documents and Settings/Alex Burgel/workspace/Hibernate3.2/test/org/hibernate/test/naturalid/Parent.hbm.xml", 
    [
      "Index: C:/Documents and Settings/Alex Burgel/workspace/Hibernate3.2/test/org/hibernate/test/naturalid/Parent.hbm.xml", 
      "===================================================================", 
      "--- Documents and Settings/Alex Burgel/workspace/Hibernate3.2/test/org/hibernate/test/naturalid/Parent.hbm.xml", 
      "+++ Documents and Settings/Alex Burgel/workspace/Hibernate3.2/test/org/hibernate/test/naturalid/Parent.hbm.xml", 
      "@@ -0,0 +1,41 @@", 
      "+<?xml version=\"1.0\"?>", 
      "+<!DOCTYPE hibernate-mapping PUBLIC", 
      "+\t\"-//Hibernate/Hibernate Mapping DTD 3.0//EN\"", 
      "+\t\"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd\">", 
      "+", 
      "+<!--", 
      "+", 
      "+  This mapping illustrates use of <natural-id> with a many-to-one.", 
      "+", 
      "+-->", 
      "+", 
      "+<hibernate-mapping", 
      "+\tpackage=\"org.hibernate.test.naturalid\"", 
      "+\tdefault-access=\"field\">", 
      "+", 
      "+\t<class name=\"Parent\" table=\"Parent\">", 
      "+\t\t<id name=\"id\">", 
      "+\t\t\t<generator class=\"increment\"/>", 
      "+\t\t</id>", 
      "+", 
      "+\t\t<property name=\"name\"/>", 
      "+", 
      "+\t\t<bag name=\"children\" inverse=\"true\" cascade=\"all\">", 
      "+\t\t\t<key column=\"parent\" />", 
      "+\t\t\t<one-to-many class=\"Child\" />", 
      "+\t\t</bag>", 
      "+", 
      "+\t</class>", 
      "+", 
      "+\t<class name=\"Child\" table=\"Child\">", 
      "+\t\t<id name=\"id\">", 
      "+\t\t\t<generator class=\"increment\"/>", 
      "+\t\t</id>", 
      "+", 
      "+\t\t<natural-id>", 
      "+\t\t\t<many-to-one name=\"parent\" class=\"Parent\" />", 
      "+\t\t\t<property name=\"name\"/>", 
      "+\t\t</natural-id>", 
      "+\t</class>", 
      "+", 
      "+</hibernate-mapping>"
    ]
  ], 
  [
    "Documents and Settings/Alex Burgel/workspace/Hibernate3.2/src/org/hibernate/persister/entity/AbstractEntityPersister.java", 
    "Documents and Settings/Alex Burgel/workspace/Hibernate3.2/src/org/hibernate/persister/entity/AbstractEntityPersister.java", 
    [
      "\\ No newline at end of file", 
      "Index: C:/Documents and Settings/Alex Burgel/workspace/Hibernate3.2/src/org/hibernate/persister/entity/AbstractEntityPersister.java", 
      "===================================================================", 
      "--- Documents and Settings/Alex Burgel/workspace/Hibernate3.2/src/org/hibernate/persister/entity/AbstractEntityPersister.java", 
      "+++ Documents and Settings/Alex Burgel/workspace/Hibernate3.2/src/org/hibernate/persister/entity/AbstractEntityPersister.java", 
      "@@ -3732,6 +3732,9 @@", 
      "", 
      "for ( int i = 0; i < naturalIdPropertyCount; i++ ) {", 
      "snapshot[i] = extractionTypes[i].hydrate( rs, getPropertyAliases( \"\", naturalIdPropertyIndexes[i] ), session, null );", 
      "+\t\t\t\t\t\tif (extractionTypes[i].isEntityType()) {", 
      "+\t\t\t\t\t\t\tsnapshot[i] = extractionTypes[i].resolve(snapshot[i], session, null);", 
      "+\t\t\t\t\t\t}", 
      "}", 
      "return snapshot;", 
      "}"
    ]
  ]
]