Hibernate SVN: r10426 - trunk/Hibernate3/test/org/hibernate/test/jpa/lock
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2006-09-01 17:38:49 -0400 (Fri, 01 Sep 2006)
New Revision: 10426
Modified:
trunk/Hibernate3/test/org/hibernate/test/jpa/lock/RepeatableReadTest.java
Log:
fixed failures on SQLServer
Modified: trunk/Hibernate3/test/org/hibernate/test/jpa/lock/RepeatableReadTest.java
===================================================================
--- trunk/Hibernate3/test/org/hibernate/test/jpa/lock/RepeatableReadTest.java 2006-09-01 21:36:47 UTC (rev 10425)
+++ trunk/Hibernate3/test/org/hibernate/test/jpa/lock/RepeatableReadTest.java 2006-09-01 21:38:49 UTC (rev 10426)
@@ -189,7 +189,8 @@
// clean up
s1 = getSessions().openSession();
t1 = s1.beginTransaction();
- s1.delete( part );
+ s1.delete( part2 );
+ s1.delete( part2.getItem() );
t1.commit();
s1.close();
}
@@ -231,14 +232,26 @@
assertEquals( "encountered non-repeatable read", check, part2.getName() );
// then acquire an UPGRADE lock; this should fail
- s1.lock( part, LockMode.UPGRADE );
+ try {
+ s1.lock( part, LockMode.UPGRADE );
+ }
+ catch( Throwable t ) {
+ // SQLServer, for example, immediately throws an exception here...
+ t1.rollback();
+ t1 = s1.beginTransaction();
+ }
part2 = ( Part ) s1.get( Part.class, partId );
assertTrue( part == part2 );
assertEquals( "encountered non-repeatable read", check, part2.getName() );
+ t1.commit();
+ s1.close();
+
// clean up
-// s1.refresh( item );
+ s1 = getSessions().openSession();
+ t1 = s1.beginTransaction();
s1.delete( part );
+ s1.delete( part.getItem() );
t1.commit();
s1.close();
}
18 years, 4 months
Hibernate SVN: r10425 - trunk/Hibernate3/test/org/hibernate/test
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2006-09-01 17:36:47 -0400 (Fri, 01 Sep 2006)
New Revision: 10425
Modified:
trunk/Hibernate3/test/org/hibernate/test/TestCase.java
Log:
assertAllDataRemoved in JPA tests
Modified: trunk/Hibernate3/test/org/hibernate/test/TestCase.java
===================================================================
--- trunk/Hibernate3/test/org/hibernate/test/TestCase.java 2006-09-01 21:36:13 UTC (rev 10424)
+++ trunk/Hibernate3/test/org/hibernate/test/TestCase.java 2006-09-01 21:36:47 UTC (rev 10425)
@@ -323,7 +323,7 @@
Session tmpSession = sessions.openSession();
try {
- List list = tmpSession.createQuery( "from java.lang.Object" ).list();
+ List list = tmpSession.createQuery( "select o from java.lang.Object o" ).list();
Map items = new HashMap();
if ( !list.isEmpty() ) {
18 years, 4 months
Hibernate SVN: r10424 - branches/Branch_3_2/Hibernate3/test/org/hibernate/test
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2006-09-01 17:36:13 -0400 (Fri, 01 Sep 2006)
New Revision: 10424
Modified:
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/TestCase.java
Log:
assertAllDataRemoved() in JPA tests
Modified: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/TestCase.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/TestCase.java 2006-09-01 20:57:42 UTC (rev 10423)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/TestCase.java 2006-09-01 21:36:13 UTC (rev 10424)
@@ -9,8 +9,6 @@
import java.util.Map;
import junit.framework.AssertionFailedError;
-import junit.framework.TestResult;
-import junit.framework.TestListener;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -329,7 +327,7 @@
Session tmpSession = sessions.openSession();
try {
- List list = tmpSession.createQuery( "from java.lang.Object" ).list();
+ List list = tmpSession.createQuery( "select o from java.lang.Object o" ).list();
Map items = new HashMap();
if ( !list.isEmpty() ) {
18 years, 4 months
Hibernate SVN: r10423 - in trunk/Hibernate3/test/org/hibernate/test: . hql joinedsubclass ondelete unionsubclass2
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2006-09-01 16:57:42 -0400 (Fri, 01 Sep 2006)
New Revision: 10423
Modified:
trunk/Hibernate3/test/org/hibernate/test/TestCase.java
trunk/Hibernate3/test/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java
trunk/Hibernate3/test/org/hibernate/test/joinedsubclass/JoinedSubclassTest.java
trunk/Hibernate3/test/org/hibernate/test/ondelete/OnDeleteTest.java
trunk/Hibernate3/test/org/hibernate/test/unionsubclass2/UnionSubclassTest.java
Log:
fixed failures on SQLServer
Modified: trunk/Hibernate3/test/org/hibernate/test/TestCase.java
===================================================================
--- trunk/Hibernate3/test/org/hibernate/test/TestCase.java 2006-09-01 20:56:40 UTC (rev 10422)
+++ trunk/Hibernate3/test/org/hibernate/test/TestCase.java 2006-09-01 20:57:42 UTC (rev 10423)
@@ -512,6 +512,37 @@
return canDoIt;
}
+ protected boolean supportsRowValueConstructorSyntaxInInList() {
+ boolean supported = ! (
+ getDialect() instanceof HSQLDialect ||
+ getDialect() instanceof PostgreSQLDialect ||
+ getDialect() instanceof MySQLDialect ||
+ getDialect() instanceof DB2Dialect ||
+ getDialect() instanceof SybaseDialect
+ );
+
+ if ( !supported ) {
+ reportSkip( "Dialect does not support 'tuple' syntax as part of an IN value list", "query support" );
+ }
+ return supported;
+ }
+
+ protected boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor() {
+ if ( getDialect() instanceof SQLServerDialect ) {
+ reportSkip( "Driver does not support 'position query' methods on forward-only cursors", "query support" );
+ return false;
+ }
+ return true;
+ }
+
+ protected boolean supportsCircularCascadeDelete() {
+ if ( getDialect() instanceof SQLServerDialect ) {
+ reportSkip( "db/dialect does not support 'circular' cascade delete constraints", "cascade delete constraint support" );
+ return false;
+ }
+ return true;
+ }
+
private boolean dialectIsNot(Class[] dialectClasses) {
for (int i = 0; i < dialectClasses.length; i++) {
Class dialectClass = dialectClasses[i];
Modified: trunk/Hibernate3/test/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java
===================================================================
--- trunk/Hibernate3/test/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java 2006-09-01 20:56:40 UTC (rev 10422)
+++ trunk/Hibernate3/test/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java 2006-09-01 20:57:42 UTC (rev 10423)
@@ -47,6 +47,10 @@
}
public void testScrollingJoinFetchesForward() {
+ if ( ! supportsResultSetPositionQueryMethodsOnForwardOnlyCursor() ) {
+ return;
+ }
+
TestData data = new TestData();
data.prepare();
Modified: trunk/Hibernate3/test/org/hibernate/test/joinedsubclass/JoinedSubclassTest.java
===================================================================
--- trunk/Hibernate3/test/org/hibernate/test/joinedsubclass/JoinedSubclassTest.java 2006-09-01 20:56:40 UTC (rev 10422)
+++ trunk/Hibernate3/test/org/hibernate/test/joinedsubclass/JoinedSubclassTest.java 2006-09-01 20:57:42 UTC (rev 10423)
@@ -89,8 +89,8 @@
mark.setZip("30306");
assertEquals( s.createQuery("from Person p where p.address.zip = '30306'").list().size(), 1 );
-
- if ( !(getDialect() instanceof HSQLDialect) && !( getDialect() instanceof PostgreSQLDialect ) && !( getDialect() instanceof MySQLDialect ) && !( getDialect() instanceof DB2Dialect ) ) {
+
+ if ( ! supportsRowValueConstructorSyntaxInInList() ) {
s.createCriteria(Person.class).add(
Expression.in("address", new Address[] { mark.getAddress(), joe.getAddress() } )
).list();
Modified: trunk/Hibernate3/test/org/hibernate/test/ondelete/OnDeleteTest.java
===================================================================
--- trunk/Hibernate3/test/org/hibernate/test/ondelete/OnDeleteTest.java 2006-09-01 20:56:40 UTC (rev 10422)
+++ trunk/Hibernate3/test/org/hibernate/test/ondelete/OnDeleteTest.java 2006-09-01 20:57:42 UTC (rev 10423)
@@ -25,7 +25,10 @@
}
public void testJoinedSubclass() {
-
+ if ( ! supportsCircularCascadeDelete() ) {
+ return;
+ }
+
Statistics statistics = getSessions().getStatistics();
statistics.clear();
Modified: trunk/Hibernate3/test/org/hibernate/test/unionsubclass2/UnionSubclassTest.java
===================================================================
--- trunk/Hibernate3/test/org/hibernate/test/unionsubclass2/UnionSubclassTest.java 2006-09-01 20:56:40 UTC (rev 10422)
+++ trunk/Hibernate3/test/org/hibernate/test/unionsubclass2/UnionSubclassTest.java 2006-09-01 20:57:42 UTC (rev 10423)
@@ -88,8 +88,8 @@
mark.setZip("30306");
assertEquals( s.createQuery("from Person p where p.address.zip = '30306'").list().size(), 1 );
-
- if ( !(getDialect() instanceof HSQLDialect) && !( getDialect() instanceof PostgreSQLDialect ) && !( getDialect() instanceof MySQLDialect ) && !( getDialect() instanceof DB2Dialect ) ) {
+
+ if ( ! supportsRowValueConstructorSyntaxInInList() ) {
s.createCriteria(Person.class).add(
Expression.in("address", new Address[] { mark.getAddress(), joe.getAddress() } )
).list();
18 years, 4 months
Hibernate SVN: r10422 - in branches/Branch_3_2/Hibernate3: src/org/hibernate/collection test/org/hibernate/test test/org/hibernate/test/collection test/org/hibernate/test/collection/map test/org/hibernate/test/collection/set
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2006-09-01 16:56:40 -0400 (Fri, 01 Sep 2006)
New Revision: 10422
Added:
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/CollectionSuite.java
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/map/
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/map/Child.java
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/map/Mappings.hbm.xml
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/map/Parent.java
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/map/PersistentMapTest.java
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/set/
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/set/Child.java
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/set/Mappings.hbm.xml
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/set/Parent.java
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/set/PersistentSetTest.java
Modified:
branches/Branch_3_2/Hibernate3/src/org/hibernate/collection/PersistentMap.java
branches/Branch_3_2/Hibernate3/src/org/hibernate/collection/PersistentSet.java
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/AllTests.java
Log:
HHH-1668 (and friends) : PersistentSet and PersistentMap unecessary dirtying
Modified: branches/Branch_3_2/Hibernate3/src/org/hibernate/collection/PersistentMap.java
===================================================================
--- branches/Branch_3_2/Hibernate3/src/org/hibernate/collection/PersistentMap.java 2006-09-01 20:52:35 UTC (rev 10421)
+++ branches/Branch_3_2/Hibernate3/src/org/hibernate/collection/PersistentMap.java 2006-09-01 20:56:40 UTC (rev 10422)
@@ -31,6 +31,39 @@
protected Map map;
+ /**
+ * Empty constructor.
+ * <p/>
+ * Note: this form is not ever ever ever used by Hibernate; it is, however,
+ * needed for SOAP libraries and other such marshalling code.
+ */
+ public PersistentMap() {
+ // intentionally empty
+ }
+
+ /**
+ * Instantiates a lazy map (the underlying map is un-initialized).
+ *
+ * @param session The session to which this map will belong.
+ */
+ public PersistentMap(SessionImplementor session) {
+ super(session);
+ }
+
+ /**
+ * Instantiates a non-lazy map (the underlying map is constructed
+ * from the incoming map reference).
+ *
+ * @param session The session to which this map will belong.
+ * @param map The underlying map data.
+ */
+ public PersistentMap(SessionImplementor session, Map map) {
+ super(session);
+ this.map = map;
+ setInitialized();
+ setDirectlyAccessible(true);
+ }
+
public Serializable getSnapshot(CollectionPersister persister) throws HibernateException {
EntityMode entityMode = getSession().getEntityMode();
HashMap clonedMap = new HashMap( map.size() );
@@ -68,23 +101,11 @@
public boolean isWrapper(Object collection) {
return map==collection;
}
-
- public PersistentMap(SessionImplementor session) {
- super(session);
- }
- public PersistentMap() {} //needed for SOAP libraries, etc
-
public void beforeInitialize(CollectionPersister persister, int anticipatedSize) {
this.map = ( Map ) persister.getCollectionType().instantiate( anticipatedSize );
}
- public PersistentMap(SessionImplementor session, Map map) {
- super(session);
- this.map = map;
- setInitialized();
- setDirectlyAccessible(true);
- }
/**
* @see java.util.Map#size()
@@ -130,14 +151,21 @@
* @see java.util.Map#put(Object, Object)
*/
public Object put(Object key, Object value) {
- Object old = isPutQueueEnabled() ?
- readElementByIndex(key) : UNKNOWN;
- if ( old==UNKNOWN ) {
- write();
- return map.put(key, value);
+ if ( isPutQueueEnabled() ) {
+ Object old = readElementByIndex( key );
+ queueOperation( new Put( key, value, old ) );
+ return old;
}
else {
- queueOperation( new Put(key, value, old) );
+ initialize( true );
+ Object old = map.put( key, value );
+ // would be better to use the element-type to determine
+ // whether the old and the new are equal here; the problem being
+ // we do not necessarily have access to the element type in all
+ // cases
+ if ( value != old ) {
+ dirty();
+ }
return old;
}
}
@@ -146,15 +174,18 @@
* @see java.util.Map#remove(Object)
*/
public Object remove(Object key) {
- Object old = isPutQueueEnabled() ?
- readElementByIndex(key) : UNKNOWN;
- if ( old==UNKNOWN ) {
- write();
- return map.remove(key);
+ if ( isPutQueueEnabled() ) {
+ Object old = readElementByIndex( key );
+ queueOperation( new Remove( key, old ) );
+ return old;
}
else {
- queueOperation( new Remove(key, old) );
- return old;
+ // TODO : safe to interpret "map.remove(key) == null" as non-dirty?
+ initialize( true );
+ if ( map.containsKey( key ) ) {
+ dirty();
+ }
+ return map.remove( key );
}
}
@@ -163,8 +194,12 @@
*/
public void putAll(Map puts) {
if ( puts.size()>0 ) {
- write();
- map.putAll(puts);
+ initialize( true );
+ Iterator itr = puts.entrySet().iterator();
+ while ( itr.hasNext() ) {
+ Map.Entry entry = ( Entry ) itr.next();
+ put( entry.getKey(), entry.getValue() );
+ }
}
}
@@ -176,8 +211,11 @@
queueOperation( new Clear() );
}
else {
- write();
- map.clear();
+ initialize( true );
+ if ( ! map.isEmpty() ) {
+ dirty();
+ map.clear();
+ }
}
}
Modified: branches/Branch_3_2/Hibernate3/src/org/hibernate/collection/PersistentSet.java
===================================================================
--- branches/Branch_3_2/Hibernate3/src/org/hibernate/collection/PersistentSet.java 2006-09-01 20:52:35 UTC (rev 10421)
+++ branches/Branch_3_2/Hibernate3/src/org/hibernate/collection/PersistentSet.java 2006-09-01 20:56:40 UTC (rev 10422)
@@ -31,6 +31,45 @@
protected Set set;
protected transient List tempList;
+ /**
+ * Empty constructor.
+ * <p/>
+ * Note: this form is not ever ever ever used by Hibernate; it is, however,
+ * needed for SOAP libraries and other such marshalling code.
+ */
+ public PersistentSet() {
+ // intentionally empty
+ }
+
+ /**
+ * Constructor matching super. Instantiates a lazy set (the underlying
+ * set is un-initialized).
+ *
+ * @param session The session to which this set will belong.
+ */
+ public PersistentSet(SessionImplementor session) {
+ super( session );
+ }
+
+ /**
+ * Instantiates a non-lazy set (the underlying set is constructed
+ * from the incoming set reference).
+ *
+ * @param session The session to which this set will belong.
+ * @param set The underlying set data.
+ */
+ public PersistentSet(SessionImplementor session, java.util.Set set) {
+ super(session);
+ // Sets can be just a view of a part of another collection.
+ // do we need to copy it to be sure it won't be changing
+ // underneath us?
+ // ie. this.set.addAll(set);
+ this.set = set;
+ setInitialized();
+ setDirectlyAccessible(true);
+ }
+
+
public Serializable getSnapshot(CollectionPersister persister)
throws HibernateException {
EntityMode entityMode = getSession().getEntityMode();
@@ -71,27 +110,10 @@
public boolean isSnapshotEmpty(Serializable snapshot) {
return ( (java.util.Map) snapshot ).isEmpty();
}
-
- public PersistentSet(SessionImplementor session) {
- super(session);
- }
- public PersistentSet() {} //needed for SOAP libraries, etc
-
public void beforeInitialize(CollectionPersister persister, int anticipatedSize) {
this.set = ( Set ) persister.getCollectionType().instantiate( anticipatedSize );
}
-
- public PersistentSet(SessionImplementor session, java.util.Set set) {
- super(session);
- // Sets can be just a view of a part of another collection.
- // do we need to copy it to be sure it won't be changing
- // underneath us?
- // ie. this.set.addAll(set);
- this.set = set;
- setInitialized();
- setDirectlyAccessible(true);
- }
public void initializeFromCache(CollectionPersister persister, Serializable disassembled, Object owner)
throws HibernateException {
@@ -162,11 +184,16 @@
* @see java.util.Set#add(Object)
*/
public boolean add(Object value) {
- Boolean exists = isOperationQueueEnabled() ?
- readElementExistence(value) : null;
- if (exists==null) {
- write();
- return set.add(value);
+ Boolean exists = isOperationQueueEnabled() ? readElementExistence( value ) : null;
+ if ( exists == null ) {
+ initialize( true );
+ if ( set.add( value ) ) {
+ dirty();
+ return true;
+ }
+ else {
+ return false;
+ }
}
else if ( exists.booleanValue() ) {
return false;
@@ -181,11 +208,16 @@
* @see java.util.Set#remove(Object)
*/
public boolean remove(Object value) {
- Boolean exists = isPutQueueEnabled() ?
- readElementExistence(value) : null;
+ Boolean exists = isPutQueueEnabled() ? readElementExistence( value ) : null;
if ( exists==null ) {
- write();
- return set.remove(value);
+ initialize( true );
+ if ( set.remove( value ) ) {
+ dirty();
+ return true;
+ }
+ else {
+ return false;
+ }
}
else if ( exists.booleanValue() ) {
queueOperation( new SimpleRemove(value) );
@@ -208,9 +240,15 @@
* @see java.util.Set#addAll(Collection)
*/
public boolean addAll(Collection coll) {
- if ( coll.size()> 0 ) {
- write();
- return set.addAll(coll);
+ if ( coll.size() > 0 ) {
+ initialize( true );
+ if ( set.addAll( coll ) ) {
+ dirty();
+ return true;
+ }
+ else {
+ return false;
+ }
}
else {
return false;
@@ -221,17 +259,29 @@
* @see java.util.Set#retainAll(Collection)
*/
public boolean retainAll(Collection coll) {
- write();
- return set.retainAll(coll);
+ initialize( true );
+ if ( set.addAll( coll ) ) {
+ dirty();
+ return true;
+ }
+ else {
+ return false;
+ }
}
/**
* @see java.util.Set#removeAll(Collection)
*/
public boolean removeAll(Collection coll) {
- if ( coll.size()>0 ) {
- write();
- return set.removeAll(coll);
+ if ( coll.size() > 0 ) {
+ initialize( true );
+ if ( set.removeAll( coll ) ) {
+ dirty();
+ return true;
+ }
+ else {
+ return false;
+ }
}
else {
return false;
@@ -246,8 +296,11 @@
queueOperation( new Clear() );
}
else {
- write();
- set.clear();
+ initialize( true );
+ if ( !set.isEmpty() ) {
+ set.clear();
+ dirty();
+ }
}
}
Modified: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/AllTests.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/AllTests.java 2006-09-01 20:52:35 UTC (rev 10421)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/AllTests.java 2006-09-01 20:56:40 UTC (rev 10422)
@@ -17,7 +17,7 @@
import org.hibernate.test.cache.CacheSuite;
import org.hibernate.test.cascade.RefreshTest;
import org.hibernate.test.cid.CompositeIdTest;
-import org.hibernate.test.collection.CollectionTest;
+import org.hibernate.test.collection.CollectionSuite;
import org.hibernate.test.component.ComponentTest;
import org.hibernate.test.compositeelement.CompositeElementTest;
import org.hibernate.test.comppropertyref.ComponentPropertyRefTest;
@@ -187,7 +187,7 @@
suite.addTest( IdClassTest.suite() );
suite.addTest( ArrayTest.suite() );
suite.addTest( TernaryTest.suite() );
- suite.addTest( CollectionTest.suite() );
+ suite.addTest( CollectionSuite.suite() );
suite.addTest( IdBagTest.suite() );
suite.addTest( MapCompositeElementTest.suite() );
suite.addTest( MapIndexFormulaTest.suite() );
Added: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/CollectionSuite.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/CollectionSuite.java 2006-09-01 20:52:35 UTC (rev 10421)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/CollectionSuite.java 2006-09-01 20:56:40 UTC (rev 10422)
@@ -0,0 +1,23 @@
+package org.hibernate.test.collection;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.hibernate.test.collection.map.PersistentMapTest;
+import org.hibernate.test.collection.set.PersistentSetTest;
+
+/**
+ * todo: describe CollectionSuite
+ *
+ * @author Steve Ebersole
+ */
+public class CollectionSuite {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite( "Collection-related tests" );
+ suite.addTest( CollectionTest.suite() );
+ suite.addTest( PersistentMapTest.suite() );
+ suite.addTest( PersistentSetTest.suite() );
+ return suite;
+ }
+
+}
Added: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/map/Child.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/map/Child.java 2006-09-01 20:52:35 UTC (rev 10421)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/map/Child.java 2006-09-01 20:56:40 UTC (rev 10422)
@@ -0,0 +1,34 @@
+package org.hibernate.test.collection.map;
+
+/**
+ * todo: describe Child
+ *
+ * @author Steve Ebersole
+ */
+public class Child {
+ private String name;
+ private Parent parent;
+
+ public Child() {
+ }
+
+ public Child(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Parent getParent() {
+ return parent;
+ }
+
+ public void setParent(Parent parent) {
+ this.parent = parent;
+ }
+}
Added: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/map/Mappings.hbm.xml
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/map/Mappings.hbm.xml 2006-09-01 20:52:35 UTC (rev 10421)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/map/Mappings.hbm.xml 2006-09-01 20:56:40 UTC (rev 10422)
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+
+<hibernate-mapping package="org.hibernate.test.collection.map">
+
+ <class name="Parent">
+ <id name="name" column="NAME" type="string" />
+
+ <map name="children" inverse="true" cascade="all">
+ <key column="PARENT" />
+ <map-key type="string" />
+ <one-to-many class="Child" />
+ </map>
+ </class>
+
+ <class name="Child">
+ <id name="name" column="NAME" type="string"/>
+ <many-to-one name="parent" class="Parent" cascade="none" />
+ </class>
+
+</hibernate-mapping>
Added: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/map/Parent.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/map/Parent.java 2006-09-01 20:52:35 UTC (rev 10421)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/map/Parent.java 2006-09-01 20:56:40 UTC (rev 10422)
@@ -0,0 +1,37 @@
+package org.hibernate.test.collection.map;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * todo: describe Parent
+ *
+ * @author Steve Ebersole
+ */
+public class Parent {
+ private String name;
+ private Map children = new HashMap();
+
+ public Parent() {
+ }
+
+ public Parent(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Map getChildren() {
+ return children;
+ }
+
+ public void setChildren(Map children) {
+ this.children = children;
+ }
+}
Added: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/map/PersistentMapTest.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/map/PersistentMapTest.java 2006-09-01 20:52:35 UTC (rev 10421)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/map/PersistentMapTest.java 2006-09-01 20:56:40 UTC (rev 10422)
@@ -0,0 +1,75 @@
+package org.hibernate.test.collection.map;
+
+import org.hibernate.test.TestCase;
+import org.hibernate.Session;
+import org.hibernate.collection.PersistentMap;
+
+import java.util.HashMap;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * todo: describe PersistentMapTest
+ *
+ * @author Steve Ebersole
+ */
+public class PersistentMapTest extends TestCase {
+ public PersistentMapTest(String name) {
+ super( name );
+ }
+
+ protected String[] getMappings() {
+ return new String[] { "collection/map/Mappings.hbm.xml" };
+ }
+
+ public static Test suite() {
+ return new TestSuite( PersistentMapTest.class );
+ }
+
+ public void testWriteMethodDirtying() {
+ Parent parent = new Parent( "p1" );
+ Child child = new Child( "c1" );
+ parent.getChildren().put( child.getName(), child );
+ child.setParent( parent );
+ Child otherChild = new Child( "c2" );
+
+ Session session = openSession();
+ session.beginTransaction();
+ session.save( parent );
+ session.flush();
+ // at this point, the set on parent has now been replaced with a PersistentSet...
+ PersistentMap children = ( PersistentMap ) parent.getChildren();
+
+ Object old = children.put( child.getName(), child );
+ assertTrue( old == child );
+ assertFalse( children.isDirty() );
+
+ old = children.remove( otherChild.getName() );
+ assertNull( old );
+ assertFalse( children.isDirty() );
+
+ HashMap otherMap = new HashMap();
+ otherMap.put( child.getName(), child );
+ children.putAll( otherMap );
+ assertFalse( children.isDirty() );
+
+ otherMap = new HashMap();
+ otherMap.put( otherChild.getName(), otherChild );
+ children.putAll( otherMap );
+ assertTrue( children.isDirty() );
+
+ children.clearDirty();
+ session.delete( child );
+ children.clear();
+ assertTrue( children.isDirty() );
+ session.flush();
+
+ children.clear();
+ assertFalse( children.isDirty() );
+
+ session.delete( parent );
+ session.getTransaction().commit();
+ session.close();
+ }
+}
Added: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/set/Child.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/set/Child.java 2006-09-01 20:52:35 UTC (rev 10421)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/set/Child.java 2006-09-01 20:56:40 UTC (rev 10422)
@@ -0,0 +1,34 @@
+package org.hibernate.test.collection.set;
+
+/**
+ * todo: describe Child
+ *
+ * @author Steve Ebersole
+ */
+public class Child {
+ private String name;
+ private Parent parent;
+
+ public Child() {
+ }
+
+ public Child(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Parent getParent() {
+ return parent;
+ }
+
+ public void setParent(Parent parent) {
+ this.parent = parent;
+ }
+}
Added: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/set/Mappings.hbm.xml
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/set/Mappings.hbm.xml 2006-09-01 20:52:35 UTC (rev 10421)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/set/Mappings.hbm.xml 2006-09-01 20:56:40 UTC (rev 10422)
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+
+<hibernate-mapping package="org.hibernate.test.collection.set">
+
+ <class name="Parent">
+ <id name="name" column="NAME" type="string" />
+
+ <set name="children" inverse="true" cascade="all">
+ <key column="PARENT" />
+ <one-to-many class="Child" />
+ </set>
+ </class>
+
+ <class name="Child">
+ <id name="name" column="NAME" type="string"/>
+ <many-to-one name="parent" class="Parent" cascade="none" />
+ </class>
+
+</hibernate-mapping>
Added: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/set/Parent.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/set/Parent.java 2006-09-01 20:52:35 UTC (rev 10421)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/set/Parent.java 2006-09-01 20:56:40 UTC (rev 10422)
@@ -0,0 +1,37 @@
+package org.hibernate.test.collection.set;
+
+import java.util.Set;
+import java.util.HashSet;
+
+/**
+ * todo: describe Parent
+ *
+ * @author Steve Ebersole
+ */
+public class Parent {
+ private String name;
+ private Set children = new HashSet();
+
+ public Parent() {
+ }
+
+ public Parent(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Set getChildren() {
+ return children;
+ }
+
+ public void setChildren(Set children) {
+ this.children = children;
+ }
+}
Added: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/set/PersistentSetTest.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/set/PersistentSetTest.java 2006-09-01 20:52:35 UTC (rev 10421)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/collection/set/PersistentSetTest.java 2006-09-01 20:56:40 UTC (rev 10422)
@@ -0,0 +1,76 @@
+package org.hibernate.test.collection.set;
+
+import org.hibernate.test.TestCase;
+import org.hibernate.Session;
+import org.hibernate.collection.PersistentSet;
+
+import java.util.HashSet;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * todo: describe PersistentSetTest
+ *
+ * @author Steve Ebersole
+ */
+public class PersistentSetTest extends TestCase {
+ public PersistentSetTest(String name) {
+ super( name );
+ }
+
+ protected String[] getMappings() {
+ return new String[] { "collection/set/Mappings.hbm.xml" };
+ }
+
+ public static Test suite() {
+ return new TestSuite( PersistentSetTest.class );
+ }
+
+ public void testWriteMethodDirtying() {
+ Parent parent = new Parent( "p1" );
+ Child child = new Child( "c1" );
+ parent.getChildren().add( child );
+ child.setParent( parent );
+ Child otherChild = new Child( "c2" );
+
+ Session session = openSession();
+ session.beginTransaction();
+ session.save( parent );
+ session.flush();
+ // at this point, the set on parent has now been replaced with a PersistentSet...
+ PersistentSet children = ( PersistentSet ) parent.getChildren();
+
+ assertFalse( children.add( child ) );
+ assertFalse( children.isDirty() );
+
+ assertFalse( children.remove( otherChild ) );
+ assertFalse( children.isDirty() );
+
+ HashSet otherSet = new HashSet();
+ otherSet.add( child );
+ assertFalse( children.addAll( otherSet ) );
+ assertFalse( children.isDirty() );
+
+ assertFalse( children.retainAll( otherSet ) );
+ assertFalse( children.isDirty() );
+
+ otherSet = new HashSet();
+ otherSet.add( otherChild );
+ assertFalse( children.removeAll( otherSet ) );
+ assertFalse( children.isDirty() );
+
+ children.clear();
+ session.delete( child );
+ assertTrue( children.isDirty() );
+
+ session.flush();
+
+ children.clear();
+ assertFalse( children.isDirty() );
+
+ session.delete( parent );
+ session.getTransaction().commit();
+ session.close();
+ }
+}
18 years, 4 months
Hibernate SVN: r10421 - in branches/Branch_3_2/Hibernate3/test/org/hibernate/test: . cid hql joinedsubclass legacy ondelete tm typeparameters unionsubclass2
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2006-09-01 16:52:35 -0400 (Fri, 01 Sep 2006)
New Revision: 10421
Modified:
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/TestCase.java
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/cid/Product.hbm.xml
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/joinedsubclass/JoinedSubclassTest.java
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/legacy/QueryByExampleTest.java
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/ondelete/OnDeleteTest.java
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/tm/CMTTest.java
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/typeparameters/TypeParameterTest.java
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/unionsubclass2/UnionSubclassTest.java
Log:
fixed failures on SQLServer
Modified: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/TestCase.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/TestCase.java 2006-09-01 20:50:08 UTC (rev 10420)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/TestCase.java 2006-09-01 20:52:35 UTC (rev 10421)
@@ -518,6 +518,37 @@
return canDoIt;
}
+ protected boolean supportsRowValueConstructorSyntaxInInList() {
+ boolean supported = ! (
+ getDialect() instanceof HSQLDialect ||
+ getDialect() instanceof PostgreSQLDialect ||
+ getDialect() instanceof MySQLDialect ||
+ getDialect() instanceof DB2Dialect ||
+ getDialect() instanceof SybaseDialect
+ );
+
+ if ( !supported ) {
+ reportSkip( "Dialect does not support 'tuple' syntax as part of an IN value list", "query support" );
+ }
+ return supported;
+ }
+
+ protected boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor() {
+ if ( getDialect() instanceof SQLServerDialect ) {
+ reportSkip( "Driver does not support 'position query' methods on forward-only cursors", "query support" );
+ return false;
+ }
+ return true;
+ }
+
+ protected boolean supportsCircularCascadeDelete() {
+ if ( getDialect() instanceof SQLServerDialect ) {
+ reportSkip( "db/dialect does not support 'circular' cascade delete constraints", "cascade delete constraint support" );
+ return false;
+ }
+ return true;
+ }
+
private boolean dialectIsNot(Class[] dialectClasses) {
for (int i = 0; i < dialectClasses.length; i++) {
Class dialectClass = dialectClasses[i];
Modified: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/cid/Product.hbm.xml
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/cid/Product.hbm.xml 2006-09-01 20:50:08 UTC (rev 10420)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/cid/Product.hbm.xml 2006-09-01 20:52:35 UTC (rev 10421)
@@ -30,7 +30,7 @@
<property name="description"
not-null="true"
length="200"/>
- <property name="price" length="3"/>
+ <property name="price" length="3" column="cost"/>
<property name="numberAvailable"/>
<property name="numberOrdered"
Modified: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java 2006-09-01 20:50:08 UTC (rev 10420)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java 2006-09-01 20:52:35 UTC (rev 10421)
@@ -47,6 +47,10 @@
}
public void testScrollingJoinFetchesForward() {
+ if ( ! supportsResultSetPositionQueryMethodsOnForwardOnlyCursor() ) {
+ return;
+ }
+
TestData data = new TestData();
data.prepare();
Modified: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/joinedsubclass/JoinedSubclassTest.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/joinedsubclass/JoinedSubclassTest.java 2006-09-01 20:50:08 UTC (rev 10420)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/joinedsubclass/JoinedSubclassTest.java 2006-09-01 20:52:35 UTC (rev 10421)
@@ -89,8 +89,8 @@
mark.setZip("30306");
assertEquals( s.createQuery("from Person p where p.address.zip = '30306'").list().size(), 1 );
-
- if ( !(getDialect() instanceof HSQLDialect) && !( getDialect() instanceof PostgreSQLDialect ) && !( getDialect() instanceof MySQLDialect ) && !( getDialect() instanceof DB2Dialect ) ) {
+
+ if ( supportsRowValueConstructorSyntaxInInList() ) {
s.createCriteria(Person.class).add(
Expression.in("address", new Address[] { mark.getAddress(), joe.getAddress() } )
).list();
Modified: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/legacy/QueryByExampleTest.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/legacy/QueryByExampleTest.java 2006-09-01 20:50:08 UTC (rev 10420)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/legacy/QueryByExampleTest.java 2006-09-01 20:52:35 UTC (rev 10421)
@@ -26,14 +26,6 @@
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
- public void tearDown() throws Exception {
- super.tearDown();
- }
-
/**
* @see org.hibernate.test.TestCase#getMappings()
*/
Modified: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/ondelete/OnDeleteTest.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/ondelete/OnDeleteTest.java 2006-09-01 20:50:08 UTC (rev 10420)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/ondelete/OnDeleteTest.java 2006-09-01 20:52:35 UTC (rev 10421)
@@ -25,7 +25,10 @@
}
public void testJoinedSubclass() {
-
+ if ( ! supportsCircularCascadeDelete() ) {
+ return;
+ }
+
Statistics statistics = getSessions().getStatistics();
statistics.clear();
@@ -71,7 +74,6 @@
List names = s.createQuery("select name from Person").list();
assertTrue( names.isEmpty() );
t.commit();
-
s.close();
}
Modified: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/tm/CMTTest.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/tm/CMTTest.java 2006-09-01 20:50:08 UTC (rev 10420)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/tm/CMTTest.java 2006-09-01 20:52:35 UTC (rev 10421)
@@ -185,10 +185,11 @@
}
public void testConcurrentCachedDirtyQueries() throws Exception {
- if ( reportSkip( "dead-lock bug", "concurrent queries", getDialect() instanceof SybaseDialect ) ) {
- // sybase and sqlserver have serious locking issues here...
+ if ( getDialect() instanceof SybaseDialect ) {
+ reportSkip( "dead-lock bug", "concurrent queries" );
return;
}
+
DummyTransactionManager.INSTANCE.begin();
Session s = openSession();
Map foo = new HashMap();
Modified: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/typeparameters/TypeParameterTest.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/typeparameters/TypeParameterTest.java 2006-09-01 20:50:08 UTC (rev 10420)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/typeparameters/TypeParameterTest.java 2006-09-01 20:52:35 UTC (rev 10421)
@@ -24,14 +24,6 @@
super(name);
}
- public void setUp() throws Exception {
- super.setUp();
- }
-
- public void tearDown() throws Exception {
- super.tearDown();
- }
-
/**
* @see org.hibernate.test.TestCase#getMappings()
*/
Modified: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/unionsubclass2/UnionSubclassTest.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/unionsubclass2/UnionSubclassTest.java 2006-09-01 20:50:08 UTC (rev 10420)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/unionsubclass2/UnionSubclassTest.java 2006-09-01 20:52:35 UTC (rev 10421)
@@ -89,7 +89,7 @@
mark.setZip("30306");
assertEquals( s.createQuery("from Person p where p.address.zip = '30306'").list().size(), 1 );
- if ( !(getDialect() instanceof HSQLDialect) && !( getDialect() instanceof PostgreSQLDialect ) && !( getDialect() instanceof MySQLDialect ) && !( getDialect() instanceof DB2Dialect ) ) {
+ if ( supportsRowValueConstructorSyntaxInInList() ) {
s.createCriteria(Person.class).add(
Expression.in("address", new Address[] { mark.getAddress(), joe.getAddress() } )
).list();
18 years, 4 months
Hibernate SVN: r10420 - branches/Branch_3_2/Hibernate3/test/org/hibernate/test/cid
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2006-09-01 16:50:08 -0400 (Fri, 01 Sep 2006)
New Revision: 10420
Modified:
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/cid/Order.hbm.xml
Log:
fixed failures on SQLServer
Modified: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/cid/Order.hbm.xml
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/cid/Order.hbm.xml 2006-09-01 20:49:54 UTC (rev 10419)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/cid/Order.hbm.xml 2006-09-01 20:50:08 UTC (rev 10420)
@@ -41,7 +41,7 @@
not-null="true"/>
<property name="total"
- formula="( select sum(li.quantity*p.price) from LineItem li, Product p where li.productId = p.productId and li.customerId = customerId and li.orderNumber = orderNumber )"/>
+ formula="( select sum(li.quantity*p.cost) from LineItem li, Product p where li.productId = p.productId and li.customerId = customerId and li.orderNumber = orderNumber )"/>
<many-to-one name="customer"
column="customerId"
18 years, 4 months
Hibernate SVN: r10419 - trunk/Hibernate3/test/org/hibernate/test/cid
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2006-09-01 16:49:54 -0400 (Fri, 01 Sep 2006)
New Revision: 10419
Modified:
trunk/Hibernate3/test/org/hibernate/test/cid/Order.hbm.xml
trunk/Hibernate3/test/org/hibernate/test/cid/Product.hbm.xml
Log:
fixed failures on SQLServer
Modified: trunk/Hibernate3/test/org/hibernate/test/cid/Order.hbm.xml
===================================================================
--- trunk/Hibernate3/test/org/hibernate/test/cid/Order.hbm.xml 2006-09-01 20:37:33 UTC (rev 10418)
+++ trunk/Hibernate3/test/org/hibernate/test/cid/Order.hbm.xml 2006-09-01 20:49:54 UTC (rev 10419)
@@ -41,7 +41,7 @@
not-null="true"/>
<property name="total"
- formula="( select sum(li.quantity*p.price) from LineItem li, Product p where li.productId = p.productId and li.customerId = customerId and li.orderNumber = orderNumber )"/>
+ formula="( select sum(li.quantity*p.cost) from LineItem li, Product p where li.productId = p.productId and li.customerId = customerId and li.orderNumber = orderNumber )"/>
<many-to-one name="customer"
column="customerId"
Modified: trunk/Hibernate3/test/org/hibernate/test/cid/Product.hbm.xml
===================================================================
--- trunk/Hibernate3/test/org/hibernate/test/cid/Product.hbm.xml 2006-09-01 20:37:33 UTC (rev 10418)
+++ trunk/Hibernate3/test/org/hibernate/test/cid/Product.hbm.xml 2006-09-01 20:49:54 UTC (rev 10419)
@@ -30,7 +30,7 @@
<property name="description"
not-null="true"
length="200"/>
- <property name="price" length="3"/>
+ <property name="price" length="3" column="cost"/>
<property name="numberAvailable"/>
<property name="numberOrdered"
18 years, 4 months
Hibernate SVN: r10418 - branches/Branch_3_2/Hibernate3/test/org/hibernate/test/subclassfilter
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2006-09-01 16:37:33 -0400 (Fri, 01 Sep 2006)
New Revision: 10418
Modified:
branches/Branch_3_2/Hibernate3/test/org/hibernate/test/subclassfilter/DiscrimSubclassFilterTest.java
Log:
test data cleanup
Modified: branches/Branch_3_2/Hibernate3/test/org/hibernate/test/subclassfilter/DiscrimSubclassFilterTest.java
===================================================================
--- branches/Branch_3_2/Hibernate3/test/org/hibernate/test/subclassfilter/DiscrimSubclassFilterTest.java 2006-09-01 20:37:21 UTC (rev 10417)
+++ branches/Branch_3_2/Hibernate3/test/org/hibernate/test/subclassfilter/DiscrimSubclassFilterTest.java 2006-09-01 20:37:33 UTC (rev 10418)
@@ -76,6 +76,12 @@
t.commit();
s.close();
+
+ s = openSession();
+ t = s.beginTransaction();
+ s.createQuery( "delete Person" ).executeUpdate();
+ t.commit();
+ s.close();
}
private void prepareTestData(Session s) {
18 years, 4 months
Hibernate SVN: r10417 - trunk/Hibernate3/test/org/hibernate/test/subclassfilter
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2006-09-01 16:37:21 -0400 (Fri, 01 Sep 2006)
New Revision: 10417
Modified:
trunk/Hibernate3/test/org/hibernate/test/subclassfilter/DiscrimSubclassFilterTest.java
Log:
test data cleanup
Modified: trunk/Hibernate3/test/org/hibernate/test/subclassfilter/DiscrimSubclassFilterTest.java
===================================================================
--- trunk/Hibernate3/test/org/hibernate/test/subclassfilter/DiscrimSubclassFilterTest.java 2006-09-01 20:36:18 UTC (rev 10416)
+++ trunk/Hibernate3/test/org/hibernate/test/subclassfilter/DiscrimSubclassFilterTest.java 2006-09-01 20:37:21 UTC (rev 10417)
@@ -76,6 +76,12 @@
t.commit();
s.close();
+
+ s = openSession();
+ t = s.beginTransaction();
+ s.createQuery( "delete Person" ).executeUpdate();
+ t.commit();
+ s.close();
}
private void prepareTestData(Session s) {
18 years, 4 months