Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv23158/src/net/sf/hibernate/impl Modified Files: BatcherImpl.java BatchingBatcher.java CacheEntry.java DatastoreImpl.java FilterImpl.java IteratorImpl.java NonBatchingBatcher.java QueryImpl.java ScheduledCollectionAction.java ScheduledCollectionRecreate.java ScheduledCollectionRemove.java ScheduledCollectionUpdate.java ScheduledDeletion.java ScheduledEntityAction.java ScheduledInsertion.java ScheduledUpdate.java ScrollableResultsImpl.java SessionFactoryImpl.java SessionFactoryObjectFactory.java SessionImpl.java Log Message: added Session.refresh() revised some javadoc new javadoc style consistent with website colors Index: BatcherImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/BatcherImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BatcherImpl.java 4 Jan 2003 11:15:28 -0000 1.2 --- BatcherImpl.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 119,120 **** --- 119,123 ---- + + + Index: BatchingBatcher.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/BatchingBatcher.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BatchingBatcher.java 4 Jan 2003 11:15:29 -0000 1.2 --- BatchingBatcher.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 75,76 **** --- 75,79 ---- + + + Index: CacheEntry.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/CacheEntry.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CacheEntry.java 4 Jan 2003 11:15:29 -0000 1.2 --- CacheEntry.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 67,68 **** --- 67,71 ---- + + + Index: DatastoreImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/DatastoreImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DatastoreImpl.java 4 Jan 2003 11:15:29 -0000 1.2 --- DatastoreImpl.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 408,409 **** --- 408,412 ---- + + + Index: FilterImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/FilterImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FilterImpl.java 4 Jan 2003 11:15:29 -0000 1.3 --- FilterImpl.java 5 Jan 2003 02:11:21 -0000 1.4 *************** *** 52,53 **** --- 52,56 ---- + + + Index: IteratorImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/IteratorImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IteratorImpl.java 4 Jan 2003 11:15:29 -0000 1.2 --- IteratorImpl.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 94,95 **** --- 94,98 ---- + + + Index: NonBatchingBatcher.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/NonBatchingBatcher.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NonBatchingBatcher.java 4 Jan 2003 11:15:29 -0000 1.2 --- NonBatchingBatcher.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 31,32 **** --- 31,35 ---- + + + Index: QueryImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/QueryImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** QueryImpl.java 4 Jan 2003 11:15:29 -0000 1.3 --- QueryImpl.java 5 Jan 2003 02:11:21 -0000 1.4 *************** *** 348,349 **** --- 348,352 ---- + + + Index: ScheduledCollectionAction.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScheduledCollectionAction.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ScheduledCollectionAction.java 4 Jan 2003 11:15:29 -0000 1.3 --- ScheduledCollectionAction.java 5 Jan 2003 02:11:21 -0000 1.4 *************** *** 42,43 **** --- 42,46 ---- + + + Index: ScheduledCollectionRecreate.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScheduledCollectionRecreate.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ScheduledCollectionRecreate.java 4 Jan 2003 11:15:29 -0000 1.3 --- ScheduledCollectionRecreate.java 5 Jan 2003 02:11:21 -0000 1.4 *************** *** 28,29 **** --- 28,32 ---- + + + Index: ScheduledCollectionRemove.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScheduledCollectionRemove.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ScheduledCollectionRemove.java 4 Jan 2003 11:15:29 -0000 1.3 --- ScheduledCollectionRemove.java 5 Jan 2003 02:11:21 -0000 1.4 *************** *** 25,26 **** --- 25,29 ---- + + + Index: ScheduledCollectionUpdate.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScheduledCollectionUpdate.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ScheduledCollectionUpdate.java 4 Jan 2003 11:15:29 -0000 1.3 --- ScheduledCollectionUpdate.java 5 Jan 2003 02:11:21 -0000 1.4 *************** *** 39,40 **** --- 39,43 ---- + + + Index: ScheduledDeletion.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScheduledDeletion.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ScheduledDeletion.java 4 Jan 2003 11:15:29 -0000 1.2 --- ScheduledDeletion.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 33,34 **** --- 33,37 ---- + + + Index: ScheduledEntityAction.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScheduledEntityAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ScheduledEntityAction.java 4 Jan 2003 11:15:29 -0000 1.2 --- ScheduledEntityAction.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 42,43 **** --- 42,46 ---- + + + Index: ScheduledInsertion.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScheduledInsertion.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ScheduledInsertion.java 4 Jan 2003 11:15:29 -0000 1.2 --- ScheduledInsertion.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 32,33 **** --- 32,36 ---- + + + Index: ScheduledUpdate.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScheduledUpdate.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ScheduledUpdate.java 4 Jan 2003 11:15:29 -0000 1.2 --- ScheduledUpdate.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 37,38 **** --- 37,41 ---- + + + Index: ScrollableResultsImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScrollableResultsImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ScrollableResultsImpl.java 4 Jan 2003 11:15:29 -0000 1.2 --- ScrollableResultsImpl.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 256,257 **** --- 256,260 ---- + + + Index: SessionFactoryImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionFactoryImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SessionFactoryImpl.java 4 Jan 2003 11:15:29 -0000 1.3 --- SessionFactoryImpl.java 5 Jan 2003 02:11:21 -0000 1.4 *************** *** 641,642 **** --- 641,645 ---- + + + Index: SessionFactoryObjectFactory.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionFactoryObjectFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SessionFactoryObjectFactory.java 4 Jan 2003 11:15:29 -0000 1.2 --- SessionFactoryObjectFactory.java 5 Jan 2003 02:11:21 -0000 1.3 *************** *** 142,143 **** --- 142,146 ---- + + + Index: SessionImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SessionImpl.java 4 Jan 2003 11:15:29 -0000 1.5 --- SessionImpl.java 5 Jan 2003 02:11:21 -0000 1.6 *************** *** 440,443 **** --- 440,446 ---- return entitiesByKey.get(key); } + private Object removeEntity(Key key) { + return entitiesByKey.remove(key); + } private EntityEntry addEntry( *************** *** 460,463 **** --- 463,470 ---- } + private EntityEntry removeEntry(Object object) { + return (EntityEntry) entries.remove(object); + } + private boolean isEntryFor(Object object) { return entries.containsKey(object); *************** *** 1168,1175 **** } - public void lock(Object object) throws SQLException, HibernateException { - lock(object, LockMode.UPGRADE); - } - public void lock(Object object, LockMode lockMode) throws SQLException, HibernateException { --- 1175,1178 ---- *************** *** 1558,1561 **** --- 1561,1578 ---- } + public void refresh(Object object) throws SQLException, HibernateException { + + if (object==null) throw new NullPointerException("attempted to refresh null"); + + object = HibernateProxyHelper.unproxy(object, this); + EntityEntry e = removeEntry(object); + + if ( !e.existsInDatabase ) throw new HibernateException("this instance does not yet exist as a row in the database"); + + removeEntity( new Key(e.id, e.persister) ); + e.persister.load( e.id, object, LockMode.READ, this); + getEntry(object).lockMode = e.lockMode; + } + public void initializeEntity(Object object) throws HibernateException, SQLException { *************** *** 2549,2552 **** --- 2566,2572 ---- } + + + |