[hibernate-commits] Hibernate SVN: r15801 - in core/branches/Branch_3_2_4_SP1_CP: test/org/hibernate/test/generated and 4 other directories.
hibernate-commits at lists.jboss.org
hibernate-commits at lists.jboss.org
Mon Jan 19 18:42:12 EST 2009
Author: cbredesen
Date: 2009-01-19 18:42:12 -0500 (Mon, 19 Jan 2009)
New Revision: 15801
Added:
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/cases/TestSharedPKOneToOneExecutable.java
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/domain/EntityWithOneToOnes.java
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/domain/OneToOneNoProxy.java
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/domain/OneToOneProxy.java
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/domain/SharedPKOneToOne.hbm.xml
Modified:
core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/persister/entity/AbstractEntityPersister.java
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/generated/AbstractGeneratedPropertyTest.java
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/buildtime/InstrumentTest.java
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/cases/TestLazyExecutable.java
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/runtime/AbstractTransformingClassLoaderInstrumentTestCase.java
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/runtime/CGLIBInstrumentationTest.java
core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/runtime/JavassistInstrumentationTest.java
Log:
Ported changes for JBPAPP-1628
Modified: core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/persister/entity/AbstractEntityPersister.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/persister/entity/AbstractEntityPersister.java 2009-01-19 18:24:12 UTC (rev 15800)
+++ core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/persister/entity/AbstractEntityPersister.java 2009-01-19 23:42:12 UTC (rev 15801)
@@ -776,31 +776,35 @@
Object result = null;
PreparedStatement ps = null;
- ResultSet rs = null;
try {
final String lazySelect = getSQLLazySelectString();
- if ( lazySelect != null ) {
- // null sql means that the only lazy properties
- // are shared PK one-to-one associations which are
- // handled differently in the Type#nullSafeGet code...
- ps = session.getBatcher().prepareSelectStatement(lazySelect);
- getIdentifierType().nullSafeSet( ps, id, 1, session );
- rs = session.getBatcher().getResultSet( ps );
- rs.next();
+ ResultSet rs = null;
+ try {
+ if ( lazySelect != null ) {
+ // null sql means that the only lazy properties
+ // are shared PK one-to-one associations which are
+ // handled differently in the Type#nullSafeGet code...
+ ps = session.getBatcher().prepareSelectStatement(lazySelect);
+ getIdentifierType().nullSafeSet( ps, id, 1, session );
+ rs = ps.executeQuery();
+ rs.next();
+ }
+ final Object[] snapshot = entry.getLoadedState();
+ for ( int j = 0; j < lazyPropertyNames.length; j++ ) {
+ Object propValue = lazyPropertyTypes[j].nullSafeGet( rs, lazyPropertyColumnAliases[j], session, entity );
+ if ( initializeLazyProperty( fieldName, entity, session, snapshot, j, propValue ) ) {
+ result = propValue;
+ }
+ }
}
- final Object[] snapshot = entry.getLoadedState();
- for ( int j = 0; j < lazyPropertyNames.length; j++ ) {
- Object propValue = lazyPropertyTypes[j].nullSafeGet( rs, lazyPropertyColumnAliases[j], session, entity );
- if ( initializeLazyProperty( fieldName, entity, session, snapshot, j, propValue ) ) {
- result = propValue;
+ finally {
+ if ( rs != null ) {
+ rs.close();
}
}
}
finally {
- if ( rs != null ) {
- session.getBatcher().closeQueryStatement( ps, rs );
- }
- else if ( ps != null ) {
+ if ( ps != null ) {
session.getBatcher().closeStatement( ps );
}
}
@@ -3694,26 +3698,32 @@
try {
PreparedStatement ps = session.getBatcher().prepareSelectStatement( selectionSQL );
- ResultSet rs = null;
try {
getIdentifierType().nullSafeSet( ps, id, 1, session );
- rs = session.getBatcher().getResultSet( ps );
- if ( !rs.next() ) {
- throw new HibernateException(
- "Unable to locate row for retrieval of generated properties: " +
- MessageHelper.infoString( this, id, getFactory() )
- );
+ ResultSet rs = ps.executeQuery();
+ try {
+ if ( !rs.next() ) {
+ throw new HibernateException(
+ "Unable to locate row for retrieval of generated properties: " +
+ MessageHelper.infoString( this, id, getFactory() )
+ );
+ }
+ for ( int i = 0; i < getPropertySpan(); i++ ) {
+ if ( includeds[i] != ValueInclusion.NONE ) {
+ Object hydratedState = getPropertyTypes()[i].hydrate( rs, getPropertyAliases( "", i ), session, entity );
+ state[i] = getPropertyTypes()[i].resolve( hydratedState, session, entity );
+ setPropertyValue( entity, i, state[i], session.getEntityMode() );
+ }
+ }
}
- for ( int i = 0; i < getPropertySpan(); i++ ) {
- if ( includeds[i] != ValueInclusion.NONE ) {
- Object hydratedState = getPropertyTypes()[i].hydrate( rs, getPropertyAliases( "", i ), session, entity );
- state[i] = getPropertyTypes()[i].resolve( hydratedState, session, entity );
- setPropertyValue( entity, i, state[i], session.getEntityMode() );
+ finally {
+ if ( rs != null ) {
+ rs.close();
}
}
}
finally {
- session.getBatcher().closeQueryStatement( ps, rs );
+ session.getBatcher().closeStatement( ps );
}
}
catch( SQLException sqle ) {
Modified: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/generated/AbstractGeneratedPropertyTest.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/generated/AbstractGeneratedPropertyTest.java 2009-01-19 18:24:12 UTC (rev 15800)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/generated/AbstractGeneratedPropertyTest.java 2009-01-19 23:42:12 UTC (rev 15801)
@@ -17,6 +17,13 @@
}
public final void testGeneratedProperty() {
+ // The following block is repeated 300 times to reproduce HHH-2627.
+ // Without the fix, Oracle will run out of cursors using 10g with
+ // a default installation (ORA-01000: maximum open cursors exceeded).
+ // The number of loops may need to be adjusted depending on the how
+ // Oracle is configured.
+ // Note: The block is not indented to avoid a lot of irrelevant differences.
+ for ( int i=0; i<300; i++ ) {
GeneratedPropertyEntity entity = new GeneratedPropertyEntity();
entity.setName( "entity-1" );
Session s = openSession();
@@ -43,5 +50,6 @@
s.delete( entity );
t.commit();
s.close();
+ }
}
}
Modified: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/buildtime/InstrumentTest.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/buildtime/InstrumentTest.java 2009-01-19 18:24:12 UTC (rev 15800)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/buildtime/InstrumentTest.java 2009-01-19 23:42:12 UTC (rev 15801)
@@ -14,6 +14,7 @@
import org.hibernate.test.instrument.cases.TestIsPropertyInitializedExecutable;
import org.hibernate.test.instrument.cases.TestLazyPropertyCustomTypeExecutable;
import org.hibernate.test.instrument.cases.TestManyToOneProxyExecutable;
+import org.hibernate.test.instrument.cases.TestSharedPKOneToOneExecutable;
import org.hibernate.test.instrument.cases.Executable;
import org.hibernate.junit.UnitTestCase;
Modified: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/cases/TestLazyExecutable.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/cases/TestLazyExecutable.java 2009-01-19 18:24:12 UTC (rev 15800)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/cases/TestLazyExecutable.java 2009-01-19 23:42:12 UTC (rev 15801)
@@ -1,197 +1,208 @@
-package org.hibernate.test.instrument.cases;
-
-import org.hibernate.test.TestCase;
-import org.hibernate.test.instrument.cases.AbstractExecutable;
-import org.hibernate.test.instrument.domain.Owner;
-import org.hibernate.test.instrument.domain.Document;
-import org.hibernate.test.instrument.domain.Folder;
-import org.hibernate.Session;
-import org.hibernate.Transaction;
-import org.hibernate.Hibernate;
-import org.hibernate.LockMode;
-import org.hibernate.CacheMode;
-import org.hibernate.SessionFactory;
-
-/**
- * @author Steve Ebersole
- */
-public class TestLazyExecutable extends AbstractExecutable {
- public void execute() {
- SessionFactory factory = getFactory();
- Session s = factory.openSession();
- Transaction t = s.beginTransaction();
- Owner o = new Owner();
- Document doc = new Document();
- Folder fol = new Folder();
- o.setName("gavin");
- doc.setName("Hibernate in Action");
- doc.setSummary("blah");
- doc.updateText("blah blah");
- fol.setName("books");
- doc.setOwner(o);
- doc.setFolder(fol);
- fol.getDocuments().add(doc);
- s.save(o);
- s.save(fol);
- t.commit();
- s.close();
-
- s = factory.openSession();
- s.setCacheMode( CacheMode.IGNORE );
- t = s.beginTransaction();
- doc = ( Document ) s.get( Document.class, doc.getId() );
- TestCase.assertTrue( Hibernate.isPropertyInitialized(doc, "weirdProperty"));
- TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "name"));
- TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "text"));
- TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "upperCaseName"));
- TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "folder"));
- TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "owner"));
- doc.getUpperCaseName(); // should force initialization
- TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "text"));
- TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "weirdProperty"));
- TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "upperCaseName"));
- TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "folder"));
- TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "owner"));
- t.commit();
- s.close();
-
- s = factory.openSession();
- s.setCacheMode( CacheMode.IGNORE );
- t = s.beginTransaction();
- doc = (Document) s.createQuery("from Document").uniqueResult();
- doc.getName();
- TestCase.assertEquals( doc.getText(), "blah blah" );
- t.commit();
- s.close();
-
- s = factory.openSession();
- s.setCacheMode( CacheMode.IGNORE );
- t = s.beginTransaction();
- doc = (Document) s.createQuery("from Document").uniqueResult();
- doc.getName();
- TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "text"));
- TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "summary"));
- TestCase.assertEquals( doc.getText(), "blah blah" );
- TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "text"));
- TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "summary"));
- t.commit();
- s.close();
-
- s = factory.openSession();
- s.setCacheMode( CacheMode.IGNORE );
- t = s.beginTransaction();
- doc = (Document) s.createQuery("from Document").uniqueResult();
- doc.setName("HiA");
- t.commit();
- s.close();
-
- s = factory.openSession();
- s.setCacheMode( CacheMode.IGNORE );
- t = s.beginTransaction();
- doc = (Document) s.createQuery("from Document").uniqueResult();
- TestCase.assertEquals( doc.getName(), "HiA" );
- TestCase.assertEquals( doc.getText(), "blah blah" );
- t.commit();
- s.close();
-
- s = factory.openSession();
- s.setCacheMode( CacheMode.IGNORE );
- t = s.beginTransaction();
- doc = (Document) s.createQuery("from Document").uniqueResult();
- doc.getText();
- doc.setName("HiA second edition");
- t.commit();
- s.close();
-
- s = factory.openSession();
- s.setCacheMode( CacheMode.IGNORE );
- t = s.beginTransaction();
- doc = (Document) s.createQuery("from Document").uniqueResult();
- TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "weirdProperty"));
- TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "name"));
- TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "text"));
- TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "upperCaseName"));
- TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "owner"));
- TestCase.assertEquals( doc.getName(), "HiA second edition" );
- TestCase.assertEquals( doc.getText(), "blah blah" );
- TestCase.assertEquals( doc.getUpperCaseName(), "HIA SECOND EDITION" );
- TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "text"));
- TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "weirdProperty"));
- TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "upperCaseName"));
- t.commit();
- s.close();
-
- s = factory.openSession();
- s.setCacheMode( CacheMode.IGNORE );
- t = s.beginTransaction();
- doc = (Document) s.createQuery("from Document").uniqueResult();
- t.commit();
- s.close();
-
- TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "text"));
-
- s = factory.openSession();
- s.setCacheMode( CacheMode.IGNORE );
- t = s.beginTransaction();
- s.lock(doc, LockMode.NONE);
- TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "text"));
- TestCase.assertEquals( doc.getText(), "blah blah" );
- TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "text"));
- t.commit();
- s.close();
-
- s = factory.openSession();
- s.setCacheMode( CacheMode.IGNORE );
- t = s.beginTransaction();
- doc = (Document) s.createQuery("from Document").uniqueResult();
- t.commit();
- s.close();
-
- doc.setName("HiA2");
-
- TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "text"));
-
- s = factory.openSession();
- s.setCacheMode( CacheMode.IGNORE );
- t = s.beginTransaction();
- s.saveOrUpdate(doc);
- s.flush();
- TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "text"));
- TestCase.assertEquals( doc.getText(), "blah blah" );
- TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "text"));
- doc.updateText("blah blah blah blah");
- t.commit();
- s.close();
-
- s = factory.openSession();
- s.setCacheMode( CacheMode.IGNORE );
- t = s.beginTransaction();
- doc = ( Document ) s.createQuery("from Document").uniqueResult();
- TestCase.assertEquals( doc.getName(), "HiA2" );
- TestCase.assertEquals( doc.getText(), "blah blah blah blah" );
- t.commit();
- s.close();
-
- s = factory.openSession();
- s.setCacheMode( CacheMode.IGNORE );
- t = s.beginTransaction();
- doc = (Document) s.load( Document.class, doc.getId() );
- doc.getName();
- TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "text"));
- TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "summary"));
- t.commit();
- s.close();
-
- s = factory.openSession();
- s.setCacheMode( CacheMode.IGNORE );
- t = s.beginTransaction();
- doc = (Document) s.createQuery("from Document").uniqueResult();
- //s.delete(doc);
- s.delete( doc.getFolder() );
- s.delete( doc.getOwner() );
- s.flush();
- t.commit();
- s.close();
- }
-
-}
+package org.hibernate.test.instrument.cases;
+
+import org.hibernate.test.TestCase;
+import org.hibernate.test.instrument.cases.AbstractExecutable;
+import org.hibernate.test.instrument.domain.Owner;
+import org.hibernate.test.instrument.domain.Document;
+import org.hibernate.test.instrument.domain.Folder;
+import org.hibernate.Session;
+import org.hibernate.Transaction;
+import org.hibernate.Hibernate;
+import org.hibernate.LockMode;
+import org.hibernate.CacheMode;
+import org.hibernate.SessionFactory;
+
+/**
+ * @author Steve Ebersole
+ */
+public class TestLazyExecutable extends AbstractExecutable {
+ public void execute() {
+ // The following block is repeated 100 times to reproduce HHH-2627.
+ // Without the fix, Oracle will run out of cursors using 10g with
+ // a default installation (ORA-01000: maximum open cursors exceeded).
+ // The number of loops may need to be adjusted depending on the how
+ // Oracle is configured.
+ // Note: The block is not indented to avoid a lot of irrelevant differences.
+ for ( int i=0; i<100; i++ ) {
+
+ SessionFactory factory = getFactory();
+ Session s = factory.openSession();
+ Transaction t = s.beginTransaction();
+ Owner o = new Owner();
+ Document doc = new Document();
+ Folder fol = new Folder();
+ o.setName("gavin");
+ doc.setName("Hibernate in Action");
+ doc.setSummary("blah");
+ doc.updateText("blah blah");
+ fol.setName("books");
+ doc.setOwner(o);
+ doc.setFolder(fol);
+ fol.getDocuments().add(doc);
+ s.save(o);
+ s.save(fol);
+ t.commit();
+ s.close();
+
+ s = factory.openSession();
+ s.setCacheMode( CacheMode.IGNORE );
+ t = s.beginTransaction();
+ doc = ( Document ) s.get( Document.class, doc.getId() );
+ TestCase.assertTrue( Hibernate.isPropertyInitialized(doc, "weirdProperty"));
+ TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "name"));
+ TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "text"));
+ TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "upperCaseName"));
+ TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "folder"));
+ TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "owner"));
+ doc.getUpperCaseName(); // should force initialization
+ TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "text"));
+ TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "weirdProperty"));
+ TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "upperCaseName"));
+ TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "folder"));
+ TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "owner"));
+ t.commit();
+ s.close();
+
+ s = factory.openSession();
+ s.setCacheMode( CacheMode.IGNORE );
+ t = s.beginTransaction();
+ doc = (Document) s.createQuery("from Document").uniqueResult();
+ doc.getName();
+ TestCase.assertEquals( doc.getText(), "blah blah" );
+ t.commit();
+ s.close();
+
+ s = factory.openSession();
+ s.setCacheMode( CacheMode.IGNORE );
+ t = s.beginTransaction();
+ doc = (Document) s.createQuery("from Document").uniqueResult();
+ doc.getName();
+ TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "text"));
+ TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "summary"));
+ TestCase.assertEquals( doc.getText(), "blah blah" );
+ TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "text"));
+ TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "summary"));
+ t.commit();
+ s.close();
+
+ s = factory.openSession();
+ s.setCacheMode( CacheMode.IGNORE );
+ t = s.beginTransaction();
+ doc = (Document) s.createQuery("from Document").uniqueResult();
+ doc.setName("HiA");
+ t.commit();
+ s.close();
+
+ s = factory.openSession();
+ s.setCacheMode( CacheMode.IGNORE );
+ t = s.beginTransaction();
+ doc = (Document) s.createQuery("from Document").uniqueResult();
+ TestCase.assertEquals( doc.getName(), "HiA" );
+ TestCase.assertEquals( doc.getText(), "blah blah" );
+ t.commit();
+ s.close();
+
+ s = factory.openSession();
+ s.setCacheMode( CacheMode.IGNORE );
+ t = s.beginTransaction();
+ doc = (Document) s.createQuery("from Document").uniqueResult();
+ doc.getText();
+ doc.setName("HiA second edition");
+ t.commit();
+ s.close();
+
+ s = factory.openSession();
+ s.setCacheMode( CacheMode.IGNORE );
+ t = s.beginTransaction();
+ doc = (Document) s.createQuery("from Document").uniqueResult();
+ TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "weirdProperty"));
+ TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "name"));
+ TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "text"));
+ TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "upperCaseName"));
+ TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "owner"));
+ TestCase.assertEquals( doc.getName(), "HiA second edition" );
+ TestCase.assertEquals( doc.getText(), "blah blah" );
+ TestCase.assertEquals( doc.getUpperCaseName(), "HIA SECOND EDITION" );
+ TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "text"));
+ TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "weirdProperty"));
+ TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "upperCaseName"));
+ t.commit();
+ s.close();
+
+ s = factory.openSession();
+ s.setCacheMode( CacheMode.IGNORE );
+ t = s.beginTransaction();
+ doc = (Document) s.createQuery("from Document").uniqueResult();
+ t.commit();
+ s.close();
+
+ TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "text"));
+
+ s = factory.openSession();
+ s.setCacheMode( CacheMode.IGNORE );
+ t = s.beginTransaction();
+ s.lock(doc, LockMode.NONE);
+ TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "text"));
+ TestCase.assertEquals( doc.getText(), "blah blah" );
+ TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "text"));
+ t.commit();
+ s.close();
+
+ s = factory.openSession();
+ s.setCacheMode( CacheMode.IGNORE );
+ t = s.beginTransaction();
+ doc = (Document) s.createQuery("from Document").uniqueResult();
+ t.commit();
+ s.close();
+
+ doc.setName("HiA2");
+
+ TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "text"));
+
+ s = factory.openSession();
+ s.setCacheMode( CacheMode.IGNORE );
+ t = s.beginTransaction();
+ s.saveOrUpdate(doc);
+ s.flush();
+ TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "text"));
+ TestCase.assertEquals( doc.getText(), "blah blah" );
+ TestCase.assertTrue(Hibernate.isPropertyInitialized(doc, "text"));
+ doc.updateText("blah blah blah blah");
+ t.commit();
+ s.close();
+
+ s = factory.openSession();
+ s.setCacheMode( CacheMode.IGNORE );
+ t = s.beginTransaction();
+ doc = ( Document ) s.createQuery("from Document").uniqueResult();
+ TestCase.assertEquals( doc.getName(), "HiA2" );
+ TestCase.assertEquals( doc.getText(), "blah blah blah blah" );
+ t.commit();
+ s.close();
+
+ s = factory.openSession();
+ s.setCacheMode( CacheMode.IGNORE );
+ t = s.beginTransaction();
+ doc = (Document) s.load( Document.class, doc.getId() );
+ doc.getName();
+ TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "text"));
+ TestCase.assertFalse(Hibernate.isPropertyInitialized(doc, "summary"));
+ t.commit();
+ s.close();
+
+ s = factory.openSession();
+ s.setCacheMode( CacheMode.IGNORE );
+ t = s.beginTransaction();
+ doc = (Document) s.createQuery("from Document").uniqueResult();
+ //s.delete(doc);
+ s.delete( doc.getFolder() );
+ s.delete( doc.getOwner() );
+ s.flush();
+ t.commit();
+ s.close();
+
+ }
+
+ }
+
+}
Added: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/cases/TestSharedPKOneToOneExecutable.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/cases/TestSharedPKOneToOneExecutable.java (rev 0)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/cases/TestSharedPKOneToOneExecutable.java 2009-01-19 23:42:12 UTC (rev 15801)
@@ -0,0 +1,69 @@
+package org.hibernate.test.instrument.cases;
+
+import org.hibernate.Session;
+import org.hibernate.Transaction;
+import org.hibernate.Hibernate;
+import org.hibernate.test.instrument.domain.EntityWithOneToOnes;
+import org.hibernate.test.instrument.domain.OneToOneProxy;
+import org.hibernate.test.instrument.domain.OneToOneNoProxy;
+import junit.framework.Assert;
+
+/**
+ *
+ * @author Gail Badner
+ */
+public class TestSharedPKOneToOneExecutable extends AbstractExecutable {
+
+ protected String[] getResources() {
+ return new String[] {"org/hibernate/test/instrument/domain/SharedPKOneToOne.hbm.xml"};
+ }
+
+ public void execute() {
+ Session s = getFactory().openSession();
+ Transaction t = s.beginTransaction();
+ EntityWithOneToOnes root = new EntityWithOneToOnes( "root" );
+ OneToOneProxy oneToOneProxy = new OneToOneProxy( "oneToOneProxy" );
+ root.setOneToOneProxy( oneToOneProxy );
+ oneToOneProxy.setEntity( root );
+ OneToOneNoProxy oneToOneNoProxy = new OneToOneNoProxy( "oneToOneNoProxy" );
+ root.setOneToOneNoProxy( oneToOneNoProxy );
+ oneToOneNoProxy.setEntity( root );
+
+ s.save( root );
+ t.commit();
+ s.close();
+
+ // NOTE : oneToOneProxy is mapped with lazy="proxy"; oneToOneNoProxy with lazy="no-proxy"...
+
+ s = getFactory().openSession();
+ t = s.beginTransaction();
+ // load root
+ root = ( EntityWithOneToOnes ) s.load( EntityWithOneToOnes.class, root.getId() );
+ Assert.assertFalse( Hibernate.isInitialized( root ) );
+ Assert.assertFalse( Hibernate.isPropertyInitialized( root, "name" ) );
+ Assert.assertFalse( Hibernate.isPropertyInitialized( root, "oneToOneProxy" ) );
+ Assert.assertFalse( Hibernate.isPropertyInitialized( root, "oneToOneNoProxy" ) );
+
+ root.getName();
+ Assert.assertTrue( Hibernate.isInitialized( root ) );
+ Assert.assertTrue( Hibernate.isPropertyInitialized( root, "name" ) );
+ Assert.assertTrue( Hibernate.isPropertyInitialized( root, "oneToOneProxy" ) );
+ Assert.assertFalse( Hibernate.isPropertyInitialized( root, "oneToOneNoProxy" ) );
+
+ // get a handle to the oneToOneProxy proxy reference (and make certain that
+ // this does not force the lazy properties of the root entity
+ // to get initialized.
+ root.getOneToOneProxy();
+ Assert.assertTrue( Hibernate.isInitialized( oneToOneProxy ) );
+ Assert.assertTrue( Hibernate.isPropertyInitialized( root.getOneToOneProxy(), "name" ) );
+ Assert.assertFalse( Hibernate.isPropertyInitialized( root, "oneToOneNoProxy" ) );
+
+ root.getOneToOneNoProxy();
+ Assert.assertTrue( Hibernate.isPropertyInitialized( root, "oneToOneNoProxy" ) );
+ Assert.assertTrue( Hibernate.isPropertyInitialized( root.getOneToOneNoProxy(), "name") );
+
+ s.delete( root );
+ t.commit();
+ s.close();
+ }
+}
Added: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/domain/EntityWithOneToOnes.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/domain/EntityWithOneToOnes.java (rev 0)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/domain/EntityWithOneToOnes.java 2009-01-19 23:42:12 UTC (rev 15801)
@@ -0,0 +1,50 @@
+package org.hibernate.test.instrument.domain;
+
+/**
+ * @author Gail Badner
+ */
+public class EntityWithOneToOnes {
+ private Long id;
+ private String name;
+ private OneToOneNoProxy oneToOneNoProxy;
+ private OneToOneProxy oneToOneProxy;
+
+ public EntityWithOneToOnes() {
+ }
+
+ public EntityWithOneToOnes(String name) {
+ this.name = name;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public OneToOneNoProxy getOneToOneNoProxy() {
+ return oneToOneNoProxy;
+ }
+
+ public void setOneToOneNoProxy(OneToOneNoProxy oneToOneNoProxy) {
+ this.oneToOneNoProxy = oneToOneNoProxy;
+ }
+
+ public OneToOneProxy getOneToOneProxy() {
+ return oneToOneProxy;
+ }
+
+ public void setOneToOneProxy(OneToOneProxy oneToOneProxy) {
+ this.oneToOneProxy = oneToOneProxy;
+ }
+}
Added: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/domain/OneToOneNoProxy.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/domain/OneToOneNoProxy.java (rev 0)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/domain/OneToOneNoProxy.java 2009-01-19 23:42:12 UTC (rev 15801)
@@ -0,0 +1,45 @@
+package org.hibernate.test.instrument.domain;
+
+/**
+ * @author Gail Badner
+ */
+public class OneToOneNoProxy {
+ private Long entityId;
+ private String name;
+ private EntityWithOneToOnes entity;
+
+ public OneToOneNoProxy() {}
+ public OneToOneNoProxy(String name) {
+ this.name = name;
+ }
+ /**
+ * @return Returns the id.
+ */
+ public Long getEntityId() {
+ return entityId;
+ }
+ /**
+ * @param entityId The id to set.
+ */
+ public void setEntityId(Long entityId) {
+ this.entityId = entityId;
+ }
+ /**
+ * @return Returns the name.
+ */
+ public String getName() {
+ return name;
+ }
+ /**
+ * @param name The name to set.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+ public EntityWithOneToOnes getEntity() {
+ return entity;
+ }
+ public void setEntity(EntityWithOneToOnes entity) {
+ this.entity = entity;
+ }
+}
Added: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/domain/OneToOneProxy.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/domain/OneToOneProxy.java (rev 0)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/domain/OneToOneProxy.java 2009-01-19 23:42:12 UTC (rev 15801)
@@ -0,0 +1,45 @@
+package org.hibernate.test.instrument.domain;
+
+/**
+ * @author Gail Badner
+ */
+public class OneToOneProxy {
+ private Long entityId;
+ private String name;
+ private EntityWithOneToOnes entity;
+
+ public OneToOneProxy() {}
+ public OneToOneProxy(String name) {
+ this.name = name;
+ }
+ /**
+ * @return Returns the id.
+ */
+ public Long getEntityId() {
+ return entityId;
+ }
+ /**
+ * @param entityId The id to set.
+ */
+ public void setEntityId(Long entityId) {
+ this.entityId = entityId;
+ }
+ /**
+ * @return Returns the name.
+ */
+ public String getName() {
+ return name;
+ }
+ /**
+ * @param name The name to set.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+ public EntityWithOneToOnes getEntity() {
+ return entity;
+ }
+ public void setEntity(EntityWithOneToOnes entity) {
+ this.entity = entity;
+ }
+}
Added: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/domain/SharedPKOneToOne.hbm.xml
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/domain/SharedPKOneToOne.hbm.xml (rev 0)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/domain/SharedPKOneToOne.hbm.xml 2009-01-19 23:42:12 UTC (rev 15801)
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<!--
+
+ This mapping demonstrates shared PK one-to-one associations using
+ lazy="proxy" and lazy="no-proxy".
+
+ Implementation note: This test does not include any other
+ lazy properties, and allows testing special case code in
+ AbstractEntityPersister.initializeLazyPropertiesFromDatastore()
+ (lazy select string will be null) and OneToOne.nullSafeGet()
+ (ResultSet arg is ignored and the owner's ID is returned).
+
+-->
+
+<hibernate-mapping package="org.hibernate.test.instrument.domain" default-access="field">
+
+ <class name="EntityWithOneToOnes">
+ <id name="id" column="ID" type="long">
+ <generator class="increment"/>
+ </id>
+ <one-to-one name="oneToOneNoProxy" class="OneToOneNoProxy" lazy="no-proxy" cascade="all" />
+ <one-to-one name="oneToOneProxy" class="OneToOneProxy" lazy="proxy" cascade="all" />
+ <property name="name"/>
+ </class>
+
+ <class name="OneToOneNoProxy">
+ <id name="entityId">
+ <generator class="foreign">
+ <param name="property">entity</param>
+ </generator>
+ </id>
+ <one-to-one name="entity" class="EntityWithOneToOnes" constrained="true"/>
+ <property name="name"/>
+ </class>
+
+ <class name="OneToOneProxy">
+ <id name="entityId">
+ <generator class="foreign">
+ <param name="property">entity</param>
+ </generator>
+ </id>
+ <one-to-one name="entity" class="EntityWithOneToOnes" constrained="true"/>
+ <property name="name"/>
+ </class>
+
+
+</hibernate-mapping>
Modified: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/runtime/AbstractTransformingClassLoaderInstrumentTestCase.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/runtime/AbstractTransformingClassLoaderInstrumentTestCase.java 2009-01-19 18:24:12 UTC (rev 15800)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/runtime/AbstractTransformingClassLoaderInstrumentTestCase.java 2009-01-19 23:42:12 UTC (rev 15801)
@@ -1,119 +1,121 @@
-package org.hibernate.test.instrument.runtime;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.hibernate.HibernateException;
-import org.hibernate.bytecode.BytecodeProvider;
-import org.hibernate.bytecode.InstrumentedClassLoader;
-import org.hibernate.bytecode.util.BasicClassFilter;
-import org.hibernate.bytecode.util.FieldFilter;
-import org.hibernate.junit.AbstractClassLoaderIsolatedTestCase;
-
-/**
- * @author Steve Ebersole
- */
-public abstract class AbstractTransformingClassLoaderInstrumentTestCase extends AbstractClassLoaderIsolatedTestCase {
-
- public AbstractTransformingClassLoaderInstrumentTestCase(String string) {
- super( string );
- }
-
- protected ClassLoader buildIsolatedClassLoader(ClassLoader parent) {
- BytecodeProvider provider = buildBytecodeProvider();
- return new InstrumentedClassLoader(
- parent,
- provider.getTransformer(
- new BasicClassFilter( new String[] { "org.hibernate.test.instrument" }, null ),
- new FieldFilter() {
- public boolean shouldInstrumentField(String className, String fieldName) {
- return className.startsWith( "org.hibernate.test.instrument.domain" );
- }
- public boolean shouldTransformFieldAccess(String transformingClassName, String fieldOwnerClassName, String fieldName) {
- return fieldOwnerClassName.startsWith( "org.hibernate.test.instrument.domain" )
- && transformingClassName.equals( fieldOwnerClassName );
- }
- }
- )
- );
-
- }
-
- protected void releaseIsolatedClassLoader(ClassLoader isolatedLoader) {
- }
-
- protected abstract BytecodeProvider buildBytecodeProvider();
-
-
- // the tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- public void testSetFieldInterceptor() {
- executeExecutable( "org.hibernate.test.instrument.cases.TestInjectFieldInterceptorExecutable" );
- }
-
- public void testDirtyCheck() {
- executeExecutable( "org.hibernate.test.instrument.cases.TestDirtyCheckExecutable" );
- }
-
- public void testFetchAll() throws Exception {
- executeExecutable( "org.hibernate.test.instrument.cases.TestFetchAllExecutable" );
- }
-
- public void testLazy() {
- executeExecutable( "org.hibernate.test.instrument.cases.TestLazyExecutable" );
- }
-
- public void testLazyManyToOne() {
- executeExecutable( "org.hibernate.test.instrument.cases.TestLazyManyToOneExecutable" );
- }
-
- public void testPropertyInitialized() {
- executeExecutable( "org.hibernate.test.instrument.cases.TestIsPropertyInitializedExecutable" );
- }
-
- public void testManyToOneProxy() {
- executeExecutable( "org.hibernate.test.instrument.cases.TestManyToOneProxyExecutable" );
- }
-
- public void testLazyPropertyCustomType() {
- executeExecutable( "org.hibernate.test.instrument.cases.TestLazyPropertyCustomTypeExecutable" );
- }
-
-
-
- // reflection code to ensure isolation into the created classloader ~~~~~~~
-
- private static final Class[] SIG = new Class[] {};
- private static final Object[] ARGS = new Object[] {};
-
- public void executeExecutable(String name) {
- Class execClass = null;
- Object executable = null;
- try {
- execClass = Thread.currentThread().getContextClassLoader().loadClass( name );
- executable = execClass.newInstance();
- }
- catch( Throwable t ) {
- throw new HibernateException( "could not load executable", t );
- }
- try {
- execClass.getMethod( "prepare", SIG ).invoke( executable, ARGS );
- execClass.getMethod( "execute", SIG ).invoke( executable, ARGS );
- }
- catch ( NoSuchMethodException e ) {
- throw new HibernateException( "could not exeucte executable", e );
- }
- catch ( IllegalAccessException e ) {
- throw new HibernateException( "could not exeucte executable", e );
- }
- catch ( InvocationTargetException e ) {
- throw new HibernateException( "could not exeucte executable", e.getTargetException() );
- }
- finally {
- try {
- execClass.getMethod( "complete", SIG ).invoke( executable, ARGS );
- }
- catch ( Throwable ignore ) {
- }
- }
- }
-}
+package org.hibernate.test.instrument.runtime;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.hibernate.HibernateException;
+import org.hibernate.bytecode.BytecodeProvider;
+import org.hibernate.bytecode.InstrumentedClassLoader;
+import org.hibernate.bytecode.util.BasicClassFilter;
+import org.hibernate.bytecode.util.FieldFilter;
+import org.hibernate.junit.AbstractClassLoaderIsolatedTestCase;
+
+/**
+ * @author Steve Ebersole
+ */
+public abstract class AbstractTransformingClassLoaderInstrumentTestCase extends AbstractClassLoaderIsolatedTestCase {
+
+ public AbstractTransformingClassLoaderInstrumentTestCase(String string) {
+ super( string );
+ }
+
+ protected ClassLoader buildIsolatedClassLoader(ClassLoader parent) {
+ BytecodeProvider provider = buildBytecodeProvider();
+ return new InstrumentedClassLoader(
+ parent,
+ provider.getTransformer(
+ new BasicClassFilter( new String[] { "org.hibernate.test.instrument" }, null ),
+ new FieldFilter() {
+ public boolean shouldInstrumentField(String className, String fieldName) {
+ return className.startsWith( "org.hibernate.test.instrument.domain" );
+ }
+ public boolean shouldTransformFieldAccess(String transformingClassName, String fieldOwnerClassName, String fieldName) {
+ return fieldOwnerClassName.startsWith( "org.hibernate.test.instrument.domain" )
+ && transformingClassName.equals( fieldOwnerClassName );
+ }
+ }
+ )
+ );
+
+ }
+
+ protected void releaseIsolatedClassLoader(ClassLoader isolatedLoader) {
+ }
+
+ protected abstract BytecodeProvider buildBytecodeProvider();
+
+
+ // the tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ public void testSetFieldInterceptor() {
+ executeExecutable( "org.hibernate.test.instrument.cases.TestInjectFieldInterceptorExecutable" );
+ }
+
+ public void testDirtyCheck() {
+ executeExecutable( "org.hibernate.test.instrument.cases.TestDirtyCheckExecutable" );
+ }
+
+ public void testFetchAll() throws Exception {
+ executeExecutable( "org.hibernate.test.instrument.cases.TestFetchAllExecutable" );
+ }
+
+ public void testLazy() {
+ executeExecutable( "org.hibernate.test.instrument.cases.TestLazyExecutable" );
+ }
+
+ public void testLazyManyToOne() {
+ executeExecutable( "org.hibernate.test.instrument.cases.TestLazyManyToOneExecutable" );
+ }
+
+ public void testPropertyInitialized() {
+ executeExecutable( "org.hibernate.test.instrument.cases.TestIsPropertyInitializedExecutable" );
+ }
+
+ public void testManyToOneProxy() {
+ executeExecutable( "org.hibernate.test.instrument.cases.TestManyToOneProxyExecutable" );
+ }
+
+ public void testLazyPropertyCustomType() {
+ executeExecutable( "org.hibernate.test.instrument.cases.TestLazyPropertyCustomTypeExecutable" );
+ }
+
+ public void testSharedPKOneToOne() {
+ executeExecutable( "org.hibernate.test.instrument.cases.TestSharedPKOneToOneExecutable" );
+ }
+
+ // reflection code to ensure isolation into the created classloader ~~~~~~~
+
+ private static final Class[] SIG = new Class[] {};
+ private static final Object[] ARGS = new Object[] {};
+
+ public void executeExecutable(String name) {
+ Class execClass = null;
+ Object executable = null;
+ try {
+ execClass = Thread.currentThread().getContextClassLoader().loadClass( name );
+ executable = execClass.newInstance();
+ }
+ catch( Throwable t ) {
+ throw new HibernateException( "could not load executable", t );
+ }
+ try {
+ execClass.getMethod( "prepare", SIG ).invoke( executable, ARGS );
+ execClass.getMethod( "execute", SIG ).invoke( executable, ARGS );
+ }
+ catch ( NoSuchMethodException e ) {
+ throw new HibernateException( "could not exeucte executable", e );
+ }
+ catch ( IllegalAccessException e ) {
+ throw new HibernateException( "could not exeucte executable", e );
+ }
+ catch ( InvocationTargetException e ) {
+ throw new HibernateException( "could not exeucte executable", e.getTargetException() );
+ }
+ finally {
+ try {
+ execClass.getMethod( "complete", SIG ).invoke( executable, ARGS );
+ }
+ catch ( Throwable ignore ) {
+ }
+ }
+ }
+}
Modified: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/runtime/CGLIBInstrumentationTest.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/runtime/CGLIBInstrumentationTest.java 2009-01-19 18:24:12 UTC (rev 15800)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/runtime/CGLIBInstrumentationTest.java 2009-01-19 23:42:12 UTC (rev 15801)
@@ -1,51 +1,55 @@
-package org.hibernate.test.instrument.runtime;
-
-import org.hibernate.bytecode.BytecodeProvider;
-import org.hibernate.bytecode.cglib.BytecodeProviderImpl;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * @author Steve Ebersole
- */
-public class CGLIBInstrumentationTest extends AbstractTransformingClassLoaderInstrumentTestCase {
- public CGLIBInstrumentationTest(String string) {
- super( string );
- }
-
- protected BytecodeProvider buildBytecodeProvider() {
- return new BytecodeProviderImpl();
- }
-
- public static Test suite() {
- return new TestSuite( CGLIBInstrumentationTest.class );
- }
-
- public void testSetFieldInterceptor() {
- super.testSetFieldInterceptor(); //To change body of overridden methods use File | Settings | File Templates.
- }
-
- public void testDirtyCheck() {
- super.testDirtyCheck(); //To change body of overridden methods use File | Settings | File Templates.
- }
-
- public void testFetchAll() throws Exception {
- super.testFetchAll(); //To change body of overridden methods use File | Settings | File Templates.
- }
-
- public void testLazy() {
- super.testLazy(); //To change body of overridden methods use File | Settings | File Templates.
- }
-
- public void testLazyManyToOne() {
- super.testLazyManyToOne(); //To change body of overridden methods use File | Settings | File Templates.
- }
-
- public void testPropertyInitialized() {
- super.testPropertyInitialized(); //To change body of overridden methods use File | Settings | File Templates.
- }
-
- public void testManyToOneProxy() {
- super.testManyToOneProxy(); //To change body of overridden methods use File | Settings | File Templates.
- }
-}
+package org.hibernate.test.instrument.runtime;
+
+import org.hibernate.bytecode.BytecodeProvider;
+import org.hibernate.bytecode.cglib.BytecodeProviderImpl;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * @author Steve Ebersole
+ */
+public class CGLIBInstrumentationTest extends AbstractTransformingClassLoaderInstrumentTestCase {
+ public CGLIBInstrumentationTest(String string) {
+ super( string );
+ }
+
+ protected BytecodeProvider buildBytecodeProvider() {
+ return new BytecodeProviderImpl();
+ }
+
+ public static Test suite() {
+ return new TestSuite( CGLIBInstrumentationTest.class );
+ }
+
+ public void testSetFieldInterceptor() {
+ super.testSetFieldInterceptor(); //To change body of overridden methods use File | Settings | File Templates.
+ }
+
+ public void testDirtyCheck() {
+ super.testDirtyCheck(); //To change body of overridden methods use File | Settings | File Templates.
+ }
+
+ public void testFetchAll() throws Exception {
+ super.testFetchAll(); //To change body of overridden methods use File | Settings | File Templates.
+ }
+
+ public void testLazy() {
+ super.testLazy(); //To change body of overridden methods use File | Settings | File Templates.
+ }
+
+ public void testLazyManyToOne() {
+ super.testLazyManyToOne(); //To change body of overridden methods use File | Settings | File Templates.
+ }
+
+ public void testPropertyInitialized() {
+ super.testPropertyInitialized(); //To change body of overridden methods use File | Settings | File Templates.
+ }
+
+ public void testManyToOneProxy() {
+ super.testManyToOneProxy(); //To change body of overridden methods use File | Settings | File Templates.
+ }
+
+ public void testSharedPKOneToOne() {
+ super.testSharedPKOneToOne();
+ }
+}
Modified: core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/runtime/JavassistInstrumentationTest.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/runtime/JavassistInstrumentationTest.java 2009-01-19 18:24:12 UTC (rev 15800)
+++ core/branches/Branch_3_2_4_SP1_CP/test/org/hibernate/test/instrument/runtime/JavassistInstrumentationTest.java 2009-01-19 23:42:12 UTC (rev 15801)
@@ -1,52 +1,56 @@
-//$Id: $
-package org.hibernate.test.instrument.runtime;
-
-import org.hibernate.bytecode.BytecodeProvider;
-import org.hibernate.bytecode.javassist.BytecodeProviderImpl;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * @author Steve Ebersole
- */
-public class JavassistInstrumentationTest extends AbstractTransformingClassLoaderInstrumentTestCase {
- public JavassistInstrumentationTest(String string) {
- super( string );
- }
-
- protected BytecodeProvider buildBytecodeProvider() {
- return new BytecodeProviderImpl();
- }
-
- public static Test suite() {
- return new TestSuite( JavassistInstrumentationTest.class );
- }
-
- public void testSetFieldInterceptor() {
- super.testSetFieldInterceptor();
- }
-
- public void testDirtyCheck() {
- super.testDirtyCheck();
- }
-
- public void testFetchAll() throws Exception {
- super.testFetchAll();
- }
-
- public void testLazy() {
- super.testLazy();
- }
-
- public void testLazyManyToOne() {
- super.testLazyManyToOne();
- }
-
- public void testPropertyInitialized() {
- super.testPropertyInitialized();
- }
-
- public void testManyToOneProxy() {
- super.testManyToOneProxy();
- }
-}
+//$Id: $
+package org.hibernate.test.instrument.runtime;
+
+import org.hibernate.bytecode.BytecodeProvider;
+import org.hibernate.bytecode.javassist.BytecodeProviderImpl;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * @author Steve Ebersole
+ */
+public class JavassistInstrumentationTest extends AbstractTransformingClassLoaderInstrumentTestCase {
+ public JavassistInstrumentationTest(String string) {
+ super( string );
+ }
+
+ protected BytecodeProvider buildBytecodeProvider() {
+ return new BytecodeProviderImpl();
+ }
+
+ public static Test suite() {
+ return new TestSuite( JavassistInstrumentationTest.class );
+ }
+
+ public void testSetFieldInterceptor() {
+ super.testSetFieldInterceptor();
+ }
+
+ public void testDirtyCheck() {
+ super.testDirtyCheck();
+ }
+
+ public void testFetchAll() throws Exception {
+ super.testFetchAll();
+ }
+
+ public void testLazy() {
+ super.testLazy();
+ }
+
+ public void testLazyManyToOne() {
+ super.testLazyManyToOne();
+ }
+
+ public void testPropertyInitialized() {
+ super.testPropertyInitialized();
+ }
+
+ public void testManyToOneProxy() {
+ super.testManyToOneProxy();
+ }
+
+ public void testSharedPKOneToOne() {
+ super.testSharedPKOneToOne();
+ }
+}
More information about the hibernate-commits
mailing list