From: <one...@us...> - 2003-01-28 10:22:24
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv26035/sf/hibernate/impl Modified Files: SessionImpl.java Log Message: renamed 'mutable' to 'update' added 'insert' attribute removed old dtds Index: SessionImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionImpl.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** SessionImpl.java 24 Jan 2003 16:15:55 -0000 1.13 --- SessionImpl.java 28 Jan 2003 10:22:19 -0000 1.14 *************** *** 617,621 **** } ! TypeFactory.deepCopy(values, types, persister.getPropertyMutability(), values); nullifyTransientReferences(values, types, identityCol, object); --- 617,621 ---- } ! TypeFactory.deepCopy(values, types, persister.getPropertyUpdateability(), values); nullifyTransientReferences(values, types, identityCol, object); *************** *** 817,821 **** else { entry.deletedState = new Object[entry.loadedState.length]; ! TypeFactory.deepCopy(entry.loadedState, propTypes, persister.getPropertyMutability(), entry.deletedState); } --- 817,821 ---- else { entry.deletedState = new Object[entry.loadedState.length]; ! TypeFactory.deepCopy(entry.loadedState, propTypes, persister.getPropertyUpdateability(), entry.deletedState); } *************** *** 1311,1314 **** --- 1311,1320 ---- } + public Object instantiate(ClassPersister persister, Serializable id) throws HibernateException { + Object result = interceptor.instantiate( persister.getMappedClass(), id ); + if (result==null) result = persister.instantiate(id); + return result; + } + public void setFlushMode(FlushMode flushMode) { this.flushMode = flushMode; *************** *** 1626,1630 **** if (entry!=null) { ClassPersister subclassPersister = getPersister( entry.getSubclass() ); ! Object result = (isOptionalObject) ? optionalObject : subclassPersister.instantiate(id); addEntry(result, LOADING, null, id, null, LockMode.NONE, true, subclassPersister); //make it circular-reference safe addEntity( new Key(id, persister), result ); --- 1632,1636 ---- if (entry!=null) { ClassPersister subclassPersister = getPersister( entry.getSubclass() ); ! Object result = (isOptionalObject) ? optionalObject : instantiate(subclassPersister, id); addEntry(result, LOADING, null, id, null, LockMode.NONE, true, subclassPersister); //make it circular-reference safe addEntity( new Key(id, persister), result ); *************** *** 1637,1641 **** } Type[] types = subclassPersister.getPropertyTypes(); ! TypeFactory.deepCopy(values, types, subclassPersister.getPropertyMutability(), values); Object version = Versioning.getVersion(values, subclassPersister); if ( log.isTraceEnabled() ) log.trace("Cached Version: " + version); --- 1643,1647 ---- } Type[] types = subclassPersister.getPropertyTypes(); ! TypeFactory.deepCopy(values, types, subclassPersister.getPropertyUpdateability(), values); Object version = Versioning.getVersion(values, subclassPersister); if ( log.isTraceEnabled() ) log.trace("Cached Version: " + version); *************** *** 1695,1699 **** for ( int i=0; i<hydratedState.length; i++ ) hydratedState[i] = types[i].resolveIdentifier( hydratedState[i], this ); persister.setPropertyValues(object, hydratedState); ! TypeFactory.deepCopy(hydratedState, persister.getPropertyTypes(), persister.getPropertyMutability(), hydratedState); //after setting values to object if ( persister.hasCache() ) --- 1701,1705 ---- for ( int i=0; i<hydratedState.length; i++ ) hydratedState[i] = types[i].resolveIdentifier( hydratedState[i], this ); persister.setPropertyValues(object, hydratedState); ! TypeFactory.deepCopy(hydratedState, persister.getPropertyTypes(), persister.getPropertyUpdateability(), hydratedState); //after setting values to object if ( persister.hasCache() ) *************** *** 1886,1902 **** boolean substitute = wrap(values, types); // substitutes into values by side-effect ! boolean noCleanState = entry.loadedState==null; // object loaded by update() ! final int[] dirtyProperties; ! if (!noCleanState) { ! dirtyProperties = persister.findDirty(values, entry.loadedState, object, this); } else { ! dirtyProperties = null; } ! // compare to cached state (ignoring nested collections) if ( ! noCleanState || ! (dirtyProperties!=null) || ( status==LOADED && persister.isVersioned() && --- 1892,1915 ---- boolean substitute = wrap(values, types); // substitutes into values by side-effect ! final boolean cannotDirtyCheck; ! ! int[] dirtyProperties = interceptor.findDirty(object, entry.id, values, entry.loadedState, persister.getPropertyNames(), types); ! ! if (dirtyProperties==null) { ! // Interceptor returned null, so do the dirtycheck ourself, if possible ! cannotDirtyCheck = entry.loadedState==null; // object loaded by update() ! if (!cannotDirtyCheck) { ! dirtyProperties = dirtyProperties = persister.findDirty(values, entry.loadedState, object, this); ! } } else { ! // the Interceptor handled the dirty checking ! cannotDirtyCheck = false; } ! // compare to cached state (ignoring nested collections) if ( ! cannotDirtyCheck || ! (dirtyProperties!=null && dirtyProperties.length!=0 ) || ( status==LOADED && persister.isVersioned() && *************** *** 1917,1921 **** Object[] copiedValues = new Object[values.length]; ! TypeFactory.deepCopy(values, types, persister.getPropertyMutability(), copiedValues); entry.loadedState = copiedValues; // for next time entry.nextLockMode = LockMode.WRITE; // if this flush goes ahead, we will have a write lock --- 1930,1934 ---- Object[] copiedValues = new Object[values.length]; ! TypeFactory.deepCopy(values, types, persister.getPropertyUpdateability(), copiedValues); entry.loadedState = copiedValues; // for next time entry.nextLockMode = LockMode.WRITE; // if this flush goes ahead, we will have a write lock |