You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(22) |
Nov
(308) |
Dec
(131) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(369) |
Feb
(171) |
Mar
(236) |
Apr
(187) |
May
(218) |
Jun
(217) |
Jul
(127) |
Aug
(448) |
Sep
(270) |
Oct
(231) |
Nov
(422) |
Dec
(255) |
2004 |
Jan
(111) |
Feb
(73) |
Mar
(338) |
Apr
(351) |
May
(349) |
Jun
(495) |
Jul
(394) |
Aug
(1048) |
Sep
(499) |
Oct
(142) |
Nov
(269) |
Dec
(638) |
2005 |
Jan
(825) |
Feb
(1272) |
Mar
(593) |
Apr
(690) |
May
(950) |
Jun
(958) |
Jul
(767) |
Aug
(839) |
Sep
(525) |
Oct
(449) |
Nov
(585) |
Dec
(455) |
2006 |
Jan
(603) |
Feb
(656) |
Mar
(195) |
Apr
(114) |
May
(136) |
Jun
(100) |
Jul
(128) |
Aug
(68) |
Sep
(7) |
Oct
(1) |
Nov
(1) |
Dec
(8) |
2007 |
Jan
(4) |
Feb
(3) |
Mar
(8) |
Apr
(16) |
May
(5) |
Jun
(4) |
Jul
(6) |
Aug
(23) |
Sep
(15) |
Oct
(5) |
Nov
(7) |
Dec
(5) |
2008 |
Jan
(5) |
Feb
(1) |
Mar
(1) |
Apr
(5) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(2) |
2013 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <one...@us...> - 2003-05-18 15:45:18
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister In directory sc8-pr-cvs1:/tmp/cvs-serv10989/hibernate/persister Modified Files: EntityPersister.java NormalizedEntityPersister.java Log Message: * added Query.setLockMode() * tidied up implementation of Loader Index: EntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/EntityPersister.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** EntityPersister.java 8 May 2003 09:39:22 -0000 1.28 --- EntityPersister.java 18 May 2003 15:45:14 -0000 1.29 *************** *** 394,398 **** public void lock(Serializable id, Object version, Object object, LockMode lockMode, SessionImplementor session) throws HibernateException, SQLException { ! if ( lockMode.greaterThan(LockMode.NONE) ) { if ( log.isTraceEnabled() ) { --- 394,398 ---- public void lock(Serializable id, Object version, Object object, LockMode lockMode, SessionImplementor session) throws HibernateException, SQLException { ! if ( lockMode!=LockMode.NONE ) { if ( log.isTraceEnabled() ) { Index: NormalizedEntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/NormalizedEntityPersister.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** NormalizedEntityPersister.java 10 May 2003 09:59:12 -0000 1.22 --- NormalizedEntityPersister.java 18 May 2003 15:45:14 -0000 1.23 *************** *** 411,415 **** public void lock(Serializable id, Object version, Object object, LockMode lockMode, SessionImplementor session) throws HibernateException, SQLException { ! if ( lockMode.greaterThan(LockMode.NONE) ) { if ( log.isTraceEnabled() ) { --- 411,415 ---- public void lock(Serializable id, Object version, Object object, LockMode lockMode, SessionImplementor session) throws HibernateException, SQLException { ! if ( lockMode!=LockMode.NONE ) { if ( log.isTraceEnabled() ) { |
From: <one...@us...> - 2003-05-18 15:45:18
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader In directory sc8-pr-cvs1:/tmp/cvs-serv10989/hibernate/loader Modified Files: AbstractEntityLoader.java CollectionLoader.java CriteriaLoader.java EntityLoader.java Loader.java OneToManyLoader.java OuterJoinLoader.java SimpleEntityLoader.java Log Message: * added Query.setLockMode() * tidied up implementation of Loader Index: AbstractEntityLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/AbstractEntityLoader.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AbstractEntityLoader.java 25 Apr 2003 03:40:34 -0000 1.4 --- AbstractEntityLoader.java 18 May 2003 15:45:13 -0000 1.5 *************** *** 4,7 **** --- 4,8 ---- import java.util.List; + import net.sf.hibernate.LockMode; import net.sf.hibernate.MappingException; import net.sf.hibernate.engine.SessionFactoryImplementor; *************** *** 61,64 **** --- 62,66 ---- classPersisters = new Loadable[joins+1]; + lockModeArray = createLockModeArray(joins+1, LockMode.NONE); for ( int i=0; i<joins; i++ ) classPersisters[i] = ( (OuterJoinableAssociation) associations.get(i) ).subpersister; classPersisters[joins] = persister; Index: CollectionLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/CollectionLoader.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** CollectionLoader.java 25 Apr 2003 03:40:34 -0000 1.12 --- CollectionLoader.java 18 May 2003 15:45:13 -0000 1.13 *************** *** 7,10 **** --- 7,11 ---- import net.sf.hibernate.HibernateException; + import net.sf.hibernate.LockMode; import net.sf.hibernate.MappingException; import net.sf.hibernate.collection.CollectionPersister; *************** *** 66,69 **** --- 67,71 ---- classPersisters = new Loadable[joins]; + lockModeArray = createLockModeArray(joins, LockMode.NONE); for ( int i=0; i<joins; i++ ) classPersisters[i] = (Loadable) ( (OuterJoinableAssociation) associations.get(i) ).subpersister; this.collectionPersister = persister; Index: CriteriaLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/CriteriaLoader.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CriteriaLoader.java 25 Apr 2003 03:40:34 -0000 1.4 --- CriteriaLoader.java 18 May 2003 15:45:13 -0000 1.5 *************** *** 76,80 **** selection.setTimeout( criteria.getTimeout() ); ! return find(session, valueArray, typeArray, true, selection, null); } --- 76,80 ---- selection.setTimeout( criteria.getTimeout() ); ! return find(session, valueArray, typeArray, true, selection, null, null); } Index: EntityLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/EntityLoader.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** EntityLoader.java 14 May 2003 12:20:23 -0000 1.16 --- EntityLoader.java 18 May 2003 15:45:13 -0000 1.17 *************** *** 53,58 **** } } ! ! } --- 53,57 ---- } } ! } Index: Loader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/Loader.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Loader.java 7 May 2003 15:09:05 -0000 1.24 --- Loader.java 18 May 2003 15:45:13 -0000 1.25 *************** *** 7,11 **** import java.sql.SQLException; import java.util.ArrayList; - import java.util.Iterator; import java.util.List; import java.util.Map; --- 7,10 ---- *************** *** 13,16 **** --- 12,16 ---- import net.sf.hibernate.HibernateException; import net.sf.hibernate.LockMode; + import net.sf.hibernate.StaleObjectStateException; import net.sf.hibernate.WrongClassException; import net.sf.hibernate.cfg.Environment; *************** *** 63,76 **** /** * What lock mode does this load entities with? */ ! protected LockMode getLockMode() { ! return LockMode.READ; ! } /** ! * Are we allowed to do two-phase loading? ! * @deprecated we always do two-phase loading now */ ! protected boolean allowTwoPhaseLoad() { ! return true; } --- 63,81 ---- /** * What lock mode does this load entities with? + * @param lockModes a collection of lock modes specified dynamically via the Query interface */ ! protected abstract LockMode[] getLockModes(Map lockModes); /** ! * Append <tt>FOR UPDATE OF</tt> clause, if necessary */ ! protected String applyLocks(String sql, Map lockModes, Dialect dialect) throws HibernateException { ! return sql; ! } ! /** ! * Does this query return objects that might be already cached ! * by the session, whose lock mode may need upgrading ! */ ! protected boolean upgradeLocks() { ! return false; } *************** *** 90,94 **** boolean returnProxies, final RowSelection selection, ! final Map namedParams ) throws SQLException, HibernateException { --- 95,100 ---- boolean returnProxies, final RowSelection selection, ! final Map namedParams, ! final Map lockModes ) throws SQLException, HibernateException { *************** *** 102,109 **** final int cols = persisters.length; final boolean collection = getCollectionPersister()!=null; ! final boolean twoPhaseLoad = allowTwoPhaseLoad() && cols > 0; final String[] suffixes = getSuffixes(); ! final ArrayList hydratedObjects = twoPhaseLoad ? new ArrayList() : null; final Key optionalObjectKey; --- 108,116 ---- final int cols = persisters.length; final boolean collection = getCollectionPersister()!=null; ! final boolean returnsEntities = cols > 0; final String[] suffixes = getSuffixes(); + final LockMode[] lockModeArray = getLockModes(lockModes); ! final ArrayList hydratedObjects = returnsEntities ? new ArrayList() : null; final Key optionalObjectKey; *************** *** 118,122 **** final List results = new ArrayList(); //new net.sf.hibernate.collections.List(this); ! final PreparedStatement st = prepareQueryStatement( getSQLString(), values, types, namedParams, selection, false, session ); final ResultSet rs = getResultSet(st, selection, session); --- 125,132 ---- final List results = new ArrayList(); //new net.sf.hibernate.collections.List(this); ! final PreparedStatement st = prepareQueryStatement( ! applyLocks( getSQLString(), lockModes, session.getFactory().getDialect() ), ! values, types, namedParams, selection, false, session ! ); final ResultSet rs = getResultSet(st, selection, session); *************** *** 126,130 **** final Key[] keys = new Key[cols]; //we can reuse it each time - final boolean[] hydrate = new boolean[cols]; //we can reuse it each time if ( log.isTraceEnabled() ) log.trace("processing result set"); --- 136,139 ---- *************** *** 134,165 **** for ( int i=0; i<cols; i++ ) { ! keys[i] = getKeyFromResultSet( persisters[i], suffixes[i], (i==cols-1) ? optionalID : null, rs, session ); } // this call is side-effecty ! Object[] row = getRow(rs, persisters, suffixes, keys, hydrate, optionalObject, optionalObjectKey, session); ! for ( int i=0; i<cols; i++ ) { ! if ( hydrate[i] ) { ! ! // grab its state from the ResultSet and keep it in the Session ! // (but don't yet initialize the object itself) ! loadFromResultSet( rs, row[i], keys[i].getIdentifier(), suffixes[i], session ); ! ! if (twoPhaseLoad) { ! //materialize associations (and initialize the object) later ! hydratedObjects.add( row[i] ); ! } ! else { ! //materialize associations (and initialize the object) *now* ! session.initializeEntity( row[i] ); ! } ! ! } ! // now get the proxy, _after_ the call to initializeEntity() ! if (returnProxies) row[i] = session.proxyFor( persisters[i], keys[i], row[i] ); } - results.add( getResultColumnOrRow(row, rs, session) ); --- 143,158 ---- for ( int i=0; i<cols; i++ ) { ! keys[i] = getKeyFromResultSet( persisters[i], suffixes[i], (i==cols-1) ? optionalID : null, rs, session ); ! //TODO: the i==cols-1 bit depends upon subclass implementation (very bad) } // this call is side-effecty ! Object[] row = getRow(rs, persisters, suffixes, keys, optionalObject, optionalObjectKey, lockModeArray, hydratedObjects, session); ! if (returnProxies) { ! // now get an existing proxy for each row element (if there is one) ! for ( int i=0; i<cols; i++ ) row[i] = session.proxyFor( persisters[i], keys[i], row[i] ); } results.add( getResultColumnOrRow(row, rs, session) ); *************** *** 183,189 **** } ! if (twoPhaseLoad) { ! Iterator iter = hydratedObjects.iterator(); ! while ( iter.hasNext() ) session.initializeEntity( iter.next() ); } --- 176,183 ---- } ! if (returnsEntities) { ! int hydratedObjectsSize = hydratedObjects.size(); ! if ( log.isTraceEnabled() ) log.trace("total objects hydrated: " + hydratedObjectsSize); ! for ( int i=0; i<hydratedObjectsSize; i++ ) session.initializeEntity( hydratedObjects.get(i) ); } *************** *** 218,221 **** --- 212,234 ---- /** + * Check the version of the object in the <tt>ResultSet</tt> against + * the object version in the session cache, throwing an + * exception if the version numbers are different + */ + private void checkVersion(Loadable persister, String suffix, Serializable id, Object version, ResultSet rs, SessionImplementor session) + throws HibernateException, SQLException { + + if (version!=null) { //null version means the object is in the process of being loaded somewhere else in the ResultSet + String[] versionColumNames = new Alias(suffix).toAliasStrings( + persister.getPropertyColumnNames( persister.getVersionProperty() ) + ); + StringHelper.unQuoteInPlace(versionColumNames); + Type versionType = persister.getVersionType(); + Object currentVersion = versionType.nullSafeGet(rs, versionColumNames, session, null); + if ( !versionType.equals(version, currentVersion) ) throw new StaleObjectStateException( persister.getMappedClass(), id ); + } + } + + /** * Resolve any ids for currently loaded objects, duplications within the <tt>ResultSet</tt>, etc. * Instantiate empty objects to be initialized from the <tt>ResultSet</tt>. Return an array of objects *************** *** 224,235 **** */ private Object[] getRow( ! ResultSet rs, ! Loadable[] persisters, ! String[] suffixes, ! Key[] keys, ! boolean[] hydrate, //RETURNS VALUES BY SIDE-EFFECT!!!!!!!! ! Object optionalObject, ! Key optionalObjectKey, ! SessionImplementor session ) throws HibernateException, SQLException { --- 237,249 ---- */ private Object[] getRow( ! final ResultSet rs, ! final Loadable[] persisters, ! final String[] suffixes, ! final Key[] keys, ! final Object optionalObject, ! final Key optionalObjectKey, ! final LockMode[] lockModes, ! final List hydratedObjects, ! final SessionImplementor session ) throws HibernateException, SQLException { *************** *** 246,250 **** if ( keys[i]==null ) { ! hydrate[i] = false; } else { --- 260,264 ---- if ( keys[i]==null ) { ! //do nothing } else { *************** *** 253,282 **** object = session.getEntity(key); if (object!=null) { - //its already loaded so don't need to hydrate it ! hydrate[i] = false; ! ! if ( !persisters[i].getMappedClass().isAssignableFrom( object.getClass() ) ) ! throw new WrongClassException( "loaded object was of wrong class", key.getIdentifier(), persisters[i].getMappedClass() ); ! } else { ! ! Class instanceClass = getInstanceClass( rs, persisters[i], suffixes[i], key.getIdentifier(), session ); ! ! if ( optionalObjectKey!=null && key.equals(optionalObjectKey) ) { ! //its the given optional object ! object=optionalObject; ! } ! else { ! // instantiate a new instance ! object = session.instantiate( instanceClass, key.getIdentifier() ); ! } ! ! //need to hydrate it. ! hydrate[i] = true; ! ! // so that code is circular-reference safe: ! session.addUninitializedEntity( key, object, getLockMode() ); } --- 267,275 ---- object = session.getEntity(key); if (object!=null) { //its already loaded so don't need to hydrate it ! instanceAlreadyLoaded(rs, persisters[i], suffixes[i], key, object, lockModes[i], session); } else { ! object = instanceNotYetLoaded(rs, persisters[i], suffixes[i], key, lockModes[i], optionalObjectKey, optionalObject, hydratedObjects, session); } *************** *** 291,308 **** } /** * Hydrate an object from the SQL <tt>ResultSet</tt> */ ! private void loadFromResultSet(ResultSet rs, Object object, Serializable id, String suffix, SessionImplementor session) throws SQLException, HibernateException { ! if ( log.isTraceEnabled() ) log.trace("Initializing object from ResultSet: " + id); // Get the persister for the _subclass_ Loadable persister = (Loadable) session.getPersister(object); Object[] values = hydrate(rs, id, object, persister, session, suffix); ! session.postHydrate(persister, id, values, object, getLockMode() ); //if ( persister.isMutable() ) tableAccesses.add( persister.getQualifiedTableName() ); --- 284,361 ---- } + private void instanceAlreadyLoaded(ResultSet rs, Loadable persister, String suffix, Key key, Object object, LockMode lockMode, SessionImplementor session) + throws HibernateException, SQLException { + + if ( !persister.getMappedClass().isAssignableFrom( object.getClass() ) ) + throw new WrongClassException( "loaded object was of wrong class", key.getIdentifier(), persister.getMappedClass() ); + + if ( LockMode.NONE!=lockMode && upgradeLocks() ) { //no point doing this if NONE was requested + + if ( + persister.isVersioned() && + session.getLockMode(object).lessThan(lockMode) + // we don't need to worry about existing version being uninitialized + // because this block isn't called by a re-entrant load (re-entrant + // loads _always_ have lock mode NONE) + ) { + //we only check the version when _upgrading_ lock modes + checkVersion(persister, suffix, key.getIdentifier(), session.getVersion(object), rs, session); + //we need to upgrade the lock mode to the mode requested + session.setLockMode(object, lockMode); + } + + } + + } + + private Object instanceNotYetLoaded(ResultSet rs, Loadable persister, String suffix, Key key, LockMode lockMode, Key optionalObjectKey, Object optionalObject, List hydratedObjects, SessionImplementor session) + throws HibernateException, SQLException { + Object object; + + Class instanceClass = getInstanceClass( rs, persister, suffix, key.getIdentifier(), session ); + + if ( optionalObjectKey!=null && key.equals(optionalObjectKey) ) { + //its the given optional object + object=optionalObject; + } + else { + // instantiate a new instance + object = session.instantiate( instanceClass, key.getIdentifier() ); + } + + //need to hydrate it. + + // grab its state from the ResultSet and keep it in the Session + // (but don't yet initialize the object itself) + // note that we acquire LockMode.READ even if it was not requested + LockMode acquiredLockMode = lockMode==LockMode.NONE ? LockMode.READ : lockMode; + loadFromResultSet( rs, object, key, suffix, acquiredLockMode, session ); + + //materialize associations (and initialize the object) later + hydratedObjects.add(object); + + return object; + } + /** * Hydrate an object from the SQL <tt>ResultSet</tt> */ ! private void loadFromResultSet(ResultSet rs, Object object, Key key, String suffix, LockMode lockMode, SessionImplementor session) throws SQLException, HibernateException { ! if ( log.isTraceEnabled() ) log.trace( "Initializing object from ResultSet: " + key ); ! ! // add temp entry so that the next step is circular-reference ! // safe - only needed because some types don't take proper ! // advantage of two-phase-load (esp. components) ! session.addUninitializedEntity(key, object, lockMode); // Get the persister for the _subclass_ Loadable persister = (Loadable) session.getPersister(object); + Serializable id = key.getIdentifier(); Object[] values = hydrate(rs, id, object, persister, session, suffix); ! session.postHydrate(persister, id, values, object, lockMode); //if ( persister.isMutable() ) tableAccesses.add( persister.getQualifiedTableName() ); *************** *** 514,518 **** boolean returnProxies ) throws SQLException, HibernateException { ! return doFind(session, values, types, optionalObject, optionalID, null, null, returnProxies, null, null); } --- 567,573 ---- boolean returnProxies ) throws SQLException, HibernateException { ! return doFind( ! session, values, types, optionalObject, optionalID, null, null, returnProxies, null, null, null ! ); } *************** *** 527,531 **** final PersistentCollection collection ) throws SQLException, HibernateException { ! return doFind(session, new Object[] {id}, new Type[] {type}, null, null, collection, owner, true, null, null); } --- 582,588 ---- final PersistentCollection collection ) throws SQLException, HibernateException { ! return doFind( ! session, new Object[] {id}, new Type[] {type}, null, null, collection, owner, true, null, null, null ! ); } *************** *** 540,546 **** boolean returnProxies, final RowSelection selection, ! final Map namedParams ) throws SQLException, HibernateException { ! return doFind(session, values, types, null, null, null, null, returnProxies, selection, namedParams); } --- 597,606 ---- boolean returnProxies, final RowSelection selection, ! final Map namedParams, ! final Map lockModes ) throws SQLException, HibernateException { ! return doFind( ! session, values, types, null, null, null, null, returnProxies, selection, namedParams, lockModes ! ); } Index: OneToManyLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/OneToManyLoader.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** OneToManyLoader.java 8 May 2003 09:39:22 -0000 1.15 --- OneToManyLoader.java 18 May 2003 15:45:14 -0000 1.16 *************** *** 8,11 **** --- 8,12 ---- import net.sf.hibernate.HibernateException; + import net.sf.hibernate.LockMode; import net.sf.hibernate.MappingException; import net.sf.hibernate.collection.CollectionPersister; *************** *** 85,88 **** --- 86,90 ---- classPersisters = new Loadable[joins+1]; + lockModeArray = createLockModeArray(joins+1, LockMode.NONE); for ( int i=0; i<joins; i++ ) classPersisters[i] = ( (OuterJoinableAssociation) associations.get(i) ).subpersister; classPersisters[joins] = persister; Index: OuterJoinLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/OuterJoinLoader.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** OuterJoinLoader.java 14 May 2003 12:20:23 -0000 1.21 --- OuterJoinLoader.java 18 May 2003 15:45:14 -0000 1.22 *************** *** 3,11 **** --- 3,14 ---- import java.util.ArrayList; + import java.util.Arrays; import java.util.HashSet; import java.util.Iterator; import java.util.List; + import java.util.Map; import java.util.Set; + import net.sf.hibernate.LockMode; import net.sf.hibernate.MappingException; import net.sf.hibernate.collection.CollectionPersister; *************** *** 29,33 **** * @author Gavin King, Jon Lipsky */ ! public /*abstract*/ class OuterJoinLoader extends Loader { public static final int EAGER = 1; --- 32,36 ---- * @author Gavin King, Jon Lipsky */ ! public abstract class OuterJoinLoader extends Loader { public static final int EAGER = 1; *************** *** 40,43 **** --- 43,47 ---- protected static final Loadable[] NO_PERSISTERS = new Loadable[0]; protected Loadable[] classPersisters; + protected LockMode[] lockModeArray; protected String sql; protected String[] suffixes; *************** *** 342,345 **** --- 346,359 ---- return result; }*/ + + protected LockMode[] getLockModes(Map lockModes) { + return lockModeArray; + } + + protected LockMode[] createLockModeArray(int length, LockMode lockMode) { + LockMode[] array = new LockMode[length]; + Arrays.fill(array, lockMode); + return array; + } } Index: SimpleEntityLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/SimpleEntityLoader.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SimpleEntityLoader.java 25 Apr 2003 03:40:35 -0000 1.8 --- SimpleEntityLoader.java 18 May 2003 15:45:14 -0000 1.9 *************** *** 5,8 **** --- 5,9 ---- import java.sql.SQLException; import java.util.List; + import java.util.Map; import net.sf.hibernate.HibernateException; *************** *** 23,27 **** private final Type[] idType; private final String sql; ! private final LockMode lockMode; private static final String[] NO_SUFFIX = new String[] { StringHelper.EMPTY_STRING }; --- 24,28 ---- private final Type[] idType; private final String sql; ! private final LockMode[] lockMode; private static final String[] NO_SUFFIX = new String[] { StringHelper.EMPTY_STRING }; *************** *** 30,34 **** this.idType = new Type[] { persister.getIdentifierType() }; this.sql = sql; ! this.lockMode = lockMode; } --- 31,35 ---- this.idType = new Type[] { persister.getIdentifierType() }; this.sql = sql; ! this.lockMode = new LockMode[] { lockMode }; } *************** *** 49,56 **** } - public LockMode getLockMode() { - return lockMode; - } - public Object load(SessionImplementor session, Serializable id, Object object) throws HibernateException, SQLException { List list = loadEntity(session, new Object[] { id }, idType, object, id, false); --- 50,53 ---- *************** *** 67,70 **** --- 64,71 ---- + protected LockMode[] getLockModes(Map lockModes) { + return lockMode; + } + } |
From: <one...@us...> - 2003-05-18 15:45:18
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine In directory sc8-pr-cvs1:/tmp/cvs-serv10989/hibernate/engine Modified Files: SessionImplementor.java Log Message: * added Query.setLockMode() * tidied up implementation of Loader Index: SessionImplementor.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/SessionImplementor.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** SessionImplementor.java 25 Apr 2003 03:40:32 -0000 1.12 --- SessionImplementor.java 18 May 2003 15:45:13 -0000 1.13 *************** *** 110,131 **** * Execute a <tt>find()</tt> query */ ! public List find(String query, Object[] values, Type[] types, RowSelection selection, Map namedParams) throws HibernateException; /** * Execute an <tt>iterate()</tt> query */ ! public Iterator iterate(String query, Object[] values, Type[] types, RowSelection selection, Map namedParams) throws HibernateException; /** * Execute a <tt>scroll()</tt> query */ ! public ScrollableResults scroll(String query, Object[] values, Type[] types, RowSelection selection, Map namedParams) throws HibernateException; /** * Execute a filter */ ! public List filter(Object collection, String filter, Object[] values, Type[] types, RowSelection selection, Map namedParams) throws HibernateException; /** * Iterate a filter */ ! public Iterator iterateFilter(Object collection, String filter, Object[] values, Type[] types, RowSelection selection, Map namedParams) throws HibernateException; /** * Get the <tt>ClassPersister</tt> for an object --- 110,131 ---- * Execute a <tt>find()</tt> query */ ! public List find(String query, Object[] values, Type[] types, RowSelection selection, Map namedParams, Map lockModes) throws HibernateException; /** * Execute an <tt>iterate()</tt> query */ ! public Iterator iterate(String query, Object[] values, Type[] types, RowSelection selection, Map namedParams, Map lockModes) throws HibernateException; /** * Execute a <tt>scroll()</tt> query */ ! public ScrollableResults scroll(String query, Object[] values, Type[] types, RowSelection selection, Map namedParams, Map lockModes) throws HibernateException; /** * Execute a filter */ ! public List filter(Object collection, String filter, Object[] values, Type[] types, RowSelection selection, Map namedParams, Map lockModes) throws HibernateException; /** * Iterate a filter */ ! public Iterator iterateFilter(Object collection, String filter, Object[] values, Type[] types, RowSelection selection, Map namedParams, Map lockModes) throws HibernateException; /** * Get the <tt>ClassPersister</tt> for an object *************** *** 185,188 **** --- 185,202 ---- public Object instantiate(Class clazz, Serializable id) throws HibernateException; + /** + * Set the lock mode of the entity to the given lock mode + */ + public void setLockMode(Object entity, LockMode lockMode); + + /** + * Get the current versioon of the entity + */ + public Object getVersion(Object entity); + + /** + * Get the lock mode of the entity + */ + public LockMode getLockMode(Object object); } |
From: <one...@us...> - 2003-05-18 15:45:17
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect In directory sc8-pr-cvs1:/tmp/cvs-serv10989/hibernate/dialect Modified Files: Dialect.java Oracle9Dialect.java PostgreSQLDialect.java Log Message: * added Query.setLockMode() * tidied up implementation of Loader Index: Dialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/Dialect.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Dialect.java 4 May 2003 06:09:40 -0000 1.15 --- Dialect.java 18 May 2003 15:45:13 -0000 1.16 *************** *** 136,139 **** --- 136,147 ---- /** + * Does this dialect support <tt>FOR UPDATE OF</tt>, allowing + * particular rows to be locked? + */ + public boolean supportsForUpdateOf() { + return false; + } + + /** * Does this dialect support the Oracle-style <tt>FOR UPDATE NOWAIT</tt> syntax? * @return boolean Index: Oracle9Dialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/Oracle9Dialect.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Oracle9Dialect.java 14 May 2003 12:20:23 -0000 1.7 --- Oracle9Dialect.java 18 May 2003 15:45:13 -0000 1.8 *************** *** 78,81 **** --- 78,85 ---- } + public boolean supportsForUpdateOf() { + return true; + } + } Index: PostgreSQLDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/PostgreSQLDialect.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** PostgreSQLDialect.java 4 May 2003 06:09:40 -0000 1.12 --- PostgreSQLDialect.java 18 May 2003 15:45:13 -0000 1.13 *************** *** 77,80 **** --- 77,84 ---- return true; } + public boolean supportsForUpdateOf() { + return true; + } + } |
From: <one...@us...> - 2003-05-18 15:45:17
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv10989/hibernate Modified Files: LockMode.java Query.java Log Message: * added Query.setLockMode() * tidied up implementation of Loader Index: LockMode.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/LockMode.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** LockMode.java 25 Apr 2003 03:40:29 -0000 1.5 --- LockMode.java 18 May 2003 15:45:12 -0000 1.6 *************** *** 43,52 **** /** * No lock required. If an object is requested with this lock ! * mode, a <tt>READ</tt> lock might be obtained if necessary. */ public static final LockMode NONE = new LockMode(0, "NONE"); /** ! * A shared lock. Objects are loaded in <tt>READ</tt> mode ! * by default. */ public static final LockMode READ = new LockMode(5, "READ"); --- 43,57 ---- /** * No lock required. If an object is requested with this lock ! * mode, a <tt>READ</tt> lock will be obtained if it is ! * necessary to actually read the state from the database, ! * rather than pull it from a cache.<br> ! * <br> ! * This is the "default" lock mode. */ public static final LockMode NONE = new LockMode(0, "NONE"); /** ! * A shared lock. Objects in this lock mode were read from ! * the database in the current transaction, rather than being ! * pulled from a cache. */ public static final LockMode READ = new LockMode(5, "READ"); Index: Query.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Query.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Query.java 25 Apr 2003 03:40:30 -0000 1.12 --- Query.java 18 May 2003 15:45:13 -0000 1.13 *************** *** 129,132 **** --- 129,139 ---- /** + * Set the lockmode for the objects idententified by the + * given alias that appears in the <tt>FROM</tt> clause. + * @param alias a query alias, or <tt>this</tt> for a collection filter + */ + public void setLockMode(String alias, LockMode lockMode); + + /** * Bind a value to a JDBC-style query parameter. * @param position the position of the parameter in the query |
From: <max...@us...> - 2003-05-18 13:36:14
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java In directory sc8-pr-cvs1:/tmp/cvs-serv20845/src/net/sf/hibernate/tool/hbm2java Modified Files: ClassMapping.java Log Message: hbm2java now honors the sort attribute. Meaning that set/map that has sort != unsorted will be generated as SortedSet and SortedMap respectively Index: ClassMapping.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/hbm2java/ClassMapping.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ClassMapping.java 4 May 2003 10:32:02 -0000 1.16 --- ClassMapping.java 18 May 2003 13:36:10 -0000 1.17 *************** *** 2,5 **** --- 2,6 ---- package net.sf.hibernate.tool.hbm2java; + import java.util.*; import java.util.ArrayList; import java.util.Collection; *************** *** 495,509 **** private void doCollections(Element classElement, String xmlName, String interfaceClass, String implementingClass, MultiMap inheritedMeta) { - ClassName interfaceClassName = new ClassName(); - ClassName implementingClassName = new ClassName(); - - interfaceClassName.setFullyQualifiedName(interfaceClass); - implementingClassName.setFullyQualifiedName(implementingClass); for (Iterator collections = classElement.getChildren(xmlName).iterator(); collections.hasNext();) { Element collection = (Element) collections.next(); MultiMap metaForCollection = MetaAttributeHelper.loadAndMergeMetaMap(collection, inheritedMeta); String name = collection.getAttributeValue("name"); // add an import and field for this collection addImport(interfaceClassName); --- 496,523 ---- private void doCollections(Element classElement, String xmlName, String interfaceClass, String implementingClass, MultiMap inheritedMeta) { for (Iterator collections = classElement.getChildren(xmlName).iterator(); collections.hasNext();) { + Element collection = (Element) collections.next(); MultiMap metaForCollection = MetaAttributeHelper.loadAndMergeMetaMap(collection, inheritedMeta); String name = collection.getAttributeValue("name"); + // Small hack to switch over to sortedSet/sortedMap if sort is specified. (that is sort != unsorted) + if (!"unsorted".equals(collection.getAttributeValue("sort"))) { + if("map".equals(xmlName)) { + interfaceClass = SortedMap.class.getName(); + implementingClass = TreeMap.class.getName(); + } else if("set".equals(xmlName)) { + interfaceClass = SortedSet.class.getName(); + implementingClass = TreeSet.class.getName(); + } + } + + ClassName interfaceClassName = new ClassName(); + ClassName implementingClassName = new ClassName(); + + interfaceClassName.setFullyQualifiedName(interfaceClass); + implementingClassName.setFullyQualifiedName(implementingClass); + // add an import and field for this collection addImport(interfaceClassName); *************** *** 513,516 **** --- 527,531 ---- //addImport(implementingClassName); + ClassName foreignClass = null; Set foreignKeys = null; |
From: Minhaz F Z. <m.z...@gr...> - 2003-05-17 11:48:35
|
----- Original Message ----- From: "N. Chowdhury" <n.c...@gr...> To: <m.z...@gr...> Sent: Sunday, May 18, 2003 5:42 AM Subject: Hi everyone, > |
From: <one...@us...> - 2003-05-17 04:09:45
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv30184/impl Modified Files: SessionImpl.java Log Message: added exceptions to Interceptor interface as per HB-57 Index: SessionImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionImpl.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** SessionImpl.java 11 May 2003 02:31:17 -0000 1.44 --- SessionImpl.java 17 May 2003 04:09:42 -0000 1.45 *************** *** 957,961 **** } ! interceptor.onDelete(object, entry.id, entry.deletedState, persister.getPropertyNames(), propTypes); nullifyTransientReferences(entry.deletedState, propTypes, false, object); --- 957,961 ---- } ! interceptor.onDelete(object, entry.id, entry.deletedState, persister.getPropertyNames(), propTypes); //TODO: if an exception occurs, doesn't clean up entry.deletedState nullifyTransientReferences(entry.deletedState, propTypes, false, object); |
From: <one...@us...> - 2003-05-17 04:09:45
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv30184 Modified Files: CallbackException.java Interceptor.java Log Message: added exceptions to Interceptor interface as per HB-57 Index: CallbackException.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/CallbackException.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CallbackException.java 25 Apr 2003 03:40:29 -0000 1.4 --- CallbackException.java 17 May 2003 04:09:42 -0000 1.5 *************** *** 4,10 **** /** * Should be thrown by persistent objects from <tt>Lifecycle</tt> ! * callbacks. * * @see Lifecycle * @author Gavin King */ --- 4,11 ---- /** * Should be thrown by persistent objects from <tt>Lifecycle</tt> ! * or <tt>Interceptor</tt> callbacks. * * @see Lifecycle + * @see Interceptor * @author Gavin King */ Index: Interceptor.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Interceptor.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Interceptor.java 25 Apr 2003 03:40:29 -0000 1.9 --- Interceptor.java 17 May 2003 04:09:42 -0000 1.10 *************** *** 31,35 **** * @return <tt>true</tt> if the user modified the <tt>state</tt> in any way. */ ! public boolean onLoad(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types); /** * Called when an object is detected to be dirty, during a flush. The interceptor may modify the detected --- 31,35 ---- * @return <tt>true</tt> if the user modified the <tt>state</tt> in any way. */ ! public boolean onLoad(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException; /** * Called when an object is detected to be dirty, during a flush. The interceptor may modify the detected *************** *** 41,45 **** * @return <tt>true</tt> if the user modified the <tt>currentState</tt> in any way. */ ! public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types); /** * Called before an object is saved. The interceptor may modify the <tt>state</tt>, which will be used for --- 41,45 ---- * @return <tt>true</tt> if the user modified the <tt>currentState</tt> in any way. */ ! public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) throws CallbackException; /** * Called before an object is saved. The interceptor may modify the <tt>state</tt>, which will be used for *************** *** 48,65 **** * @return <tt>true</tt> if the user modified the <tt>state</tt> in any way. */ ! public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types); /** * Called before an object is deleted. It is not recommended that the interceptor modify the <tt>state</tt>. */ ! public void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types); /** * Called before a flush */ ! public void preFlush(Iterator entities); /** * Called after a flush that actually ends in execution of the SQL statements required to synchronize * in-memory state with the database. */ ! public void postFlush(Iterator entities); /** * Called when a transient entity is passed to <tt>saveOrUpdate()</tt>. The return value determines --- 48,65 ---- * @return <tt>true</tt> if the user modified the <tt>state</tt> in any way. */ ! public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException; /** * Called before an object is deleted. It is not recommended that the interceptor modify the <tt>state</tt>. */ ! public void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException; /** * Called before a flush */ ! public void preFlush(Iterator entities) throws CallbackException; /** * Called after a flush that actually ends in execution of the SQL statements required to synchronize * in-memory state with the database. */ ! public void postFlush(Iterator entities) throws CallbackException; /** * Called when a transient entity is passed to <tt>saveOrUpdate()</tt>. The return value determines *************** *** 92,96 **** * @return an instance of the class, or <tt>null</tt> to choose default behaviour */ ! public Object instantiate(Class clazz, Serializable id); } --- 92,96 ---- * @return an instance of the class, or <tt>null</tt> to choose default behaviour */ ! public Object instantiate(Class clazz, Serializable id) throws CallbackException; } |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv25187/test Modified Files: FooBarTest.java MasterDetailTest.java SQLFunctionsTest.java SingleSeveral.hbm.xml Log Message: improved MckoiDialect Index: FooBarTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooBarTest.java,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** FooBarTest.java 13 May 2003 10:50:43 -0000 1.64 --- FooBarTest.java 17 May 2003 03:53:37 -0000 1.65 *************** *** 614,618 **** s.find("select max( elements(bar.baz.fooArray) ) from Bar as bar"); //The following test is disabled for databases with no subselects...also for Interbase (not sure why). ! if ( !(dialect instanceof MySQLDialect) && !(dialect instanceof HSQLDialect) && !(dialect instanceof MckoiDialect) && !(dialect instanceof SAPDBDialect) && !(dialect instanceof PointbaseDialect) ) { s.find("select count(*) from Baz as baz where 1 in indices(baz.fooArray)"); s.find("select count(*) from Bar as bar where 'abc' in elements(bar.baz.fooArray)"); --- 614,618 ---- s.find("select max( elements(bar.baz.fooArray) ) from Bar as bar"); //The following test is disabled for databases with no subselects...also for Interbase (not sure why). ! if ( !(dialect instanceof MySQLDialect) && !(dialect instanceof HSQLDialect) /*&& !(dialect instanceof MckoiDialect)*/ && !(dialect instanceof SAPDBDialect) && !(dialect instanceof PointbaseDialect) ) { s.find("select count(*) from Baz as baz where 1 in indices(baz.fooArray)"); s.find("select count(*) from Bar as bar where 'abc' in elements(bar.baz.fooArray)"); *************** *** 1339,1347 **** assertTrue( list.size()==2, "component query" ); } ! list = s.find("from foo in class net.sf.hibernate.test.Foo where foo.component.importantDates.size = 3"); //WAS: 4 assertTrue( list.size()==2, "component query" ); ! list = s.find("from foo in class net.sf.hibernate.test.Foo where 0 = foo.component.importantDates.size"); assertTrue( list.size()==0, "component query" ); ! list = s.find("from foo in class net.sf.hibernate.test.Foo where exists foo.component.importantDates.elements"); assertTrue( list.size()==2, "component query" ); s.find("from foo in class Foo where not exists (from bar in class Bar where bar.id = foo.id)"); --- 1339,1347 ---- assertTrue( list.size()==2, "component query" ); } ! list = s.find("from foo in class net.sf.hibernate.test.Foo where size(foo.component.importantDates) = 3"); //WAS: 4 assertTrue( list.size()==2, "component query" ); ! list = s.find("from foo in class net.sf.hibernate.test.Foo where 0 = size(foo.component.importantDates)"); assertTrue( list.size()==0, "component query" ); ! list = s.find("from foo in class net.sf.hibernate.test.Foo where exists elements(foo.component.importantDates)"); assertTrue( list.size()==2, "component query" ); s.find("from foo in class Foo where not exists (from bar in class Bar where bar.id = foo.id)"); *************** *** 1352,1356 **** s.find("from foo in class Foo where foo = some(select x from x in class Foo where x.long > foo.foo.long)"); ! s.iterate("select foo.string, foo.date, foo.foo.string, foo.id from foo in class Foo, baz in class Baz where foo in baz.fooArray.elements and foo.string like 'foo'"); } list = s.find("from foo in class net.sf.hibernate.test.Foo where foo.component.count is null order by foo.component.count"); --- 1352,1356 ---- s.find("from foo in class Foo where foo = some(select x from x in class Foo where x.long > foo.foo.long)"); ! s.iterate("select foo.string, foo.date, foo.foo.string, foo.id from foo in class Foo, baz in class Baz where foo in elements(baz.fooArray) and foo.string like 'foo'"); } list = s.find("from foo in class net.sf.hibernate.test.Foo where foo.component.count is null order by foo.component.count"); Index: MasterDetailTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/MasterDetailTest.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** MasterDetailTest.java 3 May 2003 07:06:26 -0000 1.10 --- MasterDetailTest.java 17 May 2003 03:53:38 -0000 1.11 *************** *** 20,23 **** --- 20,24 ---- import net.sf.hibernate.Transaction; import net.sf.hibernate.dialect.HSQLDialect; + import net.sf.hibernate.dialect.MckoiDialect; import net.sf.hibernate.dialect.MySQLDialect; import net.sf.hibernate.dialect.SAPDBDialect; *************** *** 87,91 **** Session s = sessions.openSession(); Transaction t = s.beginTransaction(); ! if ( !(dialect instanceof MySQLDialect) && !(dialect instanceof SAPDBDialect) ) { s.iterate("FROM m IN CLASS Master WHERE NOT EXISTS ( FROM d IN m.details.elements WHERE NOT d.i=5 )"); s.iterate("FROM m IN CLASS Master WHERE NOT 5 IN ( SELECT d.i FROM d IN m.details.elements )"); --- 88,92 ---- Session s = sessions.openSession(); Transaction t = s.beginTransaction(); ! if ( !(dialect instanceof MySQLDialect) && !(dialect instanceof SAPDBDialect) && !(dialect instanceof MckoiDialect) ) { s.iterate("FROM m IN CLASS Master WHERE NOT EXISTS ( FROM d IN m.details.elements WHERE NOT d.i=5 )"); s.iterate("FROM m IN CLASS Master WHERE NOT 5 IN ( SELECT d.i FROM d IN m.details.elements )"); *************** *** 113,117 **** master.addDetail(d1); master.addDetail(d2); ! if ( !(dialect instanceof MySQLDialect) && !(dialect instanceof SAPDBDialect) ) { assertTrue( s.find("from d in class net.sf.hibernate.test.Detail, m in class net.sf.hibernate.test.Master where m = d.master and m.outgoing.size = 0 and m.incoming.size = 0").size()==2, --- 114,118 ---- master.addDetail(d1); master.addDetail(d2); ! if ( !(dialect instanceof MySQLDialect) && !(dialect instanceof SAPDBDialect) && !(dialect instanceof MckoiDialect) ) { assertTrue( s.find("from d in class net.sf.hibernate.test.Detail, m in class net.sf.hibernate.test.Master where m = d.master and m.outgoing.size = 0 and m.incoming.size = 0").size()==2, Index: SQLFunctionsTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/SQLFunctionsTest.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SQLFunctionsTest.java 5 Apr 2003 07:13:38 -0000 1.7 --- SQLFunctionsTest.java 17 May 2003 03:53:38 -0000 1.8 *************** *** 13,16 **** --- 13,17 ---- import net.sf.hibernate.dialect.DB2Dialect; import net.sf.hibernate.dialect.InterbaseDialect; + import net.sf.hibernate.dialect.MckoiDialect; import net.sf.hibernate.dialect.MySQLDialect; import net.sf.hibernate.dialect.SybaseDialect; *************** *** 55,59 **** s.find("from s in class Simple where not( upper( s.name ) ='yada' or 1=2 or 'foo'='bar' or not('foo'='foo') or 'foo' like 'bar' )").size()==1 ); ! if ( !(dialect instanceof MySQLDialect) && !(dialect instanceof SybaseDialect) && !(dialect instanceof InterbaseDialect) ) { //My SQL has a funny concatenation operator assertTrue( s.find("from s in class Simple where lower( s.name || ' foo' ) ='simple 1 foo'").size()==1 --- 56,60 ---- s.find("from s in class Simple where not( upper( s.name ) ='yada' or 1=2 or 'foo'='bar' or not('foo'='foo') or 'foo' like 'bar' )").size()==1 ); ! if ( !(dialect instanceof MySQLDialect) && !(dialect instanceof SybaseDialect) && !(dialect instanceof MckoiDialect) && !(dialect instanceof InterbaseDialect) ) { //My SQL has a funny concatenation operator assertTrue( s.find("from s in class Simple where lower( s.name || ' foo' ) ='simple 1 foo'").size()==1 *************** *** 63,66 **** --- 64,72 ---- assertTrue( s.find("from s in class Simple where lower( s.name + ' foo' ) ='simple 1 foo'").size()==1 + ); + } + if ( (dialect instanceof MckoiDialect) ) { + assertTrue( + s.find("from s in class Simple where lower( concat(s.name, ' foo') ) ='simple 1 foo'").size()==1 ); } Index: SingleSeveral.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/SingleSeveral.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SingleSeveral.hbm.xml 29 Mar 2003 07:36:22 -0000 1.4 --- SingleSeveral.hbm.xml 17 May 2003 03:53:38 -0000 1.5 *************** *** 8,12 **** <composite-id> <key-property name="id" length="32"/> ! <key-property name="string" length="32"/> </composite-id> <property name="prop"/> --- 8,12 ---- <composite-id> <key-property name="id" length="32"/> ! <key-property name="string" length="32" column="string_"/> </composite-id> <property name="prop"/> *************** *** 23,27 **** <composite-id> <key-property name="id" length="32"/> ! <key-property name="string" length="32"/> </composite-id> <many-to-one name="single"> --- 23,27 ---- <composite-id> <key-property name="id" length="32"/> ! <key-property name="string" length="32" column="string_"/> </composite-id> <many-to-one name="single"> |
From: <one...@us...> - 2003-05-17 03:53:40
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/sql In directory sc8-pr-cvs1:/tmp/cvs-serv25187/sql Added Files: MckoiCaseFragment.java Log Message: improved MckoiDialect --- NEW FILE: MckoiCaseFragment.java --- //$Id: MckoiCaseFragment.java,v 1.1 2003/05/17 03:53:37 oneovthafew Exp $ package net.sf.hibernate.sql; import java.util.Iterator; import java.util.Map; import net.sf.hibernate.util.StringHelper; import org.apache.commons.collections.SequencedHashMap; /** * Represents an SQL <tt>if(..., ..., ....) as ...</tt> * @author Gavin King */ public class MckoiCaseFragment extends CaseFragment { private String returnColumnName; private Map cases = new SequencedHashMap(); public CaseFragment setReturnColumnName(String returnColumnName) { this.returnColumnName = returnColumnName; return this; } public CaseFragment setReturnColumnName(String returnColumnName, String suffix) { return setReturnColumnName( new Alias(suffix).toAliasString(returnColumnName) ); } public CaseFragment addWhenColumnNotNull(String alias, String columnName, String value) { cases.put( alias + StringHelper.DOT + columnName + " is not null", value ); return this; } public String toFragmentString() { StringBuffer buf = new StringBuffer( cases.size() * 15 + 10 ); StringBuffer buf2= new StringBuffer(cases.size()); Iterator iter = cases.entrySet().iterator(); while ( iter.hasNext() ) { Map.Entry me = (Map.Entry) iter.next(); buf.append(" if(") .append( me.getKey() ) .append(", ") .append( me.getValue() ) .append(", "); buf2.append(")"); } buf.append("null"); buf.append(buf2); if (returnColumnName!=null) { buf.append(" as ") .append(returnColumnName); } return buf.toString(); } } |
From: <one...@us...> - 2003-05-17 03:53:40
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect In directory sc8-pr-cvs1:/tmp/cvs-serv25187/dialect Modified Files: MckoiDialect.java Log Message: improved MckoiDialect Index: MckoiDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/MckoiDialect.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** MckoiDialect.java 25 Apr 2003 03:40:32 -0000 1.7 --- MckoiDialect.java 17 May 2003 03:53:37 -0000 1.8 *************** *** 6,9 **** --- 6,11 ---- import net.sf.hibernate.cfg.Environment; + import net.sf.hibernate.sql.CaseFragment; + import net.sf.hibernate.sql.MckoiCaseFragment; /** *************** *** 29,34 **** register( Types.VARBINARY, "VARBINARY" ); register( Types.NUMERIC, "NUMERIC" ); ! getDefaultProperties().setProperty(Environment.USE_OUTER_JOIN, "false"); getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, NO_BATCH); } --- 31,38 ---- register( Types.VARBINARY, "VARBINARY" ); register( Types.NUMERIC, "NUMERIC" ); + register( Types.BLOB, "BLOB" ); + register( Types.CLOB, "CLOB" ); ! getDefaultProperties().setProperty(Environment.USE_OUTER_JOIN, "true"); getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, NO_BATCH); } *************** *** 51,54 **** --- 55,62 ---- public boolean supportsSequences() { return true; + } + + public CaseFragment createCaseFragment() { + return new MckoiCaseFragment(); } |
From: <one...@us...> - 2003-05-15 15:17:45
|
Update of /cvsroot/hibernate/Hibernate2/doc/reference/src In directory sc8-pr-cvs1:/tmp/cvs-serv8261 Modified Files: advanced_or_mapping.xml Log Message: fixed misprints Index: advanced_or_mapping.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/src/advanced_or_mapping.xml,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** advanced_or_mapping.xml 14 May 2003 12:24:11 -0000 1.20 --- advanced_or_mapping.xml 15 May 2003 15:17:34 -0000 1.21 *************** *** 720,724 **** </id> <set name="children" lazy="true"> ! <key type="long" column="parent_id"/> <one-to-many class="eg.Child"/> </set> --- 720,724 ---- </id> <set name="children" lazy="true"> ! <key column="parent_id"/> <one-to-many class="eg.Child"/> </set> *************** *** 754,758 **** </id> <set name="children" lazy="true" table="childset"> ! <key type="long" column="parent_id"/> <many-to-many class="eg.Child" column="child_id"/> </set> --- 754,758 ---- </id> <set name="children" lazy="true" table="childset"> ! <key column="parent_id"/> <many-to-many class="eg.Child" column="child_id"/> </set> *************** *** 806,814 **** this.key=key; } ! public java.util.Date getBithday() { ! return bithday; } ! public void setBithday(java.util.Date bithday) { ! this.bithday = bithday; } public Name getName() { --- 806,814 ---- this.key=key; } ! public java.util.Date getBirthday() { ! return birthday; } ! public void setBirthday(java.util.Date birthday) { ! this.birthday = birthday; } public Name getName() { |
From: <one...@us...> - 2003-05-15 15:13:43
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/transaction In directory sc8-pr-cvs1:/tmp/cvs-serv5593 Modified Files: WebSphereTransactionManagerLookup.java Log Message: added JOTM support HB-77 Index: WebSphereTransactionManagerLookup.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/transaction/WebSphereTransactionManagerLookup.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** WebSphereTransactionManagerLookup.java 25 Apr 2003 03:40:36 -0000 1.4 --- WebSphereTransactionManagerLookup.java 15 May 2003 15:13:40 -0000 1.5 *************** *** 34,39 **** } return (TransactionManager) clazz ! .getMethod("getTransactionManager", null) ! .invoke(null, null); } catch (Exception e) { --- 34,39 ---- } return (TransactionManager) clazz ! .getMethod("getTransactionManager", null) ! .invoke(null, null); } catch (Exception e) { |
From: <one...@us...> - 2003-05-14 12:24:16
|
Update of /cvsroot/hibernate/Hibernate2/doc/reference/src In directory sc8-pr-cvs1:/tmp/cvs-serv10765 Modified Files: advanced_or_mapping.xml Log Message: fixed minor doco bug (Lu Yunhai) Index: advanced_or_mapping.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/reference/src/advanced_or_mapping.xml,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** advanced_or_mapping.xml 26 Apr 2003 19:36:25 -0000 1.19 --- advanced_or_mapping.xml 14 May 2003 12:24:11 -0000 1.20 *************** *** 356,360 **** </para> ! <programlisting><![CDATA[<set name="bars" table="foobars"> <key column="foo_id"/> <one-to-many class="com.illflow.Bar"/> --- 356,360 ---- </para> ! <programlisting><![CDATA[<set name="bars"> <key column="foo_id"/> <one-to-many class="com.illflow.Bar"/> |
From: <one...@us...> - 2003-05-14 12:20:26
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping In directory sc8-pr-cvs1:/tmp/cvs-serv9405/mapping Modified Files: Table.java Log Message: * improved HSQLDialect * commented some work-in-progress code * fixed problem with Oracle ROWNUM trick Index: Table.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Table.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Table.java 2 Feb 2003 06:41:05 -0000 1.7 --- Table.java 14 May 2003 12:20:23 -0000 1.8 *************** *** 86,91 **** Iterator iter=getColumnIterator(); StringBuffer buf=new StringBuffer(50); ! while (iter.hasNext()) { ! Column col=(Column) iter.next(); JdbcColumnInfo columnInfo=tableInfo.getColumnInfo(col.getName()); --- 86,91 ---- Iterator iter=getColumnIterator(); StringBuffer buf=new StringBuffer(50); ! while ( iter.hasNext() ) { ! Column col = (Column) iter.next(); JdbcColumnInfo columnInfo=tableInfo.getColumnInfo(col.getName()); *************** *** 95,100 **** if (buf.length()!=0) buf.append(StringHelper.COMMA_SPACE); ! buf.append(col.getName()).append(' ').append(col.getSqlType(dialect,p)); ! if (col.isUnique()&&dialect.supportsUnique()) { buf.append(" unique"); } --- 95,100 ---- if (buf.length()!=0) buf.append(StringHelper.COMMA_SPACE); ! buf.append( col.getName() ).append(' ').append( col.getSqlType(dialect,p) ); ! if ( col.isUnique() && dialect.supportsUnique() ) { buf.append(" unique"); } *************** *** 103,110 **** } ! if (buf.length()==0) ! return null; ! ! return new StringBuffer("alter table ").append(getQualifiedName()).append(" add ").append(buf).toString(); } --- 103,112 ---- } ! if ( buf.length()==0 ) { ! return null; ! } ! else { ! return new StringBuffer("alter table ").append(getQualifiedName()).append(" add ").append(buf).toString(); ! } } *************** *** 112,117 **** public String sqlCreateString(Dialect dialect, Mapping p) throws HibernateException { StringBuffer buf = new StringBuffer("create table ") ! .append( getQualifiedName() ) ! .append(" ("); boolean identityColumn = idValue!=null && idValue.createIdentifierGenerator(dialect) instanceof IdentityGenerator; --- 114,119 ---- public String sqlCreateString(Dialect dialect, Mapping p) throws HibernateException { StringBuffer buf = new StringBuffer("create table ") ! .append( getQualifiedName() ) ! .append(" ("); boolean identityColumn = idValue!=null && idValue.createIdentifierGenerator(dialect) instanceof IdentityGenerator; *************** *** 144,149 **** } ! if ( col.isUnique() && dialect.supportsUnique() ) { ! buf.append(" unique"); } if ( iter.hasNext() ) buf.append(StringHelper.COMMA_SPACE); --- 146,157 ---- } ! if ( col.isUnique() ) { ! if ( dialect.supportsUnique() ) { ! buf.append(" unique"); ! } ! else { ! UniqueKey uk = getUniqueKey( col.getName() + '_' ); ! uk.addColumn(col); ! } } if ( iter.hasNext() ) buf.append(StringHelper.COMMA_SPACE); *************** *** 159,169 **** } } ! if ( dialect.supportsUnique() ) { ! Iterator ukiter = getUniqueKeyIterator(); ! while ( ukiter.hasNext() ) { ! UniqueKey uk = (UniqueKey) ukiter.next(); ! buf.append(',').append( uk.sqlConstraintString(dialect) ); ! } } buf.append(StringHelper.CLOSE_PAREN); --- 167,177 ---- } } ! ! Iterator ukiter = getUniqueKeyIterator(); ! while ( ukiter.hasNext() ) { ! UniqueKey uk = (UniqueKey) ukiter.next(); ! buf.append(',').append( uk.sqlConstraintString(dialect) ); } + buf.append(StringHelper.CLOSE_PAREN); |
From: <one...@us...> - 2003-05-14 12:20:26
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader In directory sc8-pr-cvs1:/tmp/cvs-serv9405/loader Modified Files: EntityLoader.java OuterJoinLoader.java Log Message: * improved HSQLDialect * commented some work-in-progress code * fixed problem with Oracle ROWNUM trick Index: EntityLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/EntityLoader.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** EntityLoader.java 7 May 2003 15:09:05 -0000 1.15 --- EntityLoader.java 14 May 2003 12:20:23 -0000 1.16 *************** *** 11,15 **** import net.sf.hibernate.engine.SessionImplementor; import net.sf.hibernate.persister.Loadable; - import net.sf.hibernate.persister.Queryable; import net.sf.hibernate.sql.ConditionFragment; import net.sf.hibernate.type.Type; --- 11,14 ---- *************** *** 30,34 **** String condition = new ConditionFragment() .setTableAlias(alias) ! .setCondition( ( (Queryable) persister ).getIdentifierColumnNames(), "?" ) .toFragmentString(); --- 29,33 ---- String condition = new ConditionFragment() .setTableAlias(alias) ! .setCondition( persister.getIdentifierColumnNames(), "?" ) .toFragmentString(); Index: OuterJoinLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/OuterJoinLoader.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** OuterJoinLoader.java 8 May 2003 09:49:18 -0000 1.20 --- OuterJoinLoader.java 14 May 2003 12:20:23 -0000 1.21 *************** *** 59,64 **** public String[] foreignKeyColumns; // belong to other persister public String subalias; ! public String foreignKeyalias; ! public boolean isOneToOne; } --- 59,64 ---- public String[] foreignKeyColumns; // belong to other persister public String subalias; ! //public String foreignKeyalias; ! //public boolean isOneToOne; } *************** *** 224,233 **** assoc.subalias = subalias; ! if ( type.isOneToOne() ) { // only needed for oneToOne associations // because we need to avoid unnecessary lookups assoc.foreignKeyalias = alias; assoc.isOneToOne = true; ! } walkTree(subpersister, subalias, associations, classPersisters, session); --- 224,233 ---- assoc.subalias = subalias; ! /*if ( type.isOneToOne() ) { // only needed for oneToOne associations // because we need to avoid unnecessary lookups assoc.foreignKeyalias = alias; assoc.isOneToOne = true; ! }*/ walkTree(subpersister, subalias, associations, classPersisters, session); *************** *** 317,321 **** } ! protected static int[] getOneToOneOwners(String alias, List associations) { int size = associations.size(); int[] result = new int[size]; --- 317,321 ---- } ! /*protected static int[] getOneToOneOwners(String alias, List associations) { int size = associations.size(); int[] result = new int[size]; *************** *** 341,345 **** } return result; ! } } --- 341,345 ---- } return result; ! }*/ } |
From: <one...@us...> - 2003-05-14 12:20:26
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect In directory sc8-pr-cvs1:/tmp/cvs-serv9405/dialect Modified Files: HSQLDialect.java Oracle9Dialect.java SAPDBDialect.java Log Message: * improved HSQLDialect * commented some work-in-progress code * fixed problem with Oracle ROWNUM trick Index: HSQLDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/HSQLDialect.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** HSQLDialect.java 9 May 2003 08:15:15 -0000 1.10 --- HSQLDialect.java 14 May 2003 12:20:23 -0000 1.11 *************** *** 45,56 **** } - public boolean hasAlterTable(){ - return false; - } - - public boolean dropConstraints() { - return false; - } - public boolean supportsIdentityColumns() { return true; --- 45,48 ---- *************** *** 70,73 **** --- 62,68 ---- } + /** + * Not supported in 1.7.1 (1.7.2 only) + */ public boolean supportsUnique() { return false; Index: Oracle9Dialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/Oracle9Dialect.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Oracle9Dialect.java 4 May 2003 06:09:40 -0000 1.6 --- Oracle9Dialect.java 14 May 2003 12:20:23 -0000 1.7 *************** *** 74,77 **** --- 74,81 ---- } + public boolean reverseLimitParameterOrder() { + return true; + } + } Index: SAPDBDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/SAPDBDialect.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** SAPDBDialect.java 25 Apr 2003 03:40:32 -0000 1.10 --- SAPDBDialect.java 14 May 2003 12:20:23 -0000 1.11 *************** *** 42,49 **** } - public boolean hasAlterTable() { - return true; - } - public boolean supportsForUpdate() { return false; --- 42,45 ---- |
From: <one...@us...> - 2003-05-13 10:50:49
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv21526 Modified Files: ParentChildTest.java Multi.hbm.xml FooBarTest.java Log Message: extra test Index: ParentChildTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/ParentChildTest.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ParentChildTest.java 7 May 2003 15:09:06 -0000 1.11 --- ParentChildTest.java 13 May 2003 10:50:43 -0000 1.12 *************** *** 219,225 **** c1 = (Contained) s.load( Contained.class, new Long(c1.getId()) ); assertTrue( c1.getBag().size()==0 ); ! s.delete("from c in class ContainerX"); ! s.delete("from c in class Contained"); ! s.delete("from s in class Simple"); t.commit(); s.close(); --- 219,225 ---- c1 = (Contained) s.load( Contained.class, new Long(c1.getId()) ); assertTrue( c1.getBag().size()==0 ); ! assertTrue( s.delete("from c in class ContainerX")==1 ); ! assertTrue( s.delete("from c in class Contained")==1 ); ! assertTrue( s.delete("from s in class Simple")==2 ); t.commit(); s.close(); Index: Multi.hbm.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Multi.hbm.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Multi.hbm.xml 3 May 2003 07:06:26 -0000 1.10 --- Multi.hbm.xml 13 May 2003 10:50:43 -0000 1.11 *************** *** 16,20 **** <key column="superid"/> <set name="strings" table="monostrings"> ! <key column="monoid"/> <element type="string" column="str_"/> </set> --- 16,20 ---- <key column="superid"/> <set name="strings" table="monostrings"> ! <key column="monoid_"/> <element type="string" column="str_"/> </set> *************** *** 77,81 **** <generator class="native"/> </id> ! <property name="value"/> <list name="list" cascade="all"> <key column="list_po"/> --- 77,81 ---- <generator class="native"/> </id> ! <property name="value" column="value_"/> <list name="list" cascade="all"> <key column="list_po"/> Index: FooBarTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/FooBarTest.java,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** FooBarTest.java 7 May 2003 15:09:06 -0000 1.63 --- FooBarTest.java 13 May 2003 10:50:43 -0000 1.64 *************** *** 60,63 **** --- 60,89 ---- } + public void testManyToManyBag() throws Exception { + Session s = sessions.openSession(); + Baz baz = new Baz(); + Serializable id = s.save(baz); + s.flush(); + s.connection().commit(); + s.close(); + + s = sessions.openSession(); + baz = (Baz) s.load(Baz.class, id); + baz.getFooBag().add( new Foo() ); + s.flush(); + s.connection().commit(); + s.close(); + + s = sessions.openSession(); + baz = (Baz) s.load(Baz.class, id); + assertTrue( !Hibernate.isInitialized( baz.getFooBag() ) ); + assertTrue( baz.getFooBag().size()==1 ); + assertTrue( Hibernate.isInitialized( baz.getFooBag().iterator().next() ) ); + s.delete(baz); + s.flush(); + s.connection().commit(); + s.close(); + } + public void testIdBag() throws Exception { Session s = sessions.openSession(); *************** *** 255,259 **** Query q = s.createQuery("select bar, b from Bar bar left join bar.baz baz left join baz.cascadingBars b where bar.name like 'Bar%'"); list = q.list(); ! assertTrue( list.size()==2 ); q = s.createQuery("select bar, b from Bar bar left join bar.baz baz left join baz.cascadingBars b where ( bar.name in (:nameList) or bar.name in (:nameList) ) and bar.string = :stringVal"); --- 281,285 ---- Query q = s.createQuery("select bar, b from Bar bar left join bar.baz baz left join baz.cascadingBars b where bar.name like 'Bar%'"); list = q.list(); ! if ( !(dialect instanceof SAPDBDialect) ) assertTrue( list.size()==2 ); q = s.createQuery("select bar, b from Bar bar left join bar.baz baz left join baz.cascadingBars b where ( bar.name in (:nameList) or bar.name in (:nameList) ) and bar.string = :stringVal"); *************** *** 265,269 **** q.setParameter("stringVal", "a string"); list = q.list(); ! assertTrue( list.size()==2 ); q = s.createQuery("select bar, b from Bar bar inner join bar.baz baz inner join baz.cascadingBars b where bar.name like 'Bar%'"); --- 291,295 ---- q.setParameter("stringVal", "a string"); list = q.list(); ! if ( !(dialect instanceof SAPDBDialect) ) assertTrue( list.size()==2 ); q = s.createQuery("select bar, b from Bar bar inner join bar.baz baz inner join baz.cascadingBars b where bar.name like 'Bar%'"); *************** *** 2597,2601 **** --- 2623,2634 ---- s.connection().commit(); s.close(); + + s = sessions.openSession(); + one = (One) s.load( One.class, new Long( one.getKey() ) ); + one.getManies().size(); + s.connection().commit(); + s.close(); + s = sessions.openSession(); many = (Many) s.load( Many.class, new Long( many.getKey() ) ); |
From: <one...@us...> - 2003-05-13 10:22:07
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg In directory sc8-pr-cvs1:/tmp/cvs-serv1421/cfg Modified Files: Binder.java Log Message: disabled unnecessary index creation Index: Binder.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg/Binder.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Binder.java 2 May 2003 09:18:11 -0000 1.17 --- Binder.java 13 May 2003 10:22:04 -0000 1.18 *************** *** 997,1001 **** } ! if (! model.isInverse() ) { if ( !model.isOneToMany() ) model.getElement().createForeignKey(); // no foreign key for a one-to-many --- 997,1001 ---- } ! if ( !model.isInverse() ) { if ( !model.isOneToMany() ) model.getElement().createForeignKey(); // no foreign key for a one-to-many *************** *** 1003,1008 **** model.getKey().createForeignKeyOfClass( model.getOwner().getPersistentClass() ); } - - if ( !model.isIndexed() ) model.createIndex(); } --- 1003,1006 ---- |
From: <one...@us...> - 2003-05-13 10:22:07
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping In directory sc8-pr-cvs1:/tmp/cvs-serv1421/mapping Modified Files: Collection.java Log Message: disabled unnecessary index creation Index: Collection.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Collection.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Collection.java 2 May 2003 09:16:14 -0000 1.14 --- Collection.java 13 May 2003 10:22:04 -0000 1.15 *************** *** 3,7 **** import java.util.Comparator; - import java.util.Iterator; import net.sf.hibernate.cache.CacheConcurrencyStrategy; --- 3,6 ---- *************** *** 88,99 **** return oneToMany; } - public Index createIndex() { - String name = "IX" + table.uniqueColumnString( getKey().getColumnIterator() ); - Index index = table.getIndex(name); - Iterator iter = getKey().getColumnIterator(); - while ( iter.hasNext() ) index.addColumn( (Column) iter.next() ); - return index; - } - // public abstract void createPrimaryKey(); public CacheConcurrencyStrategy getCache() { --- 87,90 ---- |
From: <one...@us...> - 2003-05-11 08:30:16
|
Update of /cvsroot/hibernate/Hibernate2 In directory sc8-pr-cvs1:/tmp/cvs-serv18766 Modified Files: changelog.txt build.xml Log Message: minor change Index: changelog.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/changelog.txt,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** changelog.txt 11 May 2003 02:31:17 -0000 1.22 --- changelog.txt 11 May 2003 08:30:13 -0000 1.23 *************** *** 26,30 **** * deprecated "object" type in favor of <any> mappings * added Session.contains() ! * added extra DBCP config options (?) * SessionFactory.close() now unbinds from JNDI * added Session.evict() --- 26,30 ---- * deprecated "object" type in favor of <any> mappings * added Session.contains() ! * added extra DBCP config options (Alex Burgel) * SessionFactory.close() now unbinds from JNDI * added Session.evict() Index: build.xml =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/build.xml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** build.xml 10 May 2003 09:59:11 -0000 1.15 --- build.xml 11 May 2003 08:30:13 -0000 1.16 *************** *** 166,170 **** <javadoc sourcepath="${src.dir}" ! packagenames="net.sf.hibernate,net.sf.hibernate.expression,net.sf.hibernate.id,net.sf.hibernate.connection,net.sf.hibernate.transaction,net.sf.hibernate.type,net.sf.hibernate.dialect,net.sf.hibernate.odmg,net.sf.hibernate.cfg,net.sf.hibernate.cache,net.sf.hibernate.jmx,net.sf.hibernate.loader,net.sf.hibernate.persister,net.sf.hibernate.engine,net.sf.hibernate.metadata,net.sf.hibernate.mapping" classpathref="lib.class.path" destdir="${dist.api.dir}" --- 166,170 ---- <javadoc sourcepath="${src.dir}" ! packagenames="net.sf.hibernate,net.sf.hibernate.expression,net.sf.hibernate.id,net.sf.hibernate.connection,net.sf.hibernate.transaction,net.sf.hibernate.type,net.sf.hibernate.dialect,net.sf.hibernate.odmg,net.sf.hibernate.cfg,net.sf.hibernate.cache,net.sf.hibernate.jmx,net.sf.hibernate.jca,net.sf.hibernate.loader,net.sf.hibernate.persister,net.sf.hibernate.engine,net.sf.hibernate.metadata,net.sf.hibernate.mapping,net.sf.hibernate.collection" classpathref="lib.class.path" destdir="${dist.api.dir}" *************** *** 179,184 **** <group title="Core API" packages="net.sf.hibernate:net.sf.hibernate.expression:net.sf.hibernate.metadata:net.sf.hibernate.cfg"/> ! <group title="Extension API" packages="net.sf.hibernate.id:net.sf.hibernate.connection:net.sf.hibernate.transaction:net.sf.hibernate.type:net.sf.hibernate.dialect:net.sf.hibernate.cache:net.sf.hibernate.loader:net.sf.hibernate.persister:net.sf.hibernate.engine"/> ! <group title="Miscellaneous API" packages="net.sf.hibernate.odmg:net.sf.hibernate.jmx:net.sf.hibernate.mapping"/> </javadoc> --- 179,184 ---- <group title="Core API" packages="net.sf.hibernate:net.sf.hibernate.expression:net.sf.hibernate.metadata:net.sf.hibernate.cfg"/> ! <group title="Extension API" packages="net.sf.hibernate.id:net.sf.hibernate.connection:net.sf.hibernate.transaction:net.sf.hibernate.type:net.sf.hibernate.dialect:net.sf.hibernate.cache:net.sf.hibernate.loader:net.sf.hibernate.persister:net.sf.hibernate.engine:net.sf.hibernate.collection"/> ! <group title="Miscellaneous API" packages="net.sf.hibernate.odmg:net.sf.hibernate.jmx:net.sf.hibernate.jca:net.sf.hibernate.mapping"/> </javadoc> |
From: <one...@us...> - 2003-05-11 02:31:20
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv8367/src/net/sf/hibernate/impl Modified Files: SessionImpl.java Log Message: fixed an npe in evict() Index: SessionImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionImpl.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** SessionImpl.java 10 May 2003 09:59:12 -0000 1.43 --- SessionImpl.java 11 May 2003 02:31:17 -0000 1.44 *************** *** 3057,3061 **** private void evictCollections(Object[] values, Type[] types) throws HibernateException { for ( int i=0; i<types.length; i++ ) { ! if ( types[i].isPersistentCollectionType() ) { Object pc=null; if ( ( (PersistentCollectionType) types[i] ).isArrayType() ) { --- 3057,3064 ---- private void evictCollections(Object[] values, Type[] types) throws HibernateException { for ( int i=0; i<types.length; i++ ) { ! if ( values[i]==null ) { ! //do nothing ! } ! else if ( types[i].isPersistentCollectionType() ) { Object pc=null; if ( ( (PersistentCollectionType) types[i] ).isArrayType() ) { |
From: <one...@us...> - 2003-05-11 02:31:19
|
Update of /cvsroot/hibernate/Hibernate2 In directory sc8-pr-cvs1:/tmp/cvs-serv8367 Modified Files: changelog.txt Log Message: fixed an npe in evict() Index: changelog.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/changelog.txt,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** changelog.txt 10 May 2003 13:25:05 -0000 1.21 --- changelog.txt 11 May 2003 02:31:17 -0000 1.22 *************** *** 1,4 **** --- 1,8 ---- Hibernate Changelog =================== + Changes in version 2.0 final (xx.5.2003) + ---------------------------------------- + * fixed an NPE in Session.evict() (Simon Spero) + Changes in version 2.0 beta 6 (10.5.2003) ----------------------------------------- |
From: <one...@us...> - 2003-05-10 13:32:48
|
Update of /cvsroot/hibernate/Hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv23341 Modified Files: changelog.txt Log Message: v 1.2.5 Index: changelog.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate/changelog.txt,v retrieving revision 1.300 retrieving revision 1.301 diff -C2 -d -r1.300 -r1.301 *** changelog.txt 22 Mar 2003 13:42:35 -0000 1.300 --- changelog.txt 10 May 2003 13:32:41 -0000 1.301 *************** *** 1,6 **** Hibernate Changelog =================== ! Changes in version 1.2.4 ! ------------------------ * fixed an exception that occurred wrapping collections with sort="MyComparator" (Jason Horne) * mutable="false" objects are now never updated --- 1,11 ---- Hibernate Changelog =================== ! Changes in version 1.2.5 (10.5.2003) ! ------------------------------------ ! * fixed a nonthreadsafe Map access in session factory ! * fixed a bug in Query.setParameterList() (Nick Heudecker) ! ! Changes in version 1.2.4 (22.3.2003) ! ------------------------------------ * fixed an exception that occurred wrapping collections with sort="MyComparator" (Jason Horne) * mutable="false" objects are now never updated |