From: <one...@us...> - 2003-04-06 10:11:42
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv26833/impl Modified Files: CacheEntry.java SessionImpl.java Log Message: * reworked CompositeUserType * improved some exception handling Index: CacheEntry.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/CacheEntry.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CacheEntry.java 21 Mar 2003 12:03:37 -0000 1.4 --- CacheEntry.java 6 Apr 2003 10:11:09 -0000 1.5 *************** *** 3,7 **** import java.io.Serializable; - import java.sql.SQLException; import net.sf.hibernate.AssertionFailure; --- 3,6 ---- *************** *** 22,26 **** return subclass; } ! public CacheEntry(Object object, ClassPersister persister, SessionImplementor session) throws HibernateException, SQLException { state = disassemble(object, persister, session); subclass = object.getClass(); --- 21,25 ---- return subclass; } ! public CacheEntry(Object object, ClassPersister persister, SessionImplementor session) throws HibernateException { state = disassemble(object, persister, session); subclass = object.getClass(); *************** *** 38,42 **** ! public Object[] assemble(Object instance, Serializable id, ClassPersister persister, SessionImplementor session) throws SQLException, HibernateException { if ( subclass!=persister.getMappedClass() ) throw new AssertionFailure("Tried to assemble a different subclass instance"); --- 37,41 ---- ! public Object[] assemble(Object instance, Serializable id, ClassPersister persister, SessionImplementor session) throws HibernateException { if ( subclass!=persister.getMappedClass() ) throw new AssertionFailure("Tried to assemble a different subclass instance"); *************** *** 46,50 **** } ! private Object[] assemble(Object[] values, Object result, Serializable id, ClassPersister persister, SessionImplementor session) throws HibernateException, SQLException { Type[] propertyTypes = persister.getPropertyTypes(); Object[] assembledProps = new Object[propertyTypes.length]; --- 45,49 ---- } ! private Object[] assemble(Object[] values, Object result, Serializable id, ClassPersister persister, SessionImplementor session) throws HibernateException { Type[] propertyTypes = persister.getPropertyTypes(); Object[] assembledProps = new Object[propertyTypes.length]; Index: SessionImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/SessionImpl.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** SessionImpl.java 6 Apr 2003 02:28:57 -0000 1.32 --- SessionImpl.java 6 Apr 2003 10:11:09 -0000 1.33 *************** *** 1624,1628 **** * or return a new proxy (but do return an existing proxy). Do not check if the object was deleted. */ ! public Object internalLoadOneToOne(Class clazz, Serializable id) throws SQLException, HibernateException { return doLoadByClass(clazz, id, false, false); } --- 1624,1628 ---- * or return a new proxy (but do return an existing proxy). Do not check if the object was deleted. */ ! public Object internalLoadOneToOne(Class clazz, Serializable id) throws HibernateException { return doLoadByClass(clazz, id, false, false); } *************** *** 1632,1636 **** * return a new proxy or return an existing proxy if possible. Do not check if the object was deleted. */ ! public Object internalLoad(Class clazz, Serializable id) throws SQLException, HibernateException { Object result = doLoadByClass(clazz, id, false, true); throwObjectNotFound(result, id, clazz); --- 1632,1636 ---- * return a new proxy or return an existing proxy if possible. Do not check if the object was deleted. */ ! public Object internalLoad(Class clazz, Serializable id) throws HibernateException { Object result = doLoadByClass(clazz, id, false, true); throwObjectNotFound(result, id, clazz); *************** *** 1790,1800 **** addEntry(result, LOADING, null, id, null, LockMode.NONE, true, subclassPersister); //make it circular-reference safe addEntity( new Key(id, persister), result ); ! Object[] values; ! try { ! values = entry.assemble(result, id, subclassPersister, this); // intializes cached by side-effect ! } ! catch (SQLException sqle) { ! throw new JDBCException("Could not reassemble cached object", sqle); ! } Type[] types = subclassPersister.getPropertyTypes(); TypeFactory.deepCopy(values, types, subclassPersister.getPropertyUpdateability(), values); --- 1790,1794 ---- addEntry(result, LOADING, null, id, null, LockMode.NONE, true, subclassPersister); //make it circular-reference safe addEntity( new Key(id, persister), result ); ! Object[] values = entry.assemble(result, id, subclassPersister, this); // intializes cached by side-effect Type[] types = subclassPersister.getPropertyTypes(); TypeFactory.deepCopy(values, types, subclassPersister.getPropertyUpdateability(), values); *************** *** 1853,1857 **** } ! public void initializeEntity(Object object) throws HibernateException, SQLException { EntityEntry e = getEntry(object); --- 1847,1851 ---- } ! public void initializeEntity(Object object) throws HibernateException { EntityEntry e = getEntry(object); *************** *** 2596,2600 **** } ! public void initialize(PersistentCollection collection, boolean writing) throws HibernateException, SQLException { CollectionEntry ce = getCollectionEntry(collection); --- 2590,2594 ---- } ! public void initialize(PersistentCollection collection, boolean writing) throws HibernateException { CollectionEntry ce = getCollectionEntry(collection); *************** *** 2612,2616 **** collection.beforeInitialize(persister); ! persister.getInitializer().initialize(id, collection, owner, this); //tableAccesses.add( ce.loadedPersister.getQualifiedTableName() ); ce.initialized = true; --- 2606,2615 ---- collection.beforeInitialize(persister); ! try { ! persister.getInitializer().initialize(id, collection, owner, this); ! } ! catch (SQLException sqle) { ! throw new JDBCException("SQLException initializing collection", sqle); ! } //tableAccesses.add( ce.loadedPersister.getQualifiedTableName() ); ce.initialized = true; |