From: <one...@us...> - 2003-01-04 11:16:02
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine In directory sc8-pr-cvs1:/tmp/cvs-serv14211/src/net/sf/hibernate/engine Modified Files: Batcher.java Cascades.java Key.java Mapping.java RowSelection.java SessionFactoryImplementor.java SessionImplementor.java TypedValue.java Versioning.java Log Message: reformatted code with beautiful, shiny, happy TABS! improved an exception Index: Batcher.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/Batcher.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Batcher.java 1 Jan 2003 13:54:20 -0000 1.1.1.1 --- Batcher.java 4 Jan 2003 11:15:28 -0000 1.2 *************** *** 28,32 **** /** ! * Get a non-batchable prepared statement to use for inserting / deleting / updating. * Must be explicitly released by <tt>closeStatement()</tt> */ --- 28,32 ---- /** ! * Get a non-batchable prepared statement to use for inserting / deleting / updating. * Must be explicitly released by <tt>closeStatement()</tt> */ *************** *** 59,62 **** */ public void closeStatements(); ! } --- 59,65 ---- */ public void closeStatements(); ! } + + + Index: Cascades.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/Cascades.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Cascades.java 3 Jan 2003 13:36:00 -0000 1.2 --- Cascades.java 4 Jan 2003 11:15:28 -0000 1.3 *************** *** 21,32 **** import net.sf.hibernate.type.Type; ! /** * Implements cascaded save / delete / update * @see net.sf.hibernate.type.AssociationType */ public final class Cascades { ! private static final Log log = LogFactory.getLog(Cascades.class); ! // The available cascade actions: --- 21,32 ---- import net.sf.hibernate.type.Type; ! /** * Implements cascaded save / delete / update * @see net.sf.hibernate.type.AssociationType */ public final class Cascades { ! private static final Log log = LogFactory.getLog(Cascades.class); ! // The available cascade actions: *************** *** 55,62 **** } boolean shouldCascadeCollection(Object collection) { ! return true; ! } ! }; ! /** * @see net.sf.hibernate.Session#saveOrUpdate(Object) --- 55,62 ---- } boolean shouldCascadeCollection(Object collection) { ! return true; ! } ! }; ! /** * @see net.sf.hibernate.Session#saveOrUpdate(Object) *************** *** 78,96 **** } }; ! // The types of children to cascade to: /** ! * A cascade point that occurs just after the insertion of the parent entity and * just before deletion */ public static final int CASCADE_AFTER_INSERT_BEFORE_DELETE = 1; /** ! * A cascade point that occurs just before the insertion of the parent entity and * just after deletion */ public static final int CASCADE_BEFORE_INSERT_AFTER_DELETE = 2; /** ! * A cascade point that occurs just after the insertion of the parent entity and * just before deletion, inside a collection */ --- 78,96 ---- } }; ! // The types of children to cascade to: /** ! * A cascade point that occurs just after the insertion of the parent entity and * just before deletion */ public static final int CASCADE_AFTER_INSERT_BEFORE_DELETE = 1; /** ! * A cascade point that occurs just before the insertion of the parent entity and * just after deletion */ public static final int CASCADE_BEFORE_INSERT_AFTER_DELETE = 2; /** ! * A cascade point that occurs just after the insertion of the parent entity and * just before deletion, inside a collection */ *************** *** 102,106 **** // The allowable cascade styles for a property: ! /** * A style of cascade that can be specified by the mapping for an association. --- 102,106 ---- // The allowable cascade styles for a property: ! /** * A style of cascade that can be specified by the mapping for an association. *************** *** 180,186 **** public static final IdentifierValue SAVE_ANY = new IdentifierValue() { public final boolean isUnsaved(Serializable id) { ! return true; ! } ! }; /** * Never assume the transient instance is newly instantiated --- 180,186 ---- public static final IdentifierValue SAVE_ANY = new IdentifierValue() { public final boolean isUnsaved(Serializable id) { ! return true; ! } ! }; /** * Never assume the transient instance is newly instantiated *************** *** 188,194 **** public static final IdentifierValue SAVE_NONE = new IdentifierValue() { public final boolean isUnsaved(Serializable id) { ! return false; ! } ! }; /** * Assume the transient instance is newly instantiated if the identifier --- 188,194 ---- public static final IdentifierValue SAVE_NONE = new IdentifierValue() { public final boolean isUnsaved(Serializable id) { ! return false; ! } ! }; /** * Assume the transient instance is newly instantiated if the identifier *************** *** 197,207 **** public static final IdentifierValue SAVE_NULL = new IdentifierValue() { public final boolean isUnsaved(Serializable id) { ! return id==null; ! } ! }; ! ! /** ! * Cascade an action to the child ! */ private static void cascade(SessionImplementor session, Object child, Type type, CascadingAction action, int cascadeTo) throws SQLException, HibernateException { if (child!=null) { --- 197,207 ---- public static final IdentifierValue SAVE_NULL = new IdentifierValue() { public final boolean isUnsaved(Serializable id) { ! return id==null; ! } ! }; ! ! /** ! * Cascade an action to the child ! */ private static void cascade(SessionImplementor session, Object child, Type type, CascadingAction action, int cascadeTo) throws SQLException, HibernateException { if (child!=null) { *************** *** 271,280 **** for ( int i=0; i<types.length; i++) { if ( cascadeStyles[i].doCascade(action) ) ! cascade( session, persister.getPropertyValue(parent,i), types[i], action, cascadeTo ); } if ( log.isTraceEnabled() ) log.trace( "done processing cascades for: " + persister.getClassName() ); } } ! } --- 271,283 ---- for ( int i=0; i<types.length; i++) { if ( cascadeStyles[i].doCascade(action) ) ! cascade( session, persister.getPropertyValue(parent,i), types[i], action, cascadeTo ); } if ( log.isTraceEnabled() ) log.trace( "done processing cascades for: " + persister.getClassName() ); } } ! } + + + Index: Key.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/Key.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Key.java 3 Jan 2003 13:36:00 -0000 1.2 --- Key.java 4 Jan 2003 11:15:28 -0000 1.3 *************** *** 9,13 **** /** ! * A globally unique identifier of an instance, consisting of the * user-visible identifier and the identifier space (eg. tablename). */ --- 9,13 ---- /** ! * A globally unique identifier of an instance, consisting of the * user-visible identifier and the identifier space (eg. tablename). */ *************** *** 15,19 **** private final Serializable id; private final Serializable identifierSpace; ! private Key(Serializable id, Serializable identifierSpace) { if (id==null) throw new AssertionFailure("null identifier"); --- 15,19 ---- private final Serializable id; private final Serializable identifierSpace; ! private Key(Serializable id, Serializable identifierSpace) { if (id==null) throw new AssertionFailure("null identifier"); *************** *** 47,51 **** return otherKey.identifierSpace.equals(this.identifierSpace) && otherKey.id.equals(this.id); } ! public int hashCode() { return id.hashCode(); } } --- 47,54 ---- return otherKey.identifierSpace.equals(this.identifierSpace) && otherKey.id.equals(this.id); } ! public int hashCode() { return id.hashCode(); } } + + + Index: Mapping.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/Mapping.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Mapping.java 1 Jan 2003 13:54:22 -0000 1.1.1.1 --- Mapping.java 4 Jan 2003 11:15:28 -0000 1.2 *************** *** 17,18 **** --- 17,21 ---- } + + + Index: RowSelection.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/RowSelection.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RowSelection.java 3 Jan 2003 13:36:00 -0000 1.1 --- RowSelection.java 4 Jan 2003 11:15:28 -0000 1.2 *************** *** 6,32 **** private Integer maxRows; private Integer timeout; ! public void setFirstRow(Integer firstRow) { this.firstRow = firstRow; } ! public Integer getFirstRow() { return firstRow; } ! public void setMaxRows(Integer maxRows) { this.maxRows = maxRows; } ! public Integer getMaxRows() { return maxRows; } ! public void setTimeout(Integer timeout) { this.timeout = timeout; } ! public Integer getTimeout() { return timeout; } ! } \ No newline at end of file --- 6,34 ---- private Integer maxRows; private Integer timeout; ! public void setFirstRow(Integer firstRow) { this.firstRow = firstRow; } ! public Integer getFirstRow() { return firstRow; } ! public void setMaxRows(Integer maxRows) { this.maxRows = maxRows; } ! public Integer getMaxRows() { return maxRows; } ! public void setTimeout(Integer timeout) { this.timeout = timeout; } ! public Integer getTimeout() { return timeout; } ! } ! ! Index: SessionFactoryImplementor.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/SessionFactoryImplementor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SessionFactoryImplementor.java 3 Jan 2003 13:36:00 -0000 1.2 --- SessionFactoryImplementor.java 4 Jan 2003 11:15:28 -0000 1.3 *************** *** 14,18 **** import net.sf.hibernate.type.Type; ! /** * Defines the internal contract between the <tt>SessionFactory</tt> and other parts of * Hibernate such as implementors of <tt>Type</tt>. --- 14,18 ---- import net.sf.hibernate.type.Type; ! /** * Defines the internal contract between the <tt>SessionFactory</tt> and other parts of * Hibernate such as implementors of <tt>Type</tt>. *************** *** 51,55 **** */ public Dialect getDialect(); ! /** * Get the return types of a query --- 51,55 ---- */ public Dialect getDialect(); ! /** * Get the return types of a query *************** *** 61,65 **** * @return a collection of strings */ ! public Collection getNamedParameters(String queryString) throws HibernateException; /** * Obtain a JDBC connection --- 61,65 ---- * @return a collection of strings */ ! public Collection getNamedParameters(String queryString) throws HibernateException; /** * Obtain a JDBC connection *************** *** 99,100 **** --- 99,103 ---- public void setFetchSize(PreparedStatement statement) throws SQLException; } + + + Index: SessionImplementor.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/SessionImplementor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SessionImplementor.java 3 Jan 2003 13:36:00 -0000 1.2 --- SessionImplementor.java 4 Jan 2003 11:15:28 -0000 1.3 *************** *** 20,24 **** ! /** * Defines the internal contract between the <tt>Session</tt> and other parts of * Hibernate such as implementors of <tt>Type</tt> or <tt>ClassPersister</tt>. --- 20,24 ---- ! /** * Defines the internal contract between the <tt>Session</tt> and other parts of * Hibernate such as implementors of <tt>Type</tt> or <tt>ClassPersister</tt>. *************** *** 27,31 **** */ public interface SessionImplementor extends Session { ! /** * Get the pre-flush identifier of the collection --- 27,31 ---- */ public interface SessionImplementor extends Session { ! /** * Get the pre-flush identifier of the collection *************** *** 40,44 **** * Get the <tt>PersistentCollection</tt> object for an array */ ! public ArrayHolder getArrayHolder(Object array); /** * Register a <tt>PersistentCollection</tt> object for an array --- 40,44 ---- * Get the <tt>PersistentCollection</tt> object for an array */ ! public ArrayHolder getArrayHolder(Object array); /** * Register a <tt>PersistentCollection</tt> object for an array *************** *** 54,58 **** public void addInitializedCollection(PersistentCollection collection, CollectionPersister persister, Serializable id) throws HibernateException; /** ! * Set the "shallow dirty" status of the collection. Called when the collection detects that the * client is modifying it */ --- 54,58 ---- public void addInitializedCollection(PersistentCollection collection, CollectionPersister persister, Serializable id) throws HibernateException; /** ! * Set the "shallow dirty" status of the collection. Called when the collection detects that the * client is modifying it */ *************** *** 81,85 **** */ public Object immediateLoad(Class persistentClass, Serializable id) throws SQLException, HibernateException; ! /** * System time before the start of the transaction --- 81,85 ---- */ public Object immediateLoad(Class persistentClass, Serializable id) throws SQLException, HibernateException; ! /** * System time before the start of the transaction *************** *** 101,113 **** public void postInsert(Object object); /** ! * After actually deleting a row, record the fact that the instance no longer exists on the * database (needed for identity-column key generation) */ public void postDelete(Object object); ! /** * Execute a <tt>find()</tt> query */ ! public List find(String query, Object[] values, Type[] types, RowSelection selection, Map namedParams) throws SQLException, HibernateException; /** * Execute an <tt>iterate()</tt> query --- 101,113 ---- public void postInsert(Object object); /** ! * After actually deleting a row, record the fact that the instance no longer exists on the * database (needed for identity-column key generation) */ public void postDelete(Object object); ! /** * Execute a <tt>find()</tt> query */ ! public List find(String query, Object[] values, Type[] types, RowSelection selection, Map namedParams) throws SQLException, HibernateException; /** * Execute an <tt>iterate()</tt> query *************** *** 131,135 **** */ public ClassPersister getPersister(Object object) throws MappingException; ! /** * Add an uninitialized instance of an entity class, as a placeholder to ensure object identity. --- 131,135 ---- */ public ClassPersister getPersister(Object object) throws MappingException; ! /** * Add an uninitialized instance of an entity class, as a placeholder to ensure object identity. *************** *** 151,155 **** public Object getEntity(Key key); /** ! * Return the existing proxy associated with the given <tt>Key</tt>, or the * second argument (the entity associated with the key) if no proxy exists. */ --- 151,155 ---- public Object getEntity(Key key); /** ! * Return the existing proxy associated with the given <tt>Key</tt>, or the * second argument (the entity associated with the key) if no proxy exists. */ *************** *** 157,161 **** /** ! * Notify the session that the transaction completed, so we no longer * own the old locks. (Also we should release cache softlocks.) */ --- 157,161 ---- /** ! * Notify the session that the transaction completed, so we no longer * own the old locks. (Also we should release cache softlocks.) */ *************** *** 168,170 **** --- 168,173 ---- } + + + Index: TypedValue.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/TypedValue.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TypedValue.java 3 Jan 2003 13:36:00 -0000 1.1 --- TypedValue.java 4 Jan 2003 11:15:28 -0000 1.2 *************** *** 8,31 **** private Type type; private Object value; ! public TypedValue(Type t, Object o) { setType(t); value=o; } ! public void setValue(Object value) { this.value = value; } ! public Object getValue() { return value; } ! public void setType(Type type) { this.type = type; } ! public Type getType() { return type; } - } \ No newline at end of file --- 8,33 ---- private Type type; private Object value; ! public TypedValue(Type t, Object o) { setType(t); value=o; } ! public void setValue(Object value) { this.value = value; } ! public Object getValue() { return value; } ! public void setType(Type type) { this.type = type; } ! public Type getType() { return type; } + + } + Index: Versioning.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/engine/Versioning.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Versioning.java 1 Jan 2003 13:54:23 -0000 1.1.1.1 --- Versioning.java 4 Jan 2003 11:15:28 -0000 1.2 *************** *** 68,71 **** return persister.isVersioned() ? getVersion( fields, persister.getVersionProperty(), persister.getVersionType() ) : null; } ! } --- 68,74 ---- return persister.isVersioned() ? getVersion( fields, persister.getVersionProperty(), persister.getVersionType() ) : null; } ! } + + + |