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
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv23158/src/net/sf/hibernate Modified Files: AssertionFailure.java CallbackException.java Databinder.java Environment.java FlushMode.java Hibernate.java HibernateException.java InstantiationException.java Interceptor.java LazyInitializationException.java Lifecycle.java LockMode.java MappingException.java ObjectDeletedException.java ObjectNotFoundException.java PersistentEnum.java PersistentObjectException.java PropertyAccessException.java PropertyNotFoundException.java Query.java QueryException.java ScrollableResults.java Session.java SessionFactory.java StaleObjectStateException.java Transaction.java TransactionException.java TransientObjectException.java UserType.java Validatable.java ValidationFailure.java WrongClassException.java Log Message: added Session.refresh() revised some javadoc new javadoc style consistent with website colors Index: AssertionFailure.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/AssertionFailure.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AssertionFailure.java 4 Jan 2003 11:15:27 -0000 1.2 --- AssertionFailure.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 28,29 **** --- 28,32 ---- + + + Index: CallbackException.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/CallbackException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CallbackException.java 4 Jan 2003 11:15:27 -0000 1.2 --- CallbackException.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 26,27 **** --- 26,30 ---- + + + Index: Databinder.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Databinder.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Databinder.java 4 Jan 2003 11:15:27 -0000 1.2 --- Databinder.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 89,90 **** --- 89,93 ---- + + + Index: Environment.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Environment.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Environment.java 4 Jan 2003 11:15:27 -0000 1.2 --- Environment.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 391,392 **** --- 391,395 ---- + + + Index: FlushMode.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/FlushMode.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FlushMode.java 4 Jan 2003 11:15:27 -0000 1.2 --- FlushMode.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 57,58 **** --- 57,61 ---- + + + Index: Hibernate.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Hibernate.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Hibernate.java 4 Jan 2003 11:15:27 -0000 1.2 --- Hibernate.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 235,236 **** --- 235,239 ---- + + + Index: HibernateException.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/HibernateException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HibernateException.java 4 Jan 2003 11:15:27 -0000 1.2 --- HibernateException.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 28,29 **** --- 28,32 ---- + + + Index: InstantiationException.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/InstantiationException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** InstantiationException.java 4 Jan 2003 11:15:27 -0000 1.2 --- InstantiationException.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 28,29 **** --- 28,32 ---- + + + Index: Interceptor.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Interceptor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Interceptor.java 4 Jan 2003 11:15:27 -0000 1.2 --- Interceptor.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 66,67 **** --- 66,70 ---- + + + Index: LazyInitializationException.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/LazyInitializationException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LazyInitializationException.java 4 Jan 2003 11:15:27 -0000 1.2 --- LazyInitializationException.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 38,39 **** --- 38,42 ---- + + + Index: Lifecycle.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Lifecycle.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Lifecycle.java 4 Jan 2003 11:15:27 -0000 1.2 --- Lifecycle.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 89,90 **** --- 89,93 ---- + + + Index: LockMode.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/LockMode.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LockMode.java 4 Jan 2003 11:15:27 -0000 1.2 --- LockMode.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 85,86 **** --- 85,89 ---- + + + Index: MappingException.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/MappingException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MappingException.java 4 Jan 2003 11:15:27 -0000 1.2 --- MappingException.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 25,26 **** --- 25,29 ---- + + + Index: ObjectDeletedException.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/ObjectDeletedException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ObjectDeletedException.java 4 Jan 2003 11:15:27 -0000 1.2 --- ObjectDeletedException.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 29,30 **** --- 29,33 ---- + + + Index: ObjectNotFoundException.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/ObjectNotFoundException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ObjectNotFoundException.java 4 Jan 2003 11:15:27 -0000 1.2 --- ObjectNotFoundException.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 35,36 **** --- 35,39 ---- + + + Index: PersistentEnum.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/PersistentEnum.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PersistentEnum.java 4 Jan 2003 11:15:27 -0000 1.2 --- PersistentEnum.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 18,19 **** --- 18,22 ---- + + + Index: PersistentObjectException.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/PersistentObjectException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PersistentObjectException.java 4 Jan 2003 11:15:27 -0000 1.2 --- PersistentObjectException.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 17,18 **** --- 17,21 ---- + + + Index: PropertyAccessException.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/PropertyAccessException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PropertyAccessException.java 4 Jan 2003 11:15:27 -0000 1.2 --- PropertyAccessException.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 39,40 **** --- 39,43 ---- + + + Index: PropertyNotFoundException.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/PropertyNotFoundException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PropertyNotFoundException.java 4 Jan 2003 11:15:27 -0000 1.2 --- PropertyNotFoundException.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 24,25 **** --- 24,28 ---- + + + Index: Query.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Query.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Query.java 4 Jan 2003 11:15:27 -0000 1.2 --- Query.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 25,28 **** --- 25,29 ---- * <li>the results may be returned as an instance of <tt>ScrollableResults</tt> * </ul> + * <br> * Use of <tt>setFirstResult()</tt> requires that the JDBC driver implement * scrollable result sets.<br> *************** *** 251,254 **** --- 252,258 ---- public void setEnum(String name, Object val) throws MappingException; // use setParameter for null values } + + + Index: QueryException.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/QueryException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** QueryException.java 4 Jan 2003 11:15:27 -0000 1.2 --- QueryException.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 36,37 **** --- 36,40 ---- + + + Index: ScrollableResults.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/ScrollableResults.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ScrollableResults.java 4 Jan 2003 11:15:27 -0000 1.2 --- ScrollableResults.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 165,166 **** --- 165,169 ---- + + + Index: Session.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Session.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Session.java 4 Jan 2003 11:15:27 -0000 1.2 --- Session.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 41,529 **** * <pre> * Session sess = factory.openSession(); * try { ! * //do some work ! * ... ! * sess.flush(); ! * sess.connection().commit(); ! * } ! * catch (Exception e) { ! * sess.connection().rollback(); ! * throw e; ! * } ! * finally { ! * sess.close(); ! * } ! * </pre> ! * Or, when using a datasource enlisted with JTA: ! * <pre> ! * UserTransaction ut = .... ; ! * Session sess = factory.openSession(); ! * try { ! * //do some work ! * ... ! * sess.flush(); ! * } ! * catch (Exception e) { ! * ut.setRollbackOnly(); ! * throw e; ! * } ! * finally { ! * sess.close(); ! * } ! * </pre> ! * <br> ! * If the <tt>Session</tt> throws an exception, the transaction must be rolled back ! * and the session discarded. The internal state of the <tt>Session</tt> might not ! * be consistent with the database after the exception occurs. ! * ! * @see SessionFactory ! */ ! public interface Session extends Serializable { ! ! /** ! * Force the <tt>Session</tt> to flush. Must be called at the end of a ! * unit of work, before commiting the transaction and closing the ! * session (<tt>Transaction.commit()</tt> calls this method). <i>Flushing</i> ! * is the process of synchronising the underlying persistent store with ! * persistable state held in memory. ! * ! * @throws SQLException ! * @throws HibernateException ! */ ! public void flush() throws SQLException, HibernateException; ! ! /** ! * Set the flush mode. The flush mode determines at which points ! * Hibernate automatically flushes the session. For a readonly ! * session, it is reasonable to set the flush mode to ! * <tt>FlushMode.NEVER</tt> at the start of the session (in ! * order to achieve some extra performance). ! * ! * @see FlushMode ! */ ! public void setFlushMode(FlushMode flushMode); ! ! /** ! * Get the current flush mode. ! */ ! public FlushMode getFlushMode(); ! ! /** ! * Get the JDBC connection. Applications are responsible for ! * calling commit/rollback upon the connection before closing ! * the <tt>Session</tt>. ! * ! * @return the JDBC connection in use by the <tt>Session</tt> ! * @throws HibernateException if the <tt>Session</tt> is disconnected ! * @throws SQLException ! */ ! public Connection connection() throws SQLException, HibernateException; ! ! /** ! * Disconnect the <tt>Session</tt> from the current JDBC connection. If ! * the connection was obtained by Hibernate, close it or return it to the ! * connection pool. Otherwise return it to the application.<br> ! * <br> ! * This is used by applications which require long transactions. ! * ! * @return the connection provided by the application or <tt>null</tt> ! * @throws HibernateException if the <tt>Session</tt> is disconnected ! * @throws SQLException ! * @see Session#reconnect() ! */ ! public Connection disconnect() throws SQLException, HibernateException; ! ! /** ! * Obtain a new JDBC connection. This is used by applications which ! * require long transactions. ! * ! * @throws SQLException ! * @see Session#disconnect() ! */ ! public void reconnect() throws SQLException, HibernateException; ! ! /** ! * Reconnect to the given JDBC connection. This is used by applications ! * which require long transactions. ! * ! * @param connection a JDBC connection ! * @throws HibernateException if the <tt>Session</tt> is connected ! * @see Session#disconnect() ! */ ! public void reconnect(Connection connection) throws HibernateException; ! ! /** ! * End the <tt>Session</tt> by disconnecting from the JDBC connection and ! * cleaning up. It is not strictly necessary to <tt>close()</tt> the ! * <tt>Session</tt> but you must at least <tt>disconnect()</tt> it. ! * ! * @return the connection provided by the application ! * or <tt>null</tt> ! * @throws SQLException ! * @throws HibernateException ! */ ! public Connection close() throws SQLException, HibernateException; ! ! /** ! * Is the <tt>Session</tt> still open? ! * ! * @return boolean ! */ ! public boolean isOpen(); ! ! /** ! * Is the <tt>Session</tt> currently connected? ! * ! * @return boolean ! */ ! public boolean isConnected(); ! ! /** ! * Return the identifier of an entity instance cached by the <tt>Session</tt>, or ! * throw an exception if the instance is transient or associated with a different ! * <tt>Session</tt>. ! * ! * @param object a persistent instance ! * @return the identifier ! * @throws HibernateException if the <tt>Session</tt> is connected ! */ ! public Serializable getIdentifier(Object object) throws HibernateException; ! ! /** ! * Return the persistent instance of the given entity class with the given identifier, ! * obtaining the specified lock mode. ! * ! * @param theClass a persistent class ! * @param id a valid identifier of an existing persistent instance of the class ! * @param lockMode the lock level ! * @return the persistent instance ! * @throws SQLException ! * @throws HibernateException ! */ ! public Object load(Class theClass, Serializable id, LockMode lockMode) throws SQLException, HibernateException; ! ! /** ! * Return the persistent instance of the given entity class with the given identifier. ! * ! * @param theClass a persistent class ! * @param id a valid identifier of an existing persistent instance of the class ! * @return the persistent instance ! * @throws SQLException ! * @throws HibernateException ! */ ! public Object load(Class theClass, Serializable id) throws SQLException, HibernateException; ! ! /** ! * Read the persistent state associated with the given identifier into the given transient instance. ! * ! * @param object an "empty" instance of the persistent class ! * @param id a valid identifier of an existing persistent instance of the class ! * @throws SQLException ! * @throws HibernateException ! */ ! public void load(Object object, Serializable id) throws SQLException, HibernateException; ! ! /** ! * Persist the given transient instance, first assigning a generated identifier. (Or ! * using the current value of the identifier property if the <tt>assigned</tt> ! * generator is used.) ! * ! * @param object a transient instance of a persistent class ! * @return the generated identifier ! * @throws SQLException ! * @throws HibernateException ! */ ! public Serializable save(Object object) throws SQLException, HibernateException; ! ! /** ! * Persist the given transient instance, using the given identifier. ! * ! * @param object a transient instance of a persistent class ! * @param id an unused valid identifier ! * @throws SQLException ! * @throws HibernateException ! */ ! public void save(Object object, Serializable id) throws SQLException, HibernateException; ! ! /** ! * Either <tt>save()</tt> or <tt>update()</tt> the given instance, depending upon the value of ! * its identifier property. By default the instance is always saved. This behaviour may be ! * adjusted by specifying an <tt>unsaved-value</tt> attribute of the identifier property ! * mapping. ! * ! * @see Session#save(java.lang.Object) ! * @see Session#update(Object object, Serializable id) ! * @param object a transient instance containing new or updated state ! * @throws SQLException ! * @throws HibernateException ! */ ! public void saveOrUpdate(Object object) throws SQLException, HibernateException; ! ! /** ! * Update the persistent instance with the identifier of the given transient ! * instance. If there is a persistent instance with the same identifier, ! * an exception is thrown.<br> ! * <br> ! * If the given transient instance has a <tt>null</tt> identifier, an exception ! * will be thrown.<br> ! * <br> ! * <em>The class may not contain toplevel collections or collections ! * with subcollections.</em> ! * ! * @param object a transient instance containing updated state ! * @throws SQLException ! * @throws HibernateException ! */ ! public void update(Object object) throws SQLException, HibernateException; ! ! /** ! * Update the persistent state associated with the given identifier. An exception ! * is thrown if there is a persistent instance with the same identifier in the ! * current session.<br> ! * <br> ! * <em>The class may not contain toplevel collections or collections ! * with subcollections.</em> ! * ! * @param object a transient instance containing updated state ! * @param id identifier of persistent instance ! * @throws SQLException ! * @throws HibernateException ! */ ! public void update(Object object, Serializable id) throws SQLException, HibernateException; ! ! /** ! * Remove a persistent instance from the datastore. The argument may be ! * an instance associated with the receiving <tt>Session</tt> or a transient ! * instance with an identifier associated with existing persistent state. ! * ! * @param object the instance to be removed ! * @throws SQLException ! * @throws HibernateException ! */ ! public void delete(Object object) throws SQLException, HibernateException; ! ! /** ! * Execute a query. ! * ! * @param query a query expressed in Hibernate's query language ! * @return a distinct list of instances (or arrays of instances) ! * @throws SQLException ! * @throws HibernateException ! */ ! public List find(String query) throws SQLException, HibernateException; ! ! /** ! * Execute a query, binding a value to a "?" parameter in the query string. ! * ! * @param query the query string ! * @param value a value to be bound to a "?" placeholder (JDBC IN parameter). ! * @param type the Hibernate type of the value ! * @see Hibernate for access to <tt>Type</tt> instances ! * @return a distinct list of instances (or arrays of instances) ! * @throws SQLException ! * @throws HibernateException ! */ ! public List find(String query, Object value, Type type) throws SQLException, HibernateException; ! ! /** ! * Execute a query, binding an array of values to "?" parameters in the query string. ! * ! * @param query the query string ! * @param values an array of values to be bound to the "?" placeholders (JDBC IN parameters). ! * @param types an array of Hibernate types of the values ! * @see Hibernate for access to <tt>Type</tt> instances ! * @return a distinct list of instances ! * @throws SQLException ! * @throws HibernateException ! */ ! public List find(String query, Object[] values, Type[] types) throws SQLException, HibernateException; ! ! /** ! * Execute a query and return the results in an iterator. If the query has multiple ! * return values, values will be returned in an array of type <tt>Object[].</tt><br> ! * <br> ! * Entities returned as results are initialized on demand. The first SQL query returns ! * identifiers only. So <tt>iterate()</tt> is usually a less efficient way to retrieve ! * objects than <tt>find()</tt>. ! * ! * @param query the query string ! * @return an iterator ! * @throws SQLException ! * @throws HibernateException ! */ ! public Iterator iterate(String query) throws SQLException, HibernateException; ! ! /** ! * Execute a query and return the results in an iterator. Write the given value to "?" ! * in the query string. If the query has multiple return values, values will be returned ! * in an array of type <tt>Object[]</tt>.<br> ! * <br> ! * Entities returned as results are initialized on demand. The first SQL query returns ! * identifiers only. So <tt>iterate()</tt> is usually a less efficient way to retrieve ! * objects than <tt>find()</tt>. ! * ! * @param query the query string ! * @param value a value to be witten to a "?" placeholder in the query string ! * @param type the hibernate type of value ! * @return an iterator ! * @throws SQLException ! * @throws HibernateException ! */ ! public Iterator iterate(String query, Object value, Type type) throws SQLException, HibernateException; ! ! /** ! * Execute a query and return the results in an iterator. Write the given values to "?" ! * in the query string. If the query has multiple return values, values will be returned ! * in an array of type <tt>Object[]</tt>.<br> ! * <br> ! * Entities returned as results are initialized on demand. The first SQL query returns ! * identifiers only. So <tt>iterate()</tt> is usually a less efficient way to retrieve ! * objects than <tt>find()</tt>. ! * ! * @param query the query string ! * @param values a list of values to be written to "?" placeholders in the query ! * @param types a list of Hibernate types of the values ! * @return an iterator ! * @throws SQLException ! * @throws HibernateException ! */ ! public Iterator iterate(String query, Object[] values, Type[] types) throws SQLException, HibernateException; ! ! /** ! * Apply a filter to a persistent collection. A filter is a Hibernate query that may refer to ! * <tt>this</tt>, the collection element. Filters allow efficient access to very large lazy ! * collections. (Executing the filter does not initialize the collection.) ! * ! * @param collection a persistent collection to filter ! * @param filter a filter query string ! * @return Collection the resulting collection ! * @throws SQLException ! * @throws HibernateException ! */ ! public Collection filter(Object collection, String filter) throws SQLException, HibernateException; ! ! /** ! * Apply a filter to a persistent collection. A filter is a Hibernate query that may refer to ! * <tt>this</tt>, the collection element. ! * ! * @param collection a persistent collection to filter ! * @param filter a filter query string ! * @param value a value to be witten to a "?" placeholder in the query string ! * @param type the hibernate type of value ! * @return Collection ! * @throws SQLException ! * @throws HibernateException ! */ ! public Collection filter(Object collection, String filter, Object value, Type type) throws SQLException, HibernateException; ! ! /** ! * Apply a filter to a persistent collection, binding the given parameters to "?" placeholders. ! * A filter is a Hibernate query that may refer to <tt>this</tt>, the collection element. ! * ! * @param collection a persistent collection to filter ! * @param filter a filter query string ! * @param values a list of values to be written to "?" placeholders in the query ! * @param types a list of Hibernate types of the values ! * @return Collection ! * @throws SQLException ! * @throws HibernateException ! */ ! public Collection filter(Object collection, String filter, Object[] values, Type[] types) throws SQLException, HibernateException; ! ! /** ! * Delete all objects returned by the query. Return the number of objects deleted. ! * ! * @param query the query string ! * @return the number of instances deleted ! * @throws SQLException ! * @throws HibernateException ! */ ! public int delete(String query) throws SQLException, HibernateException; ! ! /** ! * Delete all objects returned by the query. Return the number of objects deleted. ! * ! * @param query the query string ! * @param value a value to be witten to a "?" placeholder in the query string. ! * @param type the hibernate type of value. ! * @return the number of instances deleted ! * @throws SQLException ! * @throws HibernateException ! */ ! public int delete(String query, Object value, Type type) throws SQLException, HibernateException; ! ! /** ! * Delete all objects returned by the query. Return the number of objects deleted. ! * ! * @param query the query string ! * @param values a list of values to be written to "?" placeholders in the query. ! * @param types a list of Hibernate types of the values ! * @return the number of instances deleted ! * @throws SQLException ! * @throws HibernateException ! */ ! public int delete(String query, Object[] values, Type[] types) throws SQLException, HibernateException; ! ! /** ! * Obtain the specified lock level upon the given object. ! * ! * @param object a persistent instance ! * @param lockMode the lock level ! * @throws SQLException ! * @throws HibernateException ! */ ! public void lock(Object object, LockMode lockMode) throws SQLException, HibernateException; ! ! /** ! * Determine the current lock mode of the given object ! * ! * @param object a persistent instance ! * @return the current lock mode ! */ ! public LockMode getCurrentLockMode(Object object) throws HibernateException; ! ! /** ! * Begin a unit of work and return the associated <tt>Transaction</tt> object. ! * If a new underlying transaction is required, begin the transaction. ! * The class of the returned <tt>Transaction</tt> object is determined by the ! * property <tt>hibernate.transaction_factory</tt>. ! * ! * @return a Transaction instance ! * @throws HibernateException ! * @see Transaction ! */ ! public Transaction beginTransaction() throws HibernateException; ! ! /** ! * Create a new instance of <tt>Query</tt> for the given query string. ! * ! * @param queryString a Hibernate query ! * @return Query ! * @throws HibernateException ! */ ! public Query createQuery(String queryString) throws HibernateException; ! ! /** ! * Create a new instance of <tt>Query</tt> for the given collection and filter string. ! * ! * @param collection a persistent collection ! * @param queryString a Hibernate query ! * @return Query ! * @throws HibernateException ! */ ! public Query createFilter(Object collection, String queryString) throws HibernateException; ! ! /** ! * Obtain an instance of <tt>Query</tt> for a named query string defined in the ! * mapping file. ! * ! * @param queryString the name of a query defined externally ! * @return Query ! * @throws HibernateException ! */ ! public Query getNamedQuery(String queryName) throws HibernateException; ! ! } ! ! ! --- 41,534 ---- * <pre> * Session sess = factory.openSession(); + * Transaction tx; * try { ! * tx = sess.beginTransaction(); ! * //do some work ! * ... ! * tx.commit(); ! * } ! * catch (Exception e) { ! * if (tx!=null) tx.rollback(); ! * throw e; ! * } ! * finally { ! * sess.close(); ! * } ! * </pre> ! * <br> ! * If the <tt>Session</tt> throws an exception, the transaction must be rolled back ! * and the session discarded. The internal state of the <tt>Session</tt> might not ! * be consistent with the database after the exception occurs. ! * ! * @see SessionFactory ! */ ! public interface Session extends Serializable { ! ! /** ! * Force the <tt>Session</tt> to flush. Must be called at the end of a ! * unit of work, before commiting the transaction and closing the ! * session (<tt>Transaction.commit()</tt> calls this method). <i>Flushing</i> ! * is the process of synchronising the underlying persistent store with ! * persistable state held in memory. ! * ! * @throws SQLException ! * @throws HibernateException ! */ ! public void flush() throws SQLException, HibernateException; ! ! /** ! * Set the flush mode. The flush mode determines at which points ! * Hibernate automatically flushes the session. For a readonly ! * session, it is reasonable to set the flush mode to ! * <tt>FlushMode.NEVER</tt> at the start of the session (in ! * order to achieve some extra performance). ! * ! * @see FlushMode ! */ ! public void setFlushMode(FlushMode flushMode); ! ! /** ! * Get the current flush mode. ! */ ! public FlushMode getFlushMode(); ! ! /** ! * Get the JDBC connection. Applications are responsible for ! * calling commit/rollback upon the connection before closing ! * the <tt>Session</tt>. ! * ! * @return the JDBC connection in use by the <tt>Session</tt> ! * @throws HibernateException if the <tt>Session</tt> is disconnected ! * @throws SQLException ! */ ! public Connection connection() throws SQLException, HibernateException; ! ! /** ! * Disconnect the <tt>Session</tt> from the current JDBC connection. If ! * the connection was obtained by Hibernate, close it or return it to the ! * connection pool. Otherwise return it to the application.<br> ! * <br> ! * This is used by applications which require long transactions. ! * ! * @return the connection provided by the application or <tt>null</tt> ! * @throws HibernateException if the <tt>Session</tt> is disconnected ! * @throws SQLException ! * @see Session#reconnect() ! */ ! public Connection disconnect() throws SQLException, HibernateException; ! ! /** ! * Obtain a new JDBC connection. This is used by applications which ! * require long transactions. ! * ! * @throws SQLException ! * @see Session#disconnect() ! */ ! public void reconnect() throws SQLException, HibernateException; ! ! /** ! * Reconnect to the given JDBC connection. This is used by applications ! * which require long transactions. ! * ! * @param connection a JDBC connection ! * @throws HibernateException if the <tt>Session</tt> is connected ! * @see Session#disconnect() ! */ ! public void reconnect(Connection connection) throws HibernateException; ! ! /** ! * End the <tt>Session</tt> by disconnecting from the JDBC connection and ! * cleaning up. It is not strictly necessary to <tt>close()</tt> the ! * <tt>Session</tt> but you must at least <tt>disconnect()</tt> it. ! * ! * @return the connection provided by the application ! * or <tt>null</tt> ! * @throws SQLException ! * @throws HibernateException ! */ ! public Connection close() throws SQLException, HibernateException; ! ! /** ! * Is the <tt>Session</tt> still open? ! * ! * @return boolean ! */ ! public boolean isOpen(); ! ! /** ! * Is the <tt>Session</tt> currently connected? ! * ! * @return boolean ! */ ! public boolean isConnected(); ! ! /** ! * Return the identifier of an entity instance cached by the <tt>Session</tt>, or ! * throw an exception if the instance is transient or associated with a different ! * <tt>Session</tt>. ! * ! * @param object a persistent instance ! * @return the identifier ! * @throws HibernateException if the <tt>Session</tt> is connected ! */ ! public Serializable getIdentifier(Object object) throws HibernateException; ! ! /** ! * Return the persistent instance of the given entity class with the given identifier, ! * obtaining the specified lock mode. ! * ! * @param theClass a persistent class ! * @param id a valid identifier of an existing persistent instance of the class ! * @param lockMode the lock level ! * @return the persistent instance ! * @throws SQLException ! * @throws HibernateException ! */ ! public Object load(Class theClass, Serializable id, LockMode lockMode) throws SQLException, HibernateException; ! ! /** ! * Return the persistent instance of the given entity class with the given identifier. ! * ! * @param theClass a persistent class ! * @param id a valid identifier of an existing persistent instance of the class ! * @return the persistent instance ! * @throws SQLException ! * @throws HibernateException ! */ ! public Object load(Class theClass, Serializable id) throws SQLException, HibernateException; ! ! /** ! * Read the persistent state associated with the given identifier into the given transient instance. ! * ! * @param object an "empty" instance of the persistent class ! * @param id a valid identifier of an existing persistent instance of the class ! * @throws SQLException ! * @throws HibernateException ! */ ! public void load(Object object, Serializable id) throws SQLException, HibernateException; ! ! /** ! * Persist the given transient instance, first assigning a generated identifier. (Or ! * using the current value of the identifier property if the <tt>assigned</tt> ! * generator is used.) ! * ! * @param object a transient instance of a persistent class ! * @return the generated identifier ! * @throws SQLException ! * @throws HibernateException ! */ ! public Serializable save(Object object) throws SQLException, HibernateException; ! ! /** ! * Persist the given transient instance, using the given identifier. ! * ! * @param object a transient instance of a persistent class ! * @param id an unused valid identifier ! * @throws SQLException ! * @throws HibernateException ! */ ! public void save(Object object, Serializable id) throws SQLException, HibernateException; ! ! /** ! * Either <tt>save()</tt> or <tt>update()</tt> the given instance, depending upon the value of ! * its identifier property. By default the instance is always saved. This behaviour may be ! * adjusted by specifying an <tt>unsaved-value</tt> attribute of the identifier property ! * mapping. ! * ! * @see Session#save(java.lang.Object) ! * @see Session#update(Object object, Serializable id) ! * @param object a transient instance containing new or updated state ! * @throws SQLException ! * @throws HibernateException ! */ ! public void saveOrUpdate(Object object) throws SQLException, HibernateException; ! ! /** ! * Update the persistent instance with the identifier of the given transient ! * instance. If there is a persistent instance with the same identifier, ! * an exception is thrown.<br> ! * <br> ! * If the given transient instance has a <tt>null</tt> identifier, an exception ! * will be thrown.<br> ! * <br> ! * <em>The class may not contain toplevel collections or collections ! * with subcollections.</em> ! * ! * @param object a transient instance containing updated state ! * @throws SQLException ! * @throws HibernateException ! */ ! public void update(Object object) throws SQLException, HibernateException; ! ! /** ! * Update the persistent state associated with the given identifier. An exception ! * is thrown if there is a persistent instance with the same identifier in the ! * current session.<br> ! * <br> ! * <em>The class may not contain toplevel collections or collections ! * with subcollections.</em> ! * ! * @param object a transient instance containing updated state ! * @param id identifier of persistent instance ! * @throws SQLException ! * @throws HibernateException ! */ ! public void update(Object object, Serializable id) throws SQLException, HibernateException; ! ! /** ! * Remove a persistent instance from the datastore. The argument may be ! * an instance associated with the receiving <tt>Session</tt> or a transient ! * instance with an identifier associated with existing persistent state. ! * ! * @param object the instance to be removed ! * @throws SQLException ! * @throws HibernateException ! */ ! public void delete(Object object) throws SQLException, HibernateException; ! ! /** ! * Execute a query. ! * ! * @param query a query expressed in Hibernate's query language ! * @return a distinct list of instances (or arrays of instances) ! * @throws SQLException ! * @throws HibernateException ! */ ! public List find(String query) throws SQLException, HibernateException; ! ! /** ! * Execute a query, binding a value to a "?" parameter in the query string. ! * ! * @param query the query string ! * @param value a value to be bound to a "?" placeholder (JDBC IN parameter). ! * @param type the Hibernate type of the value ! * @see Hibernate for access to <tt>Type</tt> instances ! * @return a distinct list of instances (or arrays of instances) ! * @throws SQLException ! * @throws HibernateException ! */ ! public List find(String query, Object value, Type type) throws SQLException, HibernateException; ! ! /** ! * Execute a query, binding an array of values to "?" parameters in the query string. ! * ! * @param query the query string ! * @param values an array of values to be bound to the "?" placeholders (JDBC IN parameters). ! * @param types an array of Hibernate types of the values ! * @see Hibernate for access to <tt>Type</tt> instances ! * @return a distinct list of instances ! * @throws SQLException ! * @throws HibernateException ! */ ! public List find(String query, Object[] values, Type[] types) throws SQLException, HibernateException; ! ! /** ! * Execute a query and return the results in an iterator. If the query has multiple ! * return values, values will be returned in an array of type <tt>Object[].</tt><br> ! * <br> ! * Entities returned as results are initialized on demand. The first SQL query returns ! * identifiers only. So <tt>iterate()</tt> is usually a less efficient way to retrieve ! * objects than <tt>find()</tt>. ! * ! * @param query the query string ! * @return an iterator ! * @throws SQLException ! * @throws HibernateException ! */ ! public Iterator iterate(String query) throws SQLException, HibernateException; ! ! /** ! * Execute a query and return the results in an iterator. Write the given value to "?" ! * in the query string. If the query has multiple return values, values will be returned ! * in an array of type <tt>Object[]</tt>.<br> ! * <br> ! * Entities returned as results are initialized on demand. The first SQL query returns ! * identifiers only. So <tt>iterate()</tt> is usually a less efficient way to retrieve ! * objects than <tt>find()</tt>. ! * ! * @param query the query string ! * @param value a value to be witten to a "?" placeholder in the query string ! * @param type the hibernate type of value ! * @return an iterator ! * @throws SQLException ! * @throws HibernateException ! */ ! public Iterator iterate(String query, Object value, Type type) throws SQLException, HibernateException; ! ! /** ! * Execute a query and return the results in an iterator. Write the given values to "?" ! * in the query string. If the query has multiple return values, values will be returned ! * in an array of type <tt>Object[]</tt>.<br> ! * <br> ! * Entities returned as results are initialized on demand. The first SQL query returns ! * identifiers only. So <tt>iterate()</tt> is usually a less efficient way to retrieve ! * objects than <tt>find()</tt>. ! * ! * @param query the query string ! * @param values a list of values to be written to "?" placeholders in the query ! * @param types a list of Hibernate types of the values ! * @return an iterator ! * @throws SQLException ! * @throws HibernateException ! */ ! public Iterator iterate(String query, Object[] values, Type[] types) throws SQLException, HibernateException; ! ! /** ! * Apply a filter to a persistent collection. A filter is a Hibernate query that may refer to ! * <tt>this</tt>, the collection element. Filters allow efficient access to very large lazy ! * collections. (Executing the filter does not initialize the collection.) ! * ! * @param collection a persistent collection to filter ! * @param filter a filter query string ! * @return Collection the resulting collection ! * @throws SQLException ! * @throws HibernateException ! */ ! public Collection filter(Object collection, String filter) throws SQLException, HibernateException; ! ! /** ! * Apply a filter to a persistent collection. A filter is a Hibernate query that may refer to ! * <tt>this</tt>, the collection element. ! * ! * @param collection a persistent collection to filter ! * @param filter a filter query string ! * @param value a value to be witten to a "?" placeholder in the query string ! * @param type the hibernate type of value ! * @return Collection ! * @throws SQLException ! * @throws HibernateException ! */ ! public Collection filter(Object collection, String filter, Object value, Type type) throws SQLException, HibernateException; ! ! /** ! * Apply a filter to a persistent collection, binding the given parameters to "?" placeholders. ! * A filter is a Hibernate query that may refer to <tt>this</tt>, the collection element. ! * ! * @param collection a persistent collection to filter ! * @param filter a filter query string ! * @param values a list of values to be written to "?" placeholders in the query ! * @param types a list of Hibernate types of the values ! * @return Collection ! * @throws SQLException ! * @throws HibernateException ! */ ! public Collection filter(Object collection, String filter, Object[] values, Type[] types) throws SQLException, HibernateException; ! ! /** ! * Delete all objects returned by the query. Return the number of objects deleted. ! * ! * @param query the query string ! * @return the number of instances deleted ! * @throws SQLException ! * @throws HibernateException ! */ ! public int delete(String query) throws SQLException, HibernateException; ! ! /** ! * Delete all objects returned by the query. Return the number of objects deleted. ! * ! * @param query the query string ! * @param value a value to be witten to a "?" placeholder in the query string. ! * @param type the hibernate type of value. ! * @return the number of instances deleted ! * @throws SQLException ! * @throws HibernateException ! */ ! public int delete(String query, Object value, Type type) throws SQLException, HibernateException; ! ! /** ! * Delete all objects returned by the query. Return the number of objects deleted. ! * ! * @param query the query string ! * @param values a list of values to be written to "?" placeholders in the query. ! * @param types a list of Hibernate types of the values ! * @return the number of instances deleted ! * @throws SQLException ! * @throws HibernateException ! */ ! public int delete(String query, Object[] values, Type[] types) throws SQLException, HibernateException; ! ! /** ! * Obtain the specified lock level upon the given object. ! * ! * @param object a persistent instance ! * @param lockMode the lock level ! * @throws SQLException ! * @throws HibernateException ! */ ! public void lock(Object object, LockMode lockMode) throws SQLException, HibernateException; ! ! /** ! * Re-read the state of the given instance from the underlying database. It is ! * inadvisable to use this to implement long-running sessions that span many ! * business tasks. This method is, however, useful in certain special circumstances. ! * For example ! * <ul> ! * <li>where a database trigger alters the object state upon insert or update ! * <li>after executing direct SQL (eg. a mass update) in the same session ! * <li>after inserting a <tt>Blob</tt> or <tt>Clob</tt> ! * </ul> ! * ! * @param object a persistent instance ! * @throws HibernateException ! * @throws SQLException ! */ ! public void refresh(Object object) throws SQLException, HibernateException; ! ! /** ! * Determine the current lock mode of the given object ! * ! * @param object a persistent instance ! * @return the current lock mode ! * @throws HibernateException ! */ ! public LockMode getCurrentLockMode(Object object) throws HibernateException; ! ! /** ! * Begin a unit of work and return the associated <tt>Transaction</tt> object. ! * If a new underlying transaction is required, begin the transaction. ! * The class of the returned <tt>Transaction</tt> object is determined by the ! * property <tt>hibernate.transaction_factory</tt>. ! * ! * @return a Transaction instance ! * @throws HibernateException ! * @see Transaction ! */ ! public Transaction beginTransaction() throws HibernateException; ! ! /** ! * Create a new instance of <tt>Query</tt> for the given query string. ! * ! * @param queryString a Hibernate query ! * @return Query ! * @throws HibernateException ! */ ! public Query createQuery(String queryString) throws HibernateException; ! ! /** ! * Create a new instance of <tt>Query</tt> for the given collection and filter string. ! * ! * @param collection a persistent collection ! * @param queryString a Hibernate query ! * @return Query ! * @throws HibernateException ! */ ! public Query createFilter(Object collection, String queryString) throws HibernateException; ! ! /** ! * Obtain an instance of <tt>Query</tt> for a named query string defined in the ! * mapping file. ! * ! * @param queryString the name of a query defined externally ! * @return Query ! * @throws HibernateException ! */ ! public Query getNamedQuery(String queryName) throws HibernateException; ! ! } ! ! ! ! ! ! Index: SessionFactory.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/SessionFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SessionFactory.java 4 Jan 2003 11:15:27 -0000 1.2 --- SessionFactory.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 198,199 **** --- 198,202 ---- + + + Index: StaleObjectStateException.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/StaleObjectStateException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** StaleObjectStateException.java 4 Jan 2003 11:15:27 -0000 1.2 --- StaleObjectStateException.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 40,41 **** --- 40,44 ---- + + + Index: Transaction.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Transaction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Transaction.java 4 Jan 2003 11:15:27 -0000 1.2 --- Transaction.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 64,65 **** --- 64,68 ---- + + + Index: TransactionException.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/TransactionException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TransactionException.java 4 Jan 2003 11:15:27 -0000 1.2 --- TransactionException.java 5 Jan 2003 02:11:19 -0000 1.3 *************** *** 18,19 **** --- 18,22 ---- + + + Index: TransientObjectException.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/TransientObjectException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TransientObjectException.java 4 Jan 2003 11:15:27 -0000 1.2 --- TransientObjectException.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 17,18 **** --- 17,21 ---- + + + Index: UserType.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/UserType.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UserType.java 4 Jan 2003 11:15:27 -0000 1.2 --- UserType.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 14,17 **** --- 14,18 ---- * <li>hides certain "internal" interfaces from user code.</li> * </ul> + * <br> * Implementors must be immutable and must declare a public * default constructor.<br> *************** *** 98,101 **** --- 99,105 ---- public boolean isMutable(); } + + + Index: Validatable.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Validatable.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Validatable.java 4 Jan 2003 11:15:27 -0000 1.2 --- Validatable.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 19,20 **** --- 19,23 ---- + + + Index: ValidationFailure.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/ValidationFailure.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ValidationFailure.java 4 Jan 2003 11:15:27 -0000 1.2 --- ValidationFailure.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 25,26 **** --- 25,29 ---- + + + Index: WrongClassException.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/WrongClassException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WrongClassException.java 4 Jan 2003 11:15:27 -0000 1.2 --- WrongClassException.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 37,38 **** --- 37,41 ---- + + + |
From: <one...@us...> - 2003-01-05 02:11:53
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection In directory sc8-pr-cvs1:/tmp/cvs-serv23158/src/net/sf/hibernate/collection Modified Files: ArrayHolder.java Bag.java CollectionPersister.java List.java Map.java ODMGCollection.java PersistentCollection.java Set.java SortedMap.java SortedSet.java Log Message: added Session.refresh() revised some javadoc new javadoc style consistent with website colors Index: ArrayHolder.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/ArrayHolder.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ArrayHolder.java 4 Jan 2003 11:15:27 -0000 1.3 --- ArrayHolder.java 5 Jan 2003 02:11:20 -0000 1.4 *************** *** 230,231 **** --- 230,234 ---- + + + Index: Bag.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/Bag.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Bag.java 4 Jan 2003 11:15:27 -0000 1.4 --- Bag.java 5 Jan 2003 02:11:20 -0000 1.5 *************** *** 484,485 **** --- 484,488 ---- + + + Index: CollectionPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/CollectionPersister.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CollectionPersister.java 4 Jan 2003 11:15:27 -0000 1.2 --- CollectionPersister.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 709,710 **** --- 709,713 ---- + + + Index: List.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/List.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** List.java 4 Jan 2003 11:15:27 -0000 1.4 --- List.java 5 Jan 2003 02:11:20 -0000 1.5 *************** *** 407,408 **** --- 407,411 ---- + + + Index: Map.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/Map.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Map.java 4 Jan 2003 11:15:27 -0000 1.4 --- Map.java 5 Jan 2003 02:11:20 -0000 1.5 *************** *** 384,385 **** --- 384,388 ---- + + + Index: ODMGCollection.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/ODMGCollection.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ODMGCollection.java 4 Jan 2003 11:15:27 -0000 1.3 --- ODMGCollection.java 5 Jan 2003 02:11:20 -0000 1.4 *************** *** 90,91 **** --- 90,94 ---- + + + Index: PersistentCollection.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/PersistentCollection.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PersistentCollection.java 4 Jan 2003 11:15:27 -0000 1.3 --- PersistentCollection.java 5 Jan 2003 02:11:20 -0000 1.4 *************** *** 516,517 **** --- 516,520 ---- + + + Index: Set.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/Set.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Set.java 4 Jan 2003 11:15:27 -0000 1.4 --- Set.java 5 Jan 2003 02:11:20 -0000 1.5 *************** *** 403,404 **** --- 403,407 ---- + + + Index: SortedMap.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/SortedMap.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SortedMap.java 4 Jan 2003 11:15:27 -0000 1.3 --- SortedMap.java 5 Jan 2003 02:11:20 -0000 1.4 *************** *** 201,202 **** --- 201,205 ---- + + + Index: SortedSet.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/SortedSet.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SortedSet.java 4 Jan 2003 11:15:27 -0000 1.3 --- SortedSet.java 5 Jan 2003 02:11:20 -0000 1.4 *************** *** 149,150 **** --- 149,153 ---- + + + |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect In directory sc8-pr-cvs1:/tmp/cvs-serv23158/src/net/sf/hibernate/dialect Modified Files: DB2Dialect.java Dialect.java GenericDialect.java HSQLDialect.java InterbaseDialect.java MckoiDialect.java MySQLDialect.java OracleDialect.java PointbaseDialect.java PostgreSQLDialect.java ProgressDialect.java SAPDBDialect.java SybaseDialect.java TypeNames.java Log Message: added Session.refresh() revised some javadoc new javadoc style consistent with website colors Index: DB2Dialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/DB2Dialect.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DB2Dialect.java 4 Jan 2003 11:15:28 -0000 1.2 --- DB2Dialect.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 67,68 **** --- 67,71 ---- + + + Index: Dialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/Dialect.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Dialect.java 4 Jan 2003 11:15:28 -0000 1.2 --- Dialect.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 329,330 **** --- 329,333 ---- + + + Index: GenericDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/GenericDialect.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GenericDialect.java 4 Jan 2003 11:15:28 -0000 1.2 --- GenericDialect.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 38,39 **** --- 38,42 ---- + + + Index: HSQLDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/HSQLDialect.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HSQLDialect.java 4 Jan 2003 11:15:28 -0000 1.2 --- HSQLDialect.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 83,84 **** --- 83,87 ---- + + + Index: InterbaseDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/InterbaseDialect.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** InterbaseDialect.java 4 Jan 2003 11:15:28 -0000 1.2 --- InterbaseDialect.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 52,53 **** --- 52,56 ---- + + + Index: MckoiDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/MckoiDialect.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MckoiDialect.java 4 Jan 2003 11:15:28 -0000 1.2 --- MckoiDialect.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 51,52 **** --- 51,55 ---- + + + Index: MySQLDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/MySQLDialect.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MySQLDialect.java 4 Jan 2003 11:15:28 -0000 1.2 --- MySQLDialect.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 87,88 **** --- 87,91 ---- + + + Index: OracleDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/OracleDialect.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OracleDialect.java 4 Jan 2003 11:15:28 -0000 1.2 --- OracleDialect.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 74,75 **** --- 74,78 ---- + + + Index: PointbaseDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/PointbaseDialect.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PointbaseDialect.java 4 Jan 2003 11:15:28 -0000 1.2 --- PointbaseDialect.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 72,73 **** --- 72,76 ---- + + + Index: PostgreSQLDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/PostgreSQLDialect.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PostgreSQLDialect.java 4 Jan 2003 11:15:28 -0000 1.2 --- PostgreSQLDialect.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 57,58 **** --- 57,61 ---- + + + Index: ProgressDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/ProgressDialect.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ProgressDialect.java 4 Jan 2003 11:15:28 -0000 1.2 --- ProgressDialect.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 55,56 **** --- 55,59 ---- + + + Index: SAPDBDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/SAPDBDialect.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SAPDBDialect.java 4 Jan 2003 11:15:28 -0000 1.2 --- SAPDBDialect.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 102,103 **** --- 102,106 ---- + + + Index: SybaseDialect.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/SybaseDialect.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SybaseDialect.java 4 Jan 2003 11:15:28 -0000 1.2 --- SybaseDialect.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 65,66 **** --- 65,69 ---- + + + Index: TypeNames.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/dialect/TypeNames.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TypeNames.java 4 Jan 2003 11:15:28 -0000 1.2 --- TypeNames.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 113,114 **** --- 113,117 ---- + + + |
From: <one...@us...> - 2003-01-05 02:11:53
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/eg In directory sc8-pr-cvs1:/tmp/cvs-serv23158/src/net/sf/hibernate/eg Modified Files: Edge.java NetworkDemo.java Source.java Vertex.java Log Message: added Session.refresh() revised some javadoc new javadoc style consistent with website colors Index: Edge.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/eg/Edge.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Edge.java 4 Jan 2003 11:15:28 -0000 1.2 --- Edge.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 74,75 **** --- 74,78 ---- + + + Index: NetworkDemo.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/eg/NetworkDemo.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NetworkDemo.java 4 Jan 2003 11:15:28 -0000 1.2 --- NetworkDemo.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 326,327 **** --- 326,330 ---- + + + Index: Source.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/eg/Source.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Source.java 4 Jan 2003 11:15:28 -0000 1.2 --- Source.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 21,22 **** --- 21,25 ---- + + + Index: Vertex.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/eg/Vertex.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Vertex.java 4 Jan 2003 11:15:28 -0000 1.2 --- Vertex.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 96,97 **** --- 96,100 ---- + + + |
From: <one...@us...> - 2003-01-05 02:11:53
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/connection In directory sc8-pr-cvs1:/tmp/cvs-serv23158/src/net/sf/hibernate/connection Modified Files: C3P0ConnectionProvider.java ConnectionProvider.java ConnectionProviderFactory.java DBCPConnectionProvider.java DatasourceConnectionProvider.java DriverManagerConnectionProvider.java UserSuppliedConnectionProvider.java Log Message: added Session.refresh() revised some javadoc new javadoc style consistent with website colors Index: C3P0ConnectionProvider.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/connection/C3P0ConnectionProvider.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** C3P0ConnectionProvider.java 4 Jan 2003 11:15:27 -0000 1.2 --- C3P0ConnectionProvider.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 123,124 **** --- 123,127 ---- + + + Index: ConnectionProvider.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/connection/ConnectionProvider.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ConnectionProvider.java 4 Jan 2003 11:15:27 -0000 1.2 --- ConnectionProvider.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 47,48 **** --- 47,51 ---- + + + Index: ConnectionProviderFactory.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/connection/ConnectionProviderFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ConnectionProviderFactory.java 4 Jan 2003 11:15:27 -0000 1.2 --- ConnectionProviderFactory.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 113,114 **** --- 113,117 ---- + + + Index: DBCPConnectionProvider.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/connection/DBCPConnectionProvider.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DBCPConnectionProvider.java 4 Jan 2003 11:15:27 -0000 1.2 --- DBCPConnectionProvider.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 144,145 **** --- 144,148 ---- + + + Index: DatasourceConnectionProvider.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/connection/DatasourceConnectionProvider.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DatasourceConnectionProvider.java 4 Jan 2003 11:15:27 -0000 1.2 --- DatasourceConnectionProvider.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 82,83 **** --- 82,86 ---- + + + Index: DriverManagerConnectionProvider.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/connection/DriverManagerConnectionProvider.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DriverManagerConnectionProvider.java 4 Jan 2003 11:15:27 -0000 1.3 --- DriverManagerConnectionProvider.java 5 Jan 2003 02:11:20 -0000 1.4 *************** *** 155,156 **** --- 155,159 ---- + + + Index: UserSuppliedConnectionProvider.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/connection/UserSuppliedConnectionProvider.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UserSuppliedConnectionProvider.java 4 Jan 2003 11:15:27 -0000 1.2 --- UserSuppliedConnectionProvider.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 50,51 **** --- 50,54 ---- + + + |
From: <one...@us...> - 2003-01-05 02:11:53
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cache In directory sc8-pr-cvs1:/tmp/cvs-serv23158/src/net/sf/hibernate/cache Modified Files: Cache.java CacheConcurrencyStrategy.java CacheException.java CacheTest.java CachedItem.java HashBelt.java JCSCache.java ReadOnlyCache.java ReadWriteCache.java Timestamper.java Log Message: added Session.refresh() revised some javadoc new javadoc style consistent with website colors Index: Cache.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cache/Cache.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Cache.java 4 Jan 2003 11:15:27 -0000 1.2 --- Cache.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 37,38 **** --- 37,41 ---- + + + Index: CacheConcurrencyStrategy.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cache/CacheConcurrencyStrategy.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CacheConcurrencyStrategy.java 4 Jan 2003 11:15:27 -0000 1.2 --- CacheConcurrencyStrategy.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 43,44 **** --- 43,47 ---- + + + Index: CacheException.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cache/CacheException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CacheException.java 4 Jan 2003 11:15:27 -0000 1.2 --- CacheException.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 21,22 **** --- 21,25 ---- + + + Index: CacheTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cache/CacheTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CacheTest.java 4 Jan 2003 11:15:27 -0000 1.2 --- CacheTest.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 137,138 **** --- 137,141 ---- + + + Index: CachedItem.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cache/CachedItem.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CachedItem.java 4 Jan 2003 11:15:27 -0000 1.2 --- CachedItem.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 59,60 **** --- 59,63 ---- + + + Index: HashBelt.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cache/HashBelt.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HashBelt.java 4 Jan 2003 11:15:27 -0000 1.2 --- HashBelt.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 84,85 **** --- 84,88 ---- + + + Index: JCSCache.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cache/JCSCache.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JCSCache.java 4 Jan 2003 11:15:27 -0000 1.2 --- JCSCache.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 47,48 **** --- 47,51 ---- + + + Index: ReadOnlyCache.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cache/ReadOnlyCache.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ReadOnlyCache.java 4 Jan 2003 11:15:27 -0000 1.2 --- ReadOnlyCache.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 44,45 **** --- 44,48 ---- + + + Index: ReadWriteCache.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cache/ReadWriteCache.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ReadWriteCache.java 4 Jan 2003 11:15:27 -0000 1.2 --- ReadWriteCache.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 91,92 **** --- 91,95 ---- + + + Index: Timestamper.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cache/Timestamper.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Timestamper.java 4 Jan 2003 11:15:27 -0000 1.2 --- Timestamper.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 28,29 **** --- 28,32 ---- + + + |
From: <one...@us...> - 2003-01-05 02:11:53
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg In directory sc8-pr-cvs1:/tmp/cvs-serv23158/src/net/sf/hibernate/cfg Modified Files: Configuration.java Datastore.java Log Message: added Session.refresh() revised some javadoc new javadoc style consistent with website colors Index: Configuration.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg/Configuration.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Configuration.java 4 Jan 2003 11:15:27 -0000 1.2 --- Configuration.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 175,176 **** --- 175,179 ---- + + + Index: Datastore.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/cfg/Datastore.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Datastore.java 4 Jan 2003 11:15:27 -0000 1.2 --- Datastore.java 5 Jan 2003 02:11:20 -0000 1.3 *************** *** 165,166 **** --- 165,169 ---- + + + |
From: <one...@us...> - 2003-01-05 02:11:52
|
Update of /cvsroot/hibernate/Hibernate2 In directory sc8-pr-cvs1:/tmp/cvs-serv23158 Modified Files: changelog.txt indent.py Log Message: added Session.refresh() revised some javadoc new javadoc style consistent with website colors Index: changelog.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/changelog.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** changelog.txt 3 Jan 2003 14:07:29 -0000 1.3 --- changelog.txt 5 Jan 2003 02:11:19 -0000 1.4 *************** *** 12,17 **** * added <parent> subelement to <composite-element> and <nested-composite-element> * collections except for <bag>s now implement by-value equals() and hashCode() ! Changes in version 1.2.1b (1.1.2003) ------------------------------------ * fixed an NPE that occurred while loading Hibernate classes in IBM JVM --- 12,19 ---- * added <parent> subelement to <composite-element> and <nested-composite-element> * collections except for <bag>s now implement by-value equals() and hashCode() + * removed all deprecated methods + * added Session.refresh() ! Changes in version 1.2.1b (4.1.2003) ------------------------------------ * fixed an NPE that occurred while loading Hibernate classes in IBM JVM Index: indent.py =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/indent.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** indent.py 4 Jan 2003 11:15:27 -0000 1.1 --- indent.py 5 Jan 2003 02:11:19 -0000 1.2 *************** *** 11,18 **** code = ln.lstrip('\t ').rstrip('\t ') clen = len(code) ! if clen > 0 and code[0]=='*': code = ' ' + code ! begincb = clen > 0 and ( code[0]=='}' or code[0]==')' ) ! tabcount -= begincb tabs = '\t' * tabcount --- 11,21 ---- code = ln.lstrip('\t ').rstrip('\t ') clen = len(code) ! javadoc = clen > 0 and code[0]=='*' ! if javadoc: code = ' ' + code ! else: ! begincb = clen > 0 and ( code[0]=='}' or code[0]==')' ) ! tabcount -= begincb ! tabs = '\t' * tabcount *************** *** 24,31 **** out.append( tabs + code + '\n' ) ! uncommented = code.split('//')[0].rstrip() ! clen = len(uncommented) ! endob = clen > 0 and ( code[clen-1]=='{' or code[clen-1]=='(' ) ! tabcount += endob file = open( fname, 'w' ) --- 27,35 ---- out.append( tabs + code + '\n' ) ! if not javadoc: ! uncommented = code.split('//')[0].rstrip() ! clen = len(uncommented) ! endob = clen > 0 and ( code[clen-1]=='{' or code[clen-1]=='(' ) ! tabcount += endob file = open( fname, 'w' ) |
From: <one...@us...> - 2003-01-05 02:11:52
|
Update of /cvsroot/hibernate/Hibernate2/doc/api In directory sc8-pr-cvs1:/tmp/cvs-serv23158/doc/api Modified Files: jdstyle.css Log Message: added Session.refresh() revised some javadoc new javadoc style consistent with website colors Index: jdstyle.css =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/doc/api/jdstyle.css,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** jdstyle.css 1 Jan 2003 13:42:58 -0000 1.1.1.1 --- jdstyle.css 5 Jan 2003 02:11:19 -0000 1.2 *************** *** 5,20 **** /* Page background color */ body { font-family: Arial; ! background-color: silver; font-size: 10pt; - color: navy; } td { font-family: Arial; font-size: 10pt; - color: navy; } /* Table colors */ ! .TableHeadingColor { background: #CCCCFF } /* Dark mauve */ ! .TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ ! .TableRowColor { background: #FFFFFF } /* White */ /* Font used in left-hand frame lists */ --- 5,18 ---- /* Page background color */ body { font-family: Arial; ! background-color: white; font-size: 10pt; } td { font-family: Arial; font-size: 10pt; } /* Table colors */ ! .TableHeadingColor { background: #F4F4F4 } ! .TableSubHeadingColor { background: #F4F4F4 } ! .TableRowColor { background: #FFFFFF } /* Font used in left-hand frame lists */ *************** *** 27,32 **** /* Navigation bar fonts and colors */ ! .NavBarCell1 { background-color:#EEEEFF;}/* Light mauve */ ! .NavBarCell1Rev { background-color:#00008B;}/* Dark Blue */ .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} --- 25,31 ---- /* Navigation bar fonts and colors */ ! .NavBarCell1 { background-color:#F4F4F4;} ! .NavBarCell1Rev { background-color:silver;} ! .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} *************** *** 35,36 **** --- 34,117 ---- .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} + A { + color: #003399; + } + + A:active { + color: #003399; + } + + A:visited { + color: #888888; + } + + P, OL, UL, LI, DL, DT, DD, BLOCKQUOTE { + color: #000000; + } + + TD, TH, SPAN { + color: #000000; + } + + BLOCKQUOTE { + margin-right: 0px; + } + + + /*H1, H2, H3, H4, H5, H6 { + color: #000000; + font-weight:500; + margin-top:10px; + padding-top:15px; + } + + H1 { font-size: 150%; } + H2 { font-size: 140%; } + H3 { font-size: 110%; font-weight: bold; } + H4 { font-size: 110%; font-weight: bold;} + H5 { font-size: 100%; font-style: italic; } + H6 { font-size: 100%; font-style: italic; }*/ + + TT { + font-size: 90%; + font-family: "Courier New", Courier, monospace; + color: #000000; + } + + PRE { + font-size: 90%; + padding: 5px; + border-style: solid; + border-width: 1px; + border-color: #CCCCCC; + background-color: #F4F4F4; + } + + UL, OL, LI { + list-style: disc; + } + + HR { + width: 100%; + height: 1px; + background-color: #CCCCCC; + border-width: 0px; + padding: 0px; + color: #CCCCCC; + } + + .variablelist { + padding-top: 10; + padding-bottom:10; + margin:0; + } + + .itemizedlist, UL { + padding-top: 0; + padding-bottom:0; + margin:0; + } + + .term { + font-weight:bold; + } |
From: <one...@us...> - 2003-01-04 13:05:17
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv10537/cirrus/hibernate Modified Files: Environment.java Log Message: 1.2.2 Index: Environment.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/Environment.java,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** Environment.java 1 Jan 2003 03:03:15 -0000 1.82 --- Environment.java 4 Jan 2003 13:05:14 -0000 1.83 *************** *** 39,43 **** public final class Environment { ! private static final String VERSION = "1.2.1b"; /** --- 39,43 ---- public final class Environment { ! private static final String VERSION = "1.2.2"; /** |
From: <one...@us...> - 2003-01-04 13:05:17
|
Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv10537/cirrus/hibernate/impl Modified Files: SessionImpl.java Log Message: 1.2.2 Index: SessionImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/impl/SessionImpl.java,v retrieving revision 1.160 retrieving revision 1.161 diff -C2 -d -r1.160 -r1.161 *** SessionImpl.java 28 Dec 2002 02:25:49 -0000 1.160 --- SessionImpl.java 4 Jan 2003 13:05:14 -0000 1.161 *************** *** 702,705 **** --- 702,707 ---- Serializable id = persister.getIdentifier(object); + if (id==null) throw new HibernateException("the transient instance passed to delete() had a null identifier"); + removeCollectionsFor(persister, id, object); *************** *** 1219,1223 **** setFlushMode(FlushMode.AUTO); } ! public void setFlushMode(FlushMode flushMode) { this.flushMode = flushMode; --- 1221,1225 ---- setFlushMode(FlushMode.AUTO); } ! public void setFlushMode(FlushMode flushMode) { this.flushMode = flushMode; *************** *** 1342,1347 **** Object version = Versioning.getVersion(values, persister); addEntry(object, LOADED, values, id, version, lockMode, true, persister); ! ! if ( log.isTraceEnabled() && version!=null ) log.trace("Version: " + version); } --- 1344,1349 ---- Object version = Versioning.getVersion(values, persister); addEntry(object, LOADED, values, id, version, lockMode, true, persister); ! ! if ( log.isTraceEnabled() && version!=null ) log.trace("Version: " + version); } *************** *** 2042,2046 **** if ( log.isDebugEnabled() ) { log.debug( ! "Collection found: " + infoString(persister, ce.currentID) + ", was: " + infoString(ce.loadedPersister, ce.loadedID) ); --- 2044,2048 ---- if ( log.isDebugEnabled() ) { log.debug( ! "Collection found: " + infoString(persister, ce.currentID) + ", was: " + infoString(ce.loadedPersister, ce.loadedID) ); *************** *** 2249,2262 **** // if the collection contains other collections, and it has been (lazily) initialized, // check if _they_ are dirty ! Type eltType = persister.getElementType(); ! if ( eltType.isPersistentCollectionType() || eltType.isComponentType() ) { //optional performance opt ! Iterator iter = coll.elements(); while ( iter.hasNext() ) { if ( searchForDirtyCollections( iter.next(), eltType ) ) return true; } ! } --- 2251,2264 ---- // if the collection contains other collections, and it has been (lazily) initialized, // check if _they_ are dirty ! Type eltType = persister.getElementType(); ! if ( eltType.isPersistentCollectionType() || eltType.isComponentType() ) { //optional performance opt ! Iterator iter = coll.elements(); while ( iter.hasNext() ) { if ( searchForDirtyCollections( iter.next(), eltType ) ) return true; } ! } *************** *** 2338,2342 **** return getCollectionEntry(coll).loadedID; } ! public boolean isCollectionReadOnly(PersistentCollection collection) { CollectionEntry ce = getCollectionEntry(collection); --- 2340,2344 ---- return getCollectionEntry(coll).loadedID; } ! public boolean isCollectionReadOnly(PersistentCollection collection) { CollectionEntry ce = getCollectionEntry(collection); *************** *** 2591,2595 **** if(persister==null) { s.append("<null ClassPersister>"); ! } else { s.append(persister.getClassName()); --- 2593,2597 ---- if(persister==null) { s.append("<null ClassPersister>"); ! } else { s.append(persister.getClassName()); *************** *** 2599,2603 **** if (id==null) { s.append("<null>"); ! } else { s.append(id); --- 2601,2605 ---- if (id==null) { s.append("<null>"); ! } else { s.append(id); *************** *** 2608,2612 **** } ! private static String infoString(Class clazz, Serializable id) { StringBuffer s = new StringBuffer(); --- 2610,2614 ---- } ! private static String infoString(Class clazz, Serializable id) { StringBuffer s = new StringBuffer(); *************** *** 2614,2618 **** if(clazz==null) { s.append("<null Class>"); ! } else { s.append( clazz.getName() ); --- 2616,2620 ---- if(clazz==null) { s.append("<null Class>"); ! } else { s.append( clazz.getName() ); *************** *** 2622,2626 **** if (id==null) { s.append("<null>"); ! } else { s.append(id); --- 2624,2628 ---- if (id==null) { s.append("<null>"); ! } else { s.append(id); *************** *** 2636,2640 **** if (persister == null) { s.append("<null ClassPersister>"); ! } else { s.append( persister.getClassName() ); --- 2638,2642 ---- if (persister == null) { s.append("<null ClassPersister>"); ! } else { s.append( persister.getClassName() ); *************** *** 2649,2660 **** if(persister==null) { s.append("<unreferenced>"); ! } else { s.append( persister.getRole() ); s.append('#'); ! if (id==null) { s.append("<null>"); ! } else { s.append(id); --- 2651,2662 ---- if(persister==null) { s.append("<unreferenced>"); ! } else { s.append( persister.getRole() ); s.append('#'); ! if (id==null) { s.append("<null>"); ! } else { s.append(id); |
From: <one...@us...> - 2003-01-04 13:05:17
|
Update of /cvsroot/hibernate/Hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv10537 Modified Files: changelog.txt readme.txt Log Message: 1.2.2 Index: changelog.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate/changelog.txt,v retrieving revision 1.294 retrieving revision 1.295 diff -C2 -d -r1.294 -r1.295 *** changelog.txt 1 Jan 2003 03:03:15 -0000 1.294 --- changelog.txt 4 Jan 2003 13:05:14 -0000 1.295 *************** *** 1,8 **** Hibernate Changelog =================== ! Changes in version 1.2.1b (1.1.2003) -------------------------------------- * fixed an NPE that occurred while loading Hibernate classes in IBM JVM * arbitrary JNDI InitialContext properties may now be passed as hibernate.jndi.* Changes in version 1.2.1 (31.12.2002) --- 1,9 ---- Hibernate Changelog =================== ! Changes in version 1.2.2 (4.1.2003) -------------------------------------- * fixed an NPE that occurred while loading Hibernate classes in IBM JVM * arbitrary JNDI InitialContext properties may now be passed as hibernate.jndi.* + * fixed a problem where index column was not being nullified when an entity was removed from a one-to-many Changes in version 1.2.1 (31.12.2002) Index: readme.txt =================================================================== RCS file: /cvsroot/hibernate/Hibernate/readme.txt,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** readme.txt 31 Dec 2002 08:22:28 -0000 1.57 --- readme.txt 4 Jan 2003 13:05:14 -0000 1.58 *************** *** 1,5 **** Hibernate - Relational Persistence for Idiomatic Java ===================================================== ! version 1.2.1b 1 January 2003 Instructions --- 1,5 ---- Hibernate - Relational Persistence for Idiomatic Java ===================================================== ! version 1.2.2 4 January 2003 Instructions |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test In directory sc8-pr-cvs1:/tmp/cvs-serv14211/src/net/sf/hibernate/test Modified Files: A.java ABCProxyTest.java ABCTest.java Abstract.java AbstractProxy.java B.java Bar.java BarProxy.java BasicNameable.java Baz.java C1.java C2.java Category.java Child.java Circular.java Contained.java Container.java Custom.java CustomPersister.java D.java DemoTest.java Detail.java DoubleStringType.java Fee.java Fo.java Foo.java FooBarTest.java FooComponent.java FooProxy.java FooStatus.java Fum.java FumCompositeID.java Fumm.java Glarch.java GlarchProxy.java Holder.java Immutable.java LessSimple.java Location.java Many.java Master.java MasterDetailTest.java MoreStuff.java Multi.java MultiTableTest.java Nameable.java Named.java NewPerformanceTest.java ODMGTest.java One.java Parent.java ParentChildTest.java PerformanceTest.java Po.java Qux.java ReverseComparator.java SQLFunctionsTest.java Several.java Simple.java Single.java Stuff.java SubDetail.java SubMulti.java TestCase.java Trivial.java Vetoer.java Log Message: reformatted code with beautiful, shiny, happy TABS! improved an exception Index: A.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/A.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** A.java 1 Jan 2003 13:56:43 -0000 1.1.1.1 --- A.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 5,9 **** private Long id; private String name; ! /** * Returns the id. --- 5,9 ---- private Long id; private String name; ! /** * Returns the id. *************** *** 13,17 **** return id; } ! /** * Returns the name. --- 13,17 ---- return id; } ! /** * Returns the name. *************** *** 21,25 **** return name; } ! /** * Sets the id. --- 21,25 ---- return name; } ! /** * Sets the id. *************** *** 29,33 **** this.id = id; } ! /** * Sets the name. --- 29,33 ---- this.id = id; } ! /** * Sets the name. *************** *** 37,40 **** this.name = name; } ! } --- 37,43 ---- this.name = name; } ! } + + + Index: ABCProxyTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/ABCProxyTest.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ABCProxyTest.java 1 Jan 2003 13:56:43 -0000 1.1.1.1 --- ABCProxyTest.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 14,18 **** super(arg0); } ! public void testSubclassing() throws Exception { Session s = sessions.openSession(); --- 14,18 ---- super(arg0); } ! public void testSubclassing() throws Exception { Session s = sessions.openSession(); *************** *** 37,45 **** t.commit(); s.close(); ! s = sessions.openSession(); t = s.beginTransaction(); B c1b = (B) s.load( B.class, c1.getId() ); ! assertTrue( (c1b.getCount()==23432) && c1b.getName().equals("c1") --- 37,45 ---- t.commit(); s.close(); ! s = sessions.openSession(); t = s.beginTransaction(); B c1b = (B) s.load( B.class, c1.getId() ); ! assertTrue( (c1b.getCount()==23432) && c1b.getName().equals("c1") *************** *** 47,55 **** t.commit(); s.close(); ! s = sessions.openSession(); t = s.beginTransaction(); c1 = (C1) s.load( C1.class, c1.getId() ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && --- 47,55 ---- t.commit(); s.close(); ! s = sessions.openSession(); t = s.beginTransaction(); c1 = (C1) s.load( C1.class, c1.getId() ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && *************** *** 65,69 **** assertTrue( c1a.getName().equals("c1") ); c1 = (C1) s.load( C1.class, c1.getId() ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && --- 65,69 ---- assertTrue( c1a.getName().equals("c1") ); c1 = (C1) s.load( C1.class, c1.getId() ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && *************** *** 72,76 **** ); c1b = (B) s.load( B.class, c1.getId() ); ! assertTrue( (c1b.getCount()==23432) && c1b.getName().equals("c1") --- 72,76 ---- ); c1b = (B) s.load( B.class, c1.getId() ); ! assertTrue( (c1b.getCount()==23432) && c1b.getName().equals("c1") *************** *** 79,83 **** t.commit(); s.close(); ! s = sessions.openSession(); t = s.beginTransaction(); --- 79,83 ---- t.commit(); s.close(); ! s = sessions.openSession(); t = s.beginTransaction(); *************** *** 85,89 **** assertTrue( c1a.getName().equals("c1") ); c1 = (C1) s.load( C1.class, c1.getId(), LockMode.UPGRADE ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && --- 85,89 ---- assertTrue( c1a.getName().equals("c1") ); c1 = (C1) s.load( C1.class, c1.getId(), LockMode.UPGRADE ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && *************** *** 92,96 **** ); c1b = (B) s.load( B.class, c1.getId(), LockMode.UPGRADE ); ! assertTrue( (c1b.getCount()==23432) && c1b.getName().equals("c1") --- 92,96 ---- ); c1b = (B) s.load( B.class, c1.getId(), LockMode.UPGRADE ); ! assertTrue( (c1b.getCount()==23432) && c1b.getName().equals("c1") *************** *** 99,103 **** t.commit(); s.close(); ! s = sessions.openSession(); t = s.beginTransaction(); --- 99,103 ---- t.commit(); s.close(); ! s = sessions.openSession(); t = s.beginTransaction(); *************** *** 106,110 **** c1b = (B) s.load( B.class, c1.getId() ); assertTrue( c1a.getName().equals("c1") ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && --- 106,110 ---- c1b = (B) s.load( B.class, c1.getId() ); assertTrue( c1a.getName().equals("c1") ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && *************** *** 112,116 **** c1.getD().getAmount()>213.3f ); ! assertTrue( (c1b.getCount()==23432) && c1b.getName().equals("c1") --- 112,116 ---- c1.getD().getAmount()>213.3f ); ! assertTrue( (c1b.getCount()==23432) && c1b.getName().equals("c1") *************** *** 118,122 **** t.commit(); s.close(); ! } --- 118,122 ---- t.commit(); s.close(); ! } *************** *** 132,135 **** --- 132,138 ---- } } + + + Index: ABCTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/ABCTest.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ABCTest.java 1 Jan 2003 13:56:43 -0000 1.1.1.1 --- ABCTest.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 14,18 **** super(arg0); } ! public void testSubclassing() throws Exception { Session s = sessions.openSession(); --- 14,18 ---- super(arg0); } ! public void testSubclassing() throws Exception { Session s = sessions.openSession(); *************** *** 37,41 **** t = s.beginTransaction(); c1 = (C1) s.load( A.class, c1.getId() ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && --- 37,41 ---- t = s.beginTransaction(); c1 = (C1) s.load( A.class, c1.getId() ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && *************** *** 45,53 **** t.commit(); s.close(); ! s = sessions.openSession(); t = s.beginTransaction(); c1 = (C1) s.load( B.class, c1.getId() ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && --- 45,53 ---- t.commit(); s.close(); ! s = sessions.openSession(); t = s.beginTransaction(); c1 = (C1) s.load( B.class, c1.getId() ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && *************** *** 57,65 **** t.commit(); s.close(); ! s = sessions.openSession(); t = s.beginTransaction(); c1 = (C1) s.load( C1.class, c1.getId() ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && --- 57,65 ---- t.commit(); s.close(); ! s = sessions.openSession(); t = s.beginTransaction(); c1 = (C1) s.load( C1.class, c1.getId() ); ! assertTrue( c1.getAddress().equals("foo bar") && (c1.getCount()==23432) && *************** *** 82,85 **** --- 82,88 ---- } } + + + Index: Abstract.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Abstract.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Abstract.java 1 Jan 2003 13:56:43 -0000 1.1.1.1 --- Abstract.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 5,27 **** public abstract class Abstract extends Foo implements AbstractProxy { ! private java.sql.Time time; private Set abstracts; ! public java.sql.Time getTime() { return time; } ! public void setTime(java.sql.Time time) { this.time = time; } ! public Set getAbstracts() { return abstracts; } ! public void setAbstracts(Set abstracts) { this.abstracts = abstracts; } ! } --- 5,30 ---- public abstract class Abstract extends Foo implements AbstractProxy { ! private java.sql.Time time; private Set abstracts; ! public java.sql.Time getTime() { return time; } ! public void setTime(java.sql.Time time) { this.time = time; } ! public Set getAbstracts() { return abstracts; } ! public void setAbstracts(Set abstracts) { this.abstracts = abstracts; } ! } + + + Index: AbstractProxy.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/AbstractProxy.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** AbstractProxy.java 1 Jan 2003 13:56:44 -0000 1.1.1.1 --- AbstractProxy.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 6,8 **** public void setTime(java.sql.Time arg0); public java.sql.Time getTime(); ! } \ No newline at end of file --- 6,10 ---- public void setTime(java.sql.Time arg0); public java.sql.Time getTime(); ! } ! ! Index: B.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/B.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** B.java 1 Jan 2003 13:56:45 -0000 1.1.1.1 --- B.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 11,15 **** return count; } ! /** * Sets the count. --- 11,15 ---- return count; } ! /** * Sets the count. *************** *** 19,22 **** this.count = count; } ! } --- 19,25 ---- this.count = count; } ! } + + + Index: Bar.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Bar.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Bar.java 1 Jan 2003 13:56:45 -0000 1.1.1.1 --- Bar.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 6,30 **** private FooComponent barComponent = new FooComponent("bar", 69, null, null); private Baz baz; ! public String getBarString() { return barString; } ! void setBarString(String barString) { this.barString = barString; } ! public FooComponent getBarComponent() { return barComponent; } ! public void setBarComponent(FooComponent barComponent) { this.barComponent = barComponent; } ! public Baz getBaz() { return baz; } ! public void setBaz(Baz baz) { this.baz = baz; --- 6,30 ---- private FooComponent barComponent = new FooComponent("bar", 69, null, null); private Baz baz; ! public String getBarString() { return barString; } ! void setBarString(String barString) { this.barString = barString; } ! public FooComponent getBarComponent() { return barComponent; } ! public void setBarComponent(FooComponent barComponent) { this.barComponent = barComponent; } ! public Baz getBaz() { return baz; } ! public void setBaz(Baz baz) { this.baz = baz; *************** *** 32,44 **** public String name = "bar"; ! public String getName() { return name; } ! public void setName(String name) { this.name = name; } ! } --- 32,47 ---- public String name = "bar"; ! public String getName() { return name; } ! public void setName(String name) { this.name = name; } ! } + + + Index: BarProxy.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/BarProxy.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** BarProxy.java 1 Jan 2003 13:56:45 -0000 1.1.1.1 --- BarProxy.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 9,11 **** //public void setBarString(String arg0); public String getBarString(); ! } \ No newline at end of file --- 9,13 ---- //public void setBarString(String arg0); public String getBarString(); ! } ! ! Index: BasicNameable.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/BasicNameable.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** BasicNameable.java 1 Jan 2003 13:56:45 -0000 1.1.1.1 --- BasicNameable.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 11,15 **** private String name; private Long id; ! /** * @see net.sf.hibernate.test.Nameable#getName() --- 11,15 ---- private String name; private Long id; ! /** * @see net.sf.hibernate.test.Nameable#getName() *************** *** 18,22 **** return name; } ! /** * @see net.sf.hibernate.test.Nameable#setName() --- 18,22 ---- return name; } ! /** * @see net.sf.hibernate.test.Nameable#setName() *************** *** 25,29 **** name = n; } ! /** * @see net.sf.hibernate.test.Nameable#getKey() --- 25,29 ---- name = n; } ! /** * @see net.sf.hibernate.test.Nameable#getKey() *************** *** 32,36 **** return id; } ! /** * @see net.sf.hibernate.test.Nameable#setKey() --- 32,36 ---- return id; } ! /** * @see net.sf.hibernate.test.Nameable#setKey() *************** *** 39,42 **** id = k; } ! } --- 39,45 ---- id = k; } ! } + + + Index: Baz.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Baz.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Baz.java 1 Jan 2003 13:56:46 -0000 1.1.1.1 --- Baz.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 66,70 **** this.stringArray = stringArray; } ! public String getCode() { return Code; --- 66,70 ---- this.stringArray = stringArray; } ! public String getCode() { return Code; *************** *** 93,101 **** customs.add( new String[] { "A", "B" } ); customs.add( new String[] { "1", "2" } ); ! fooSet = new HashSet(); ! components = new FooComponent[] { ! new FooComponent("foo", 42, null, null), ! new FooComponent("bar", 88, null, new FooComponent("sub", 69, null, null) ) }; timeArray = new Date[] { new Date(), new Date(), null, new Date(0) }; --- 93,101 ---- customs.add( new String[] { "A", "B" } ); customs.add( new String[] { "1", "2" } ); ! fooSet = new HashSet(); ! components = new FooComponent[] { ! new FooComponent("foo", 42, null, null), ! new FooComponent("bar", 88, null, new FooComponent("sub", 69, null, null) ) }; timeArray = new Date[] { new Date(), new Date(), null, new Date(0) }; *************** *** 104,108 **** TreeSet a = new TreeSet(); a.add("a"); a.add("b"); a.add("d"); a.add("c"); ! count = 667; name="Bazza"; --- 104,108 ---- TreeSet a = new TreeSet(); a.add("a"); a.add("b"); a.add("d"); a.add("c"); ! count = 667; name="Bazza"; *************** *** 117,121 **** bag.add("unique"); } ! public List getCustoms() { return customs; --- 117,121 ---- bag.add("unique"); } ! public List getCustoms() { return customs; *************** *** 124,128 **** this.customs = customs; } ! public Set getFooSet() { return fooSet; --- 124,128 ---- this.customs = customs; } ! public Set getFooSet() { return fooSet; *************** *** 131,135 **** this.fooSet = fooSet; } ! public FooComponent[] getComponents() { return components; --- 131,135 ---- this.fooSet = fooSet; } ! public FooComponent[] getComponents() { return components; *************** *** 138,162 **** this.components = components; } ! public Date[] getTimeArray() { return timeArray; } ! public void setTimeArray(Date[] timeArray) { this.timeArray = timeArray; } ! public int getCount() { return count; } ! public void setCount(int count) { this.count = count; } ! public String getName() { return name; } ! public void setName(String name) { this.name = name; --- 138,162 ---- this.components = components; } ! public Date[] getTimeArray() { return timeArray; } ! public void setTimeArray(Date[] timeArray) { this.timeArray = timeArray; } ! public int getCount() { return count; } ! public void setCount(int count) { this.count = count; } ! public String getName() { return name; } ! public void setName(String name) { this.name = name; *************** *** 166,231 **** return topComponents; } ! public void setTopComponents(List topComponents) { this.topComponents = topComponents; } ! public Collection getBag() { return bag; } ! public void setBag(Collection bag) { this.bag = bag; } ! public Set getTopFoos() { return topFoos; } ! public void setTopFoos(Set topFoos) { this.topFoos = topFoos; } ! ! public Map getTopGlarchez() { return topGlarchez; } ! public void setTopGlarchez(Map topGlarchez) { this.topGlarchez = topGlarchez; } ! public Set getCascadingBars() { return cascadingBars; } ! public void setCascadingBars(Set cascadingBars) { this.cascadingBars = cascadingBars; } ! public Map getFooToGlarch() { return fooToGlarch; } ! public void setFooToGlarch(Map fooToGlarch) { this.fooToGlarch = fooToGlarch; } ! public Map getFooComponentToFoo() { return fooComponentToFoo; } ! public void setFooComponentToFoo(Map fooComponentToFoo) { this.fooComponentToFoo = fooComponentToFoo; } ! public Map getGlarchToFoo() { return glarchToFoo; } ! public void setGlarchToFoo(Map glarchToFoo) { this.glarchToFoo = glarchToFoo; } ! } --- 166,234 ---- return topComponents; } ! public void setTopComponents(List topComponents) { this.topComponents = topComponents; } ! public Collection getBag() { return bag; } ! public void setBag(Collection bag) { this.bag = bag; } ! public Set getTopFoos() { return topFoos; } ! public void setTopFoos(Set topFoos) { this.topFoos = topFoos; } ! ! public Map getTopGlarchez() { return topGlarchez; } ! public void setTopGlarchez(Map topGlarchez) { this.topGlarchez = topGlarchez; } ! public Set getCascadingBars() { return cascadingBars; } ! public void setCascadingBars(Set cascadingBars) { this.cascadingBars = cascadingBars; } ! public Map getFooToGlarch() { return fooToGlarch; } ! public void setFooToGlarch(Map fooToGlarch) { this.fooToGlarch = fooToGlarch; } ! public Map getFooComponentToFoo() { return fooComponentToFoo; } ! public void setFooComponentToFoo(Map fooComponentToFoo) { this.fooComponentToFoo = fooComponentToFoo; } ! public Map getGlarchToFoo() { return glarchToFoo; } ! public void setGlarchToFoo(Map glarchToFoo) { this.glarchToFoo = glarchToFoo; } ! } + + + Index: C1.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/C1.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** C1.java 1 Jan 2003 13:56:46 -0000 1.1.1.1 --- C1.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 12,16 **** return address; } ! /** * Sets the address. --- 12,16 ---- return address; } ! /** * Sets the address. *************** *** 20,24 **** this.address = address; } ! /** * Returns the d. --- 20,24 ---- this.address = address; } ! /** * Returns the d. *************** *** 28,32 **** return d; } ! /** * Sets the d. --- 28,32 ---- return d; } ! /** * Sets the d. *************** *** 36,39 **** this.d = d; } ! } --- 36,42 ---- this.d = d; } ! } + + + Index: C2.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/C2.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** C2.java 1 Jan 2003 13:56:46 -0000 1.1.1.1 --- C2.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 11,15 **** return address; } ! /** * Sets the address. --- 11,15 ---- return address; } ! /** * Sets the address. *************** *** 19,22 **** this.address = address; } ! } --- 19,25 ---- this.address = address; } ! } + + + Index: Category.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Category.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Category.java 1 Jan 2003 13:56:46 -0000 1.1.1.1 --- Category.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 6,10 **** /** ! * */ public class Category { --- 6,10 ---- /** ! * */ public class Category { *************** *** 22,26 **** return id; } ! /** * Sets the id. --- 22,26 ---- return id; } ! /** * Sets the id. *************** *** 30,34 **** this.id = id; } ! /** * Returns the subcategories. --- 30,34 ---- this.id = id; } ! /** * Returns the subcategories. *************** *** 38,42 **** return subcategories; } ! /** * Sets the subcategories. --- 38,42 ---- return subcategories; } ! /** * Sets the subcategories. *************** *** 46,50 **** this.subcategories = subcategories; } ! /** * Returns the name. --- 46,50 ---- this.subcategories = subcategories; } ! /** * Returns the name. *************** *** 54,58 **** return name; } ! /** * Sets the name. --- 54,58 ---- return name; } ! /** * Sets the name. *************** *** 62,65 **** this.name = name; } ! } --- 62,68 ---- this.name = name; } ! } + + + Index: Child.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Child.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Child.java 1 Jan 2003 13:56:47 -0000 1.1.1.1 --- Child.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 3,7 **** public class Child { ! private Parent parent; private int count; --- 3,7 ---- public class Child { ! private Parent parent; private int count; *************** *** 9,24 **** return parent; } ! ! public void setParent(Parent parent) { this.parent = parent; } ! public int getCount() { return count; } ! ! public void setCount(int count) { this.count = count; --- 9,24 ---- return parent; } ! ! public void setParent(Parent parent) { this.parent = parent; } ! public int getCount() { return count; } ! ! public void setCount(int count) { this.count = count; *************** *** 30,34 **** private void setId(long id) { } ! } --- 30,37 ---- private void setId(long id) { } ! } + + + Index: Circular.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Circular.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Circular.java 1 Jan 2003 13:56:47 -0000 1.1.1.1 --- Circular.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 15,19 **** super(); } ! /** * Returns the clazz. --- 15,19 ---- super(); } ! /** * Returns the clazz. *************** *** 23,27 **** return clazz; } ! /** * Returns the id. --- 23,27 ---- return clazz; } ! /** * Returns the id. *************** *** 31,35 **** return id; } ! /** * Sets the clazz. --- 31,35 ---- return id; } ! /** * Sets the clazz. *************** *** 39,43 **** this.clazz = clazz; } ! /** * Sets the id. --- 39,43 ---- this.clazz = clazz; } ! /** * Sets the id. *************** *** 47,51 **** this.id = id; } ! /** * Returns the other. --- 47,51 ---- this.id = id; } ! /** * Returns the other. *************** *** 55,59 **** return other; } ! /** * Sets the other. --- 55,59 ---- return other; } ! /** * Sets the other. *************** *** 63,67 **** this.other = other; } ! /** * Returns the anyEntity. --- 63,67 ---- this.other = other; } ! /** * Returns the anyEntity. *************** *** 71,75 **** return anyEntity; } ! /** * Sets the anyEntity. --- 71,75 ---- return anyEntity; } ! /** * Sets the anyEntity. *************** *** 79,82 **** this.anyEntity = anyEntity; } ! } --- 79,85 ---- this.anyEntity = anyEntity; } ! } + + + Index: Contained.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Contained.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Contained.java 1 Jan 2003 13:56:47 -0000 1.1.1.1 --- Contained.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 17,21 **** return new Long(id).hashCode(); } ! /** * Returns the container. --- 17,21 ---- return new Long(id).hashCode(); } ! /** * Returns the container. *************** *** 25,29 **** return container; } ! /** * Returns the id. --- 25,29 ---- return container; } ! /** * Returns the id. *************** *** 33,37 **** return id; } ! /** * Sets the container. --- 33,37 ---- return id; } ! /** * Sets the container. *************** *** 41,45 **** this.container = container; } ! /** * Sets the id. --- 41,45 ---- this.container = container; } ! /** * Sets the id. *************** *** 49,53 **** this.id = id; } ! /** * Returns the bag. --- 49,53 ---- this.id = id; } ! /** * Returns the bag. *************** *** 57,61 **** return bag; } ! /** * Sets the bag. --- 57,61 ---- return bag; } ! /** * Sets the bag. *************** *** 65,69 **** this.bag = bag; } ! /** * Returns the lazyBag. --- 65,69 ---- this.bag = bag; } ! /** * Returns the lazyBag. *************** *** 73,77 **** return lazyBag; } ! /** * Sets the lazyBag. --- 73,77 ---- return lazyBag; } ! /** * Sets the lazyBag. *************** *** 81,84 **** this.lazyBag = lazyBag; } ! } --- 81,87 ---- this.lazyBag = lazyBag; } ! } + + + Index: Container.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Container.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Container.java 1 Jan 2003 13:56:48 -0000 1.1.1.1 --- Container.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 15,23 **** private One one; private Many many; ! public void setSimple(Simple simple) { this.simple = simple; } ! public Simple getSimple() { return simple; --- 15,23 ---- private One one; private Many many; ! public void setSimple(Simple simple) { this.simple = simple; } ! public Simple getSimple() { return simple; *************** *** 30,34 **** return name; } ! /** * Sets the name. --- 30,34 ---- return name; } ! /** * Sets the name. *************** *** 41,49 **** public String toString() { return name + " = " + simple.getCount() ! + "/" + ( one==null ? "nil" : Long.toString( one.getKey() ) ) ! + "/" + ( many==null ? "nil" : Long.toString( many.getKey() ) ); } ! ! /** * Returns the one. --- 41,49 ---- public String toString() { return name + " = " + simple.getCount() ! + "/" + ( one==null ? "nil" : Long.toString( one.getKey() ) ) ! + "/" + ( many==null ? "nil" : Long.toString( many.getKey() ) ); } ! ! /** * Returns the one. *************** *** 53,57 **** return one; } ! /** * Sets the one. --- 53,57 ---- return one; } ! /** * Sets the one. *************** *** 61,65 **** this.one = one; } ! /** * Returns the many. --- 61,65 ---- this.one = one; } ! /** * Returns the many. *************** *** 69,73 **** return many; } ! /** * Sets the many. --- 69,73 ---- return many; } ! /** * Sets the many. *************** *** 77,81 **** this.many = many; } ! } --- 77,81 ---- this.many = many; } ! } *************** *** 89,93 **** private Map ternaryMap; private Set ternarySet; ! /** * Constructor for Container. --- 89,93 ---- private Map ternaryMap; private Set ternarySet; ! /** * Constructor for Container. *************** *** 96,100 **** super(); } ! /** * Returns the components. --- 96,100 ---- super(); } ! /** * Returns the components. *************** *** 104,108 **** return components; } ! /** * Returns the manyToMany. --- 104,108 ---- return components; } ! /** * Returns the manyToMany. *************** *** 112,116 **** return manyToMany; } ! /** * Returns the oneToMany. --- 112,116 ---- return manyToMany; } ! /** * Returns the oneToMany. *************** *** 120,124 **** return oneToMany; } ! /** * Sets the components. --- 120,124 ---- return oneToMany; } ! /** * Sets the components. *************** *** 128,132 **** this.components = components; } ! /** * Sets the manyToMany. --- 128,132 ---- this.components = components; } ! /** * Sets the manyToMany. *************** *** 136,140 **** this.manyToMany = manyToMany; } ! /** * Sets the oneToMany. --- 136,140 ---- this.manyToMany = manyToMany; } ! /** * Sets the oneToMany. *************** *** 144,148 **** this.oneToMany = oneToMany; } ! /** * Returns the id. --- 144,148 ---- this.oneToMany = oneToMany; } ! /** * Returns the id. *************** *** 152,156 **** return id; } ! /** * Sets the id. --- 152,156 ---- return id; } ! /** * Sets the id. *************** *** 160,164 **** this.id = id; } ! /** * Gets the composites. --- 160,164 ---- this.id = id; } ! /** * Gets the composites. *************** *** 168,172 **** return composites; } ! /** * Sets the composites. --- 168,172 ---- return composites; } ! /** * Sets the composites. *************** *** 176,180 **** this.composites = composites; } ! /** * Returns the bag. --- 176,180 ---- this.composites = composites; } ! /** * Returns the bag. *************** *** 184,188 **** return bag; } ! /** * Sets the bag. --- 184,188 ---- return bag; } ! /** * Sets the bag. *************** *** 192,196 **** this.bag = bag; } ! /** * Returns the ternary. --- 192,196 ---- this.bag = bag; } ! /** * Returns the ternary. *************** *** 200,204 **** return ternaryMap; } ! /** * Sets the ternary. --- 200,204 ---- return ternaryMap; } ! /** * Sets the ternary. *************** *** 220,224 **** return foo; } ! /** * Returns the glarch. --- 220,224 ---- return foo; } ! /** * Returns the glarch. *************** *** 228,232 **** return glarch; } ! /** * Returns the name. --- 228,232 ---- return glarch; } ! /** * Returns the name. *************** *** 236,240 **** return name; } ! /** * Sets the foo. --- 236,240 ---- return name; } ! /** * Sets the foo. *************** *** 244,248 **** this.foo = foo; } ! /** * Sets the glarch. --- 244,248 ---- this.foo = foo; } ! /** * Sets the glarch. *************** *** 252,256 **** this.glarch = glarch; } ! /** * Sets the name. --- 252,256 ---- this.glarch = glarch; } ! /** * Sets the name. *************** *** 260,266 **** this.name = name; } ! } ! /** * Returns the ternarySet. --- 260,266 ---- this.name = name; } ! } ! /** * Returns the ternarySet. *************** *** 270,274 **** return ternarySet; } ! /** * Sets the ternarySet. --- 270,274 ---- return ternarySet; } ! /** * Sets the ternarySet. *************** *** 278,282 **** this.ternarySet = ternarySet; } ! /** * Returns the lazyBag. --- 278,282 ---- this.ternarySet = ternarySet; } ! /** * Returns the lazyBag. *************** *** 286,290 **** return lazyBag; } ! /** * Sets the lazyBag. --- 286,290 ---- return lazyBag; } ! /** * Sets the lazyBag. *************** *** 294,297 **** this.lazyBag = lazyBag; } ! } --- 294,300 ---- this.lazyBag = lazyBag; } ! } + + + Index: Custom.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Custom.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Custom.java 1 Jan 2003 13:56:49 -0000 1.1.1.1 --- Custom.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 16,17 **** --- 16,20 ---- } } + + + Index: CustomPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/CustomPersister.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** CustomPersister.java 1 Jan 2003 13:56:49 -0000 1.1.1.1 --- CustomPersister.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 32,43 **** public CustomPersister(PersistentClass model, SessionFactoryImplementor factory) {} ! /** * @see net.sf.hibernate.persister.ClassPersister#postInstantiate(SessionFactoryImplementor) */ public void postInstantiate(SessionFactoryImplementor factory) ! throws MappingException { } ! /** * @see net.sf.hibernate.persister.ClassPersister#getMappedClass() --- 32,43 ---- public CustomPersister(PersistentClass model, SessionFactoryImplementor factory) {} ! /** * @see net.sf.hibernate.persister.ClassPersister#postInstantiate(SessionFactoryImplementor) */ public void postInstantiate(SessionFactoryImplementor factory) ! throws MappingException { } ! /** * @see net.sf.hibernate.persister.ClassPersister#getMappedClass() *************** *** 46,50 **** return Custom.class; } ! /** * @see net.sf.hibernate.persister.ClassPersister#getClassName() --- 46,50 ---- return Custom.class; } ! /** * @see net.sf.hibernate.persister.ClassPersister#getClassName() *************** *** 53,57 **** return Custom.class.getName(); } ! /** * @see net.sf.hibernate.persister.ClassPersister#hasCompositeKey() --- 53,57 ---- return Custom.class.getName(); } ! /** * @see net.sf.hibernate.persister.ClassPersister#hasCompositeKey() *************** *** 60,64 **** return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#implementsPersistentLifecycle() --- 60,64 ---- return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#implementsPersistentLifecycle() *************** *** 67,71 **** return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#implementsLifecycle() --- 67,71 ---- return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#implementsLifecycle() *************** *** 74,78 **** return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#implementsValidatable() --- 74,78 ---- return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#implementsValidatable() *************** *** 81,85 **** return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#hasProxy() --- 81,85 ---- return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#hasProxy() *************** *** 88,92 **** return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#getProxyInterfaces() --- 88,92 ---- return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#getProxyInterfaces() *************** *** 95,99 **** return null; } ! /** * @see net.sf.hibernate.persister.ClassPersister#hasCollections() --- 95,99 ---- return null; } ! /** * @see net.sf.hibernate.persister.ClassPersister#hasCollections() *************** *** 102,106 **** return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#hasCascades() --- 102,106 ---- return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#hasCascades() *************** *** 109,113 **** return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#isMutable() --- 109,113 ---- return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#isMutable() *************** *** 116,120 **** return true; } ! /** * @see net.sf.hibernate.persister.ClassPersister#isIdentifierAssignedByInsert() --- 116,120 ---- return true; } ! /** * @see net.sf.hibernate.persister.ClassPersister#isIdentifierAssignedByInsert() *************** *** 123,127 **** return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#isUnsaved(Serializable) --- 123,127 ---- return false; } ! /** * @see net.sf.hibernate.persister.ClassPersister#isUnsaved(Serializable) *************** *** 130,169 **** return ( (Long) id ).longValue()==0; } ! /** * @see net.sf.hibernate.persister.ClassPersister#setPropertyValues(Object, Object[]) */ public void setPropertyValues(Object object, Object[] values) ! throws HibernateException { ! Custom c = (Custom) object; ! c.name = (String) values[0]; } ! /** * @see net.sf.hibernate.persister.ClassPersister#getPropertyValues(Object) */ public Object[] getPropertyValues(Object object) ! throws HibernateException { Custom c = (Custom) object; return new Object[] { c.name }; } ! /** * @see net.sf.hibernate.persister.ClassPersister#getPropertyValue(Object, int) */ public Object getPropertyValue(Object obj, int i) ! throws HibernateException { return ( (Custom) obj ).name; } ! /** * @see net.sf.hibernate.persister.ClassPersister#setPropertyValue(Object, int, Object) */ public void setPropertyValue(Object obj, int i, Object val) ! throws HibernateException { ( (Custom) obj ).name = (String) val; } ! /** * @see net.sf.hibernate.persister.ClassPersister#isDirty(Object[], Object[], Object, SessionImplementor) --- 130,169 ---- return ( (Long) id ).longValue()==0; } ! /** * @see net.sf.hibernate.persister.ClassPersister#setPropertyValues(Object, Object[]) */ public void setPropertyValues(Object object, Object[] values) ! throws HibernateException { ! Custom c = (Custom) object; ! c.name = (String) values[0]; } ! /** * @see net.sf.hibernate.persister.ClassPersister#getPropertyValues(Object) */ public Object[] getPropertyValues(Object object) ! throws HibernateException { Custom c = (Custom) object; return new Object[] { c.name }; } ! /** * @see net.sf.hibernate.persister.ClassPersister#getPropertyValue(Object, int) */ public Object getPropertyValue(Object obj, int i) ! throws HibernateException { return ( (Custom) obj ).name; } ! /** * @see net.sf.hibernate.persister.ClassPersister#setPropertyValue(Object, int, Object) */ public void setPropertyValue(Object obj, int i, Object val) ! throws HibernateException { ( (Custom) obj ).name = (String) val; } ! /** * @see net.sf.hibernate.persister.ClassPersister#isDirty(Object[], Object[], Object, SessionImplementor) *************** *** 175,436 **** SessionImplementor session) throws HibernateException { ! if ( !ObjectUtils.equals( x[0], y[0] ) ) { ! return new int[] { 0 }; } ! else { ! return null; } ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#hasIdentifierProperty() ! */ ! public boolean hasIdentifierProperty() { ! return true; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getIdentifier(Object) ! */ ! public Serializable getIdentifier(Object object) throws HibernateException { ! return new Long( ( (Custom) object ).id ); ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#setIdentifier(Object, Serializable) ! */ ! public void setIdentifier(Object object, Serializable id) throws HibernateException { ! ( (Custom) object ).id = ( (Long) id ).longValue(); ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getProxyGetIdentifierMethod() ! */ ! public Method getProxyGetIdentifierMethod() { ! return null; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#isVersioned() ! */ ! public boolean isVersioned() { ! return false; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getVersionType() ! */ ! public VersionType getVersionType() { ! return null; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getVersionProperty() ! */ ! public int getVersionProperty() { ! return 0; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getVersion(Object) ! */ ! public Object getVersion(Object object) throws HibernateException { ! return null; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#instantiate(Serializable) ! */ ! public Object instantiate(Serializable id) throws HibernateException { ! Custom c = new Custom(); ! c.id = ( (Long) id ).longValue(); ! return c; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getIdentifierGenerator() ! */ ! public IdentifierGenerator getIdentifierGenerator() ! throws HibernateException { ! return idgen; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#load(Serializable, Object, boolean, SessionImplementor) ! */ ! public Object load( ! Serializable id, ! Object optionalObject, ! LockMode lockMode, ! SessionImplementor session) ! throws HibernateException, SQLException { ! // fails when optional object is supplied ! Custom clone = null; ! Custom obj = (Custom) instances.get(id); ! if (obj!=null) { ! clone = (Custom) obj.clone(); ! session.addUninitializedEntity( new Key(id, this), clone, LockMode.NONE ); ! session.postHydrate(this, id, new String[] { obj.name }, clone, LockMode.NONE); ! session.initializeEntity(clone); } - return clone; - } - - /** - * @see net.sf.hibernate.persister.ClassPersister#lockForUpdate(Serializable, Object, SessionImplementor) - */ - public void lock( - Serializable id, - Object version, - Object object, - LockMode lockMode, - SessionImplementor session) - throws HibernateException, SQLException { - - throw new UnsupportedOperationException(); - } - - /** - * @see net.sf.hibernate.persister.ClassPersister#insert(Serializable, Object[], SessionImplementor) - */ - public void insert( - Serializable id, - Object[] fields, - Object object, - SessionImplementor session) - throws SQLException, HibernateException { - - instances.put(id, ( (Custom) object ).clone() ); - } - - /** - * @see net.sf.hibernate.persister.ClassPersister#insert(Object[], SessionImplementor) - */ - public Serializable insert(Object[] fields, Object object, SessionImplementor session) - throws SQLException, HibernateException { - - throw new UnsupportedOperationException(); - } - - /** - * @see net.sf.hibernate.persister.ClassPersister#delete(Serializable, Object, SessionImplementor) - */ - public void delete( - Serializable id, - Object version, - Object object, - SessionImplementor session) - throws SQLException, HibernateException { ! instances.remove(id); ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#update(Serializable, Object[], Object, SessionImplementor) ! */ ! public void update( ! Serializable id, ! Object[] fields, ! int[] dirtyFields, ! Object oldVersion, ! Object object, ! SessionImplementor session) ! throws SQLException, HibernateException { ! instances.put( id, ( (Custom) object ).clone() ); ! } ! ! Type[] TYPES = new Type[] { Hibernate.STRING }; ! String[] NAMES = new String[] { "name" }; ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getPropertyTypes() ! */ ! public Type[] getPropertyTypes() { ! return TYPES; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getPropertyNames() ! */ ! public String[] getPropertyNames() { ! return NAMES; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getPropertyCascadeStyles() ! */ ! public Cascades.CascadeStyle[] getPropertyCascadeStyles() { ! return null; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getIdentifierType() ! */ ! public Type getIdentifierType() { ! return Hibernate.LONG; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getIdentifierPropertyName() ! */ ! public String getIdentifierPropertyName() { ! return "id"; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#hasCache() ! */ ! public boolean hasCache() { ! return false; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getCache() ! */ ! public CacheConcurrencyStrategy getCache() { ! return null; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getIdentifierSpace() ! */ ! public Serializable getIdentifierSpace() { ! return "CUSTOMS"; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getPropertySpaces(Object) ! */ ! public Serializable[] getPropertySpaces(Object instance) { ! return new String[] { "CUSTOMS" }; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getClassMetadata() ! */ ! public ClassMetadata getClassMetadata() { ! return null; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#hasSubclasses() ! */ ! public boolean hasSubclasses() { ! return false; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getConcreteProxyClass() ! */ ! public Class getConcreteProxyClass() { ! return Custom.class; ! } ! ! } --- 175,439 ---- SessionImplementor session) throws HibernateException { ! if ( !ObjectUtils.equals( x[0], y[0] ) ) { ! return new int[] { 0 }; ! } ! else { ! return null; ! } } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#hasIdentifierProperty() ! */ ! public boolean hasIdentifierProperty() { ! return true; } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getIdentifier(Object) ! */ ! public Serializable getIdentifier(Object object) throws HibernateException { ! return new Long( ( (Custom) object ).id ); ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#setIdentifier(Object, Serializable) ! */ ! public void setIdentifier(Object object, Serializable id) throws HibernateException { ! ( (Custom) object ).id = ( (Long) id ).longValue(); ! } ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getProxyGetIdentifierMethod() ! */ ! public Method getProxyGetIdentifierMethod() { ! return null; ! } ! /** ! * @see net.sf.hibernate.persister.ClassPersister#isVersioned() ! */ ! public boolean isVersioned() { ! return false; } ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getVersionType() ! */ ! public VersionType getVersionType() { ! return null; ! } ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getVersionProperty() ! */ ! public int getVersionProperty() { ! return 0; ! } ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getVersion(Object) ! */ ! public Object getVersion(Object object) throws HibernateException { ! return null; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#instantiate(Serializable) ! */ ! public Object instantiate(Serializable id) throws HibernateException { ! Custom c = new Custom(); ! c.id = ( (Long) id ).longValue(); ! return c; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getIdentifierGenerator() ! */ ! public IdentifierGenerator getIdentifierGenerator() ! throws HibernateException { ! return idgen; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#load(Serializable, Object, boolean, SessionImplementor) ! */ ! public Object load( ! Serializable id, ! Object optionalObject, ! LockMode lockMode, ! SessionImplementor session) ! throws HibernateException, SQLException { ! ! // fails when optional object is supplied ! ! Custom clone = null; ! Custom obj = (Custom) instances.get(id); ! if (obj!=null) { ! clone = (Custom) obj.clone(); ! session.addUninitializedEntity( new Key(id, this), clone, LockMode.NONE ); ! session.postHydrate(this, id, new String[] { obj.name }, clone, LockMode.NONE); ! session.initializeEntity(clone); ! } ! return clone; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#lockForUpdate(Serializable, Object, SessionImplementor) ! */ ! public void lock( ! Serializable id, ! Object version, ! Object object, ! LockMode lockMode, ! SessionImplementor session) ! throws HibernateException, SQLException { ! ! throw new UnsupportedOperationException(); ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#insert(Serializable, Object[], SessionImplementor) ! */ ! public void insert( ! Serializable id, ! Object[] fields, ! Object object, ! SessionImplementor session) ! throws SQLException, HibernateException { ! ! instances.put(id, ( (Custom) object ).clone() ); ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#insert(Object[], SessionImplementor) ! */ ! public Serializable insert(Object[] fields, Object object, SessionImplementor session) ! throws SQLException, HibernateException { ! ! throw new UnsupportedOperationException(); ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#delete(Serializable, Object, SessionImplementor) ! */ ! public void delete( ! Serializable id, ! Object version, ! Object object, ! SessionImplementor session) ! throws SQLException, HibernateException { ! ! instances.remove(id); ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#update(Serializable, Object[], Object, SessionImplementor) ! */ ! public void update( ! Serializable id, ! Object[] fields, ! int[] dirtyFields, ! Object oldVersion, ! Object object, ! SessionImplementor session) ! throws SQLException, HibernateException { ! ! instances.put( id, ( (Custom) object ).clone() ); ! ! } ! ! Type[] TYPES = new Type[] { Hibernate.STRING }; ! String[] NAMES = new String[] { "name" }; ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getPropertyTypes() ! */ ! public Type[] getPropertyTypes() { ! return TYPES; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getPropertyNames() ! */ ! public String[] getPropertyNames() { ! return NAMES; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getPropertyCascadeStyles() ! */ ! public Cascades.CascadeStyle[] getPropertyCascadeStyles() { ! return null; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getIdentifierType() ! */ ! public Type getIdentifierType() { ! return Hibernate.LONG; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getIdentifierPropertyName() ! */ ! public String getIdentifierPropertyName() { ! return "id"; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#hasCache() ! */ ! public boolean hasCache() { ! return false; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getCache() ! */ ! public CacheConcurrencyStrategy getCache() { ! return null; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getIdentifierSpace() ! */ ! public Serializable getIdentifierSpace() { ! return "CUSTOMS"; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getPropertySpaces(Object) ! */ ! public Serializable[] getPropertySpaces(Object instance) { ! return new String[] { "CUSTOMS" }; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getClassMetadata() ! */ ! public ClassMetadata getClassMetadata() { ! return null; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#hasSubclasses() ! */ ! public boolean hasSubclasses() { ! return false; ! } ! ! /** ! * @see net.sf.hibernate.persister.ClassPersister#getConcreteProxyClass() ! */ ! public Class getConcreteProxyClass() { ! return Custom.class; ! } ! ! } ! ! ! Index: D.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/D.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** D.java 1 Jan 2003 13:56:51 -0000 1.1.1.1 --- D.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 11,15 **** return amount; } ! /** * Returns the id. --- 11,15 ---- return amount; } ! /** * Returns the id. *************** *** 19,23 **** return id; } ! /** * Sets the amount. --- 19,23 ---- return id; } ! /** * Sets the amount. *************** *** 27,31 **** this.amount = amount; } ! /** * Sets the id. --- 27,31 ---- this.amount = amount; } ! /** * Sets the id. *************** *** 35,38 **** this.id = id; } ! } --- 35,41 ---- this.id = id; } ! } + + + Index: DemoTest.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/DemoTest.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** DemoTest.java 1 Jan 2003 13:56:51 -0000 1.1.1.1 --- DemoTest.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 6,10 **** public class DemoTest extends TestCase { ! public DemoTest(String arg0) { super(arg0); --- 6,10 ---- public class DemoTest extends TestCase { ! public DemoTest(String arg0) { super(arg0); *************** *** 40,46 **** } ! ! public static void main(String[] args) { } } --- 40,49 ---- } ! ! public static void main(String[] args) { } } + + + Index: Detail.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/Detail.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Detail.java 1 Jan 2003 13:56:51 -0000 1.1.1.1 --- Detail.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 14,30 **** return master; } ! public void setMaster(Master master) { this.master = master; } ! public int getI() { return i; } ! public void setI(int i) { this.i = i; } ! /** * Returns the details. --- 14,30 ---- return master; } ! public void setMaster(Master master) { this.master = master; } ! public int getI() { return i; } ! public void setI(int i) { this.i = i; } ! /** * Returns the details. *************** *** 34,38 **** return details; } ! /** * Sets the details. --- 34,38 ---- return details; } ! /** * Sets the details. *************** *** 42,45 **** this.details = details; } ! } --- 42,48 ---- this.details = details; } ! } + + + Index: DoubleStringType.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/test/DoubleStringType.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** DoubleStringType.java 1 Jan 2003 13:56:52 -0000 1.1.1.1 --- DoubleStringType.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 12,26 **** public class DoubleStringType implements UserType { ! private static final int[] TYPES = { Types.VARCHAR, Types.VARCHAR }; ! public int[] sqlTypes() { ! return TYPES; } ! public Class returnedClass() { return String[].class; } ! public boolean equals(Object x, Object y) { if (x==y) return true; --- 12,26 ---- public class DoubleStringType implements UserType { ! private static final int[] TYPES = { Types.VARCHAR, Types.VARCHAR }; ! public int[] sqlTypes() { ! return TYPES; } ! public Class returnedClass() ... [truncated message content] |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util In directory sc8-pr-cvs1:/tmp/cvs-serv14211/src/net/sf/hibernate/util Modified Files: ArrayHelper.java BytesHelper.java DTDEntityResolver.java FastHashMap.java IdentityMap.java JDBCExceptionReporter.java JoinedIterator.java LinkedHashCollectionHelper.java NamingHelper.java PropertiesHelper.java Range.java ReflectHelper.java StringHelper.java XMLHelper.java Log Message: reformatted code with beautiful, shiny, happy TABS! improved an exception Index: ArrayHelper.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util/ArrayHelper.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ArrayHelper.java 1 Jan 2003 13:58:24 -0000 1.1.1.1 --- ArrayHelper.java 4 Jan 2003 11:15:31 -0000 1.2 *************** *** 8,12 **** public final class ArrayHelper { ! public static String[] toStringArray(Object[] objects) { int length=objects.length; --- 8,12 ---- public final class ArrayHelper { ! public static String[] toStringArray(Object[] objects) { int length=objects.length; *************** *** 36,40 **** } ! //Arrays.asList doesn't do primitive arrays public static List toList(Object array) { if ( array instanceof Object[] ) return Arrays.asList( (Object[]) array ); //faster? --- 36,40 ---- } ! //Arrays.asList doesn't do primitive arrays public static List toList(Object array) { if ( array instanceof Object[] ) return Arrays.asList( (Object[]) array ); //faster? *************** *** 71,72 **** --- 71,75 ---- } } + + + Index: BytesHelper.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util/BytesHelper.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** BytesHelper.java 1 Jan 2003 13:58:25 -0000 1.1.1.1 --- BytesHelper.java 4 Jan 2003 11:15:32 -0000 1.2 *************** *** 3,7 **** public final class BytesHelper { ! public static int toInt( byte[] bytes ) { int result = 0; --- 3,7 ---- public final class BytesHelper { ! public static int toInt( byte[] bytes ) { int result = 0; *************** *** 11,19 **** return result; } ! public static short toShort( byte[] bytes ) { ! return (short) ( ( ( - (short) Byte.MIN_VALUE + (short) bytes[0] ) << 8 ) - (short) Byte.MIN_VALUE + (short) bytes[1] ); } ! public static byte[] toBytes(int value) { byte[] result = new byte[4]; --- 11,19 ---- return result; } ! public static short toShort( byte[] bytes ) { ! return (short) ( ( ( - (short) Byte.MIN_VALUE + (short) bytes[0] ) << 8 ) - (short) Byte.MIN_VALUE + (short) bytes[1] ); } ! public static byte[] toBytes(int value) { byte[] result = new byte[4]; *************** *** 24,28 **** return result; } ! public static byte[] toBytes(short value) { byte[] result = new byte[2]; --- 24,28 ---- return result; } ! public static byte[] toBytes(short value) { byte[] result = new byte[2]; *************** *** 43,46 **** System.out.println( Integer.MAX_VALUE / 2 +"=="+ BytesHelper.toInt( BytesHelper.toBytes(Integer.MAX_VALUE / 2) ) ); } ! } --- 43,49 ---- System.out.println( Integer.MAX_VALUE / 2 +"=="+ BytesHelper.toInt( BytesHelper.toBytes(Integer.MAX_VALUE / 2) ) ); } ! } + + + Index: DTDEntityResolver.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util/DTDEntityResolver.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** DTDEntityResolver.java 1 Jan 2003 13:58:25 -0000 1.1.1.1 --- DTDEntityResolver.java 4 Jan 2003 11:15:32 -0000 1.2 *************** *** 15,23 **** private static final String URL = "http://hibernate.sourceforge.net/"; ! public InputSource resolveEntity (String publicId, String systemId) { if ( systemId!=null && systemId.startsWith(URL) ) { log.debug("trying to locate " + systemId + " in classpath under net/sf/hibernate/"); ! // Search for DTD ClassLoader classLoader = this.getClass().getClassLoader(); InputStream dtdStream = classLoader.getResourceAsStream( "net/sf/hibernate/" + systemId.substring( URL.length() ) ); --- 15,23 ---- private static final String URL = "http://hibernate.sourceforge.net/"; ! public InputSource resolveEntity (String publicId, String systemId) { if ( systemId!=null && systemId.startsWith(URL) ) { log.debug("trying to locate " + systemId + " in classpath under net/sf/hibernate/"); ! // Search for DTD ClassLoader classLoader = this.getClass().getClassLoader(); InputStream dtdStream = classLoader.getResourceAsStream( "net/sf/hibernate/" + systemId.substring( URL.length() ) ); *************** *** 30,34 **** return new InputSource(dtdStream); } ! } else { // use the default behaviour --- 30,34 ---- return new InputSource(dtdStream); } ! } else { // use the default behaviour *************** *** 36,40 **** } } ! } ! --- 36,43 ---- } } ! } ! ! ! ! Index: FastHashMap.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util/FastHashMap.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** FastHashMap.java 1 Jan 2003 13:58:26 -0000 1.1.1.1 --- FastHashMap.java 4 Jan 2003 11:15:32 -0000 1.2 *************** *** 87,103 **** public final class FastHashMap implements Map, Serializable { ! // ----------------------------------------------------------- Constructors ! /** * Construct a an empty map. */ public FastHashMap() { ! super(); this.map = new HashMap(); ! } ! /** * Construct an empty map with the specified capacity. --- 87,103 ---- public final class FastHashMap implements Map, Serializable { ! // ----------------------------------------------------------- Constructors ! /** * Construct a an empty map. */ public FastHashMap() { ! super(); this.map = new HashMap(); ! } ! /** * Construct an empty map with the specified capacity. *************** *** 106,115 **** */ public FastHashMap(int capacity) { ! super(); this.map = new HashMap(capacity); ! } ! /** * Construct an empty map with the specified capacity and load factor. --- 106,115 ---- */ public FastHashMap(int capacity) { ! super(); this.map = new HashMap(capacity); ! } ! /** * Construct an empty map with the specified capacity and load factor. *************** *** 119,128 **** */ public FastHashMap(int capacity, float factor) { ! super(); this.map = new HashMap(capacity, factor); ! } ! /** * Construct a new map with the same mappings as the specified map. --- 119,128 ---- */ public FastHashMap(int capacity, float factor) { ! super(); this.map = new HashMap(capacity, factor); ! } ! /** * Construct a new map with the same mappings as the specified map. *************** *** 131,154 **** */ public FastHashMap(Map map) { ! super(); this.map = new HashMap(map); ! } ! // ----------------------------------------------------- Instance Variables ! /** * The underlying map we are managing. */ protected HashMap map = null; ! // --------------------------------------------------------- Public Methods ! /** * Remove all mappings from this map. */ public void clear() { ! synchronized (this) { HashMap temp = (HashMap) map.clone(); --- 131,154 ---- */ public FastHashMap(Map map) { ! super(); this.map = new HashMap(map); ! } ! // ----------------------------------------------------- Instance Variables ! /** * The underlying map we are managing. */ protected HashMap map = null; ! // --------------------------------------------------------- Public Methods ! /** * Remove all mappings from this map. */ public void clear() { ! synchronized (this) { HashMap temp = (HashMap) map.clone(); *************** *** 156,162 **** map = temp; } ! } ! /** * Return a shallow copy of this <code>FastHashMap</code> instance. --- 156,162 ---- map = temp; } ! } ! /** * Return a shallow copy of this <code>FastHashMap</code> instance. *************** *** 164,176 **** */ public Object clone() { ! FastHashMap results = null; ! results = new FastHashMap(map); ! return (results); ! } ! /** * Return <code>true</code> if this map contains a mapping for the --- 164,176 ---- */ public Object clone() { ! FastHashMap results = null; ! results = new FastHashMap(map); ! return (results); ! } ! /** * Return <code>true</code> if this map contains a mapping for the *************** *** 180,188 **** */ public boolean containsKey(Object key) { ! return (map.containsKey(key)); ! } ! /** * Return <code>true</code> if this map contains one or more keys mapping --- 180,188 ---- */ public boolean containsKey(Object key) { ! return (map.containsKey(key)); ! } ! /** * Return <code>true</code> if this map contains one or more keys mapping *************** *** 192,200 **** */ public boolean containsValue(Object value) { ! return (map.containsValue(value)); ! } ! /** * Return a collection view of the mappings contained in this map. Each --- 192,200 ---- */ public boolean containsValue(Object value) { ! return (map.containsValue(value)); ! } ! /** * Return a collection view of the mappings contained in this map. Each *************** *** 202,210 **** */ public Set entrySet() { ! return (map.entrySet()); ! } ! /** * Compare the specified object with this list for equality. This --- 202,210 ---- */ public Set entrySet() { ! return (map.entrySet()); ! } ! /** * Compare the specified object with this list for equality. This *************** *** 216,231 **** */ public boolean equals(Object o) { ! // Simple tests that require no synchronization if (o == this) ! return (true); else if (!(o instanceof Map)) ! return (false); Map mo = (Map) o; ! // Compare the two maps for equality ! if (mo.size() != map.size()) ! return (false); java.util.Iterator i = map.entrySet().iterator(); while (i.hasNext()) { --- 216,231 ---- */ public boolean equals(Object o) { ! // Simple tests that require no synchronization if (o == this) ! return (true); else if (!(o instanceof Map)) ! return (false); Map mo = (Map) o; ! // Compare the two maps for equality ! if (mo.size() != map.size()) ! return (false); java.util.Iterator i = map.entrySet().iterator(); while (i.hasNext()) { *************** *** 235,249 **** if (value == null) { if (!(mo.get(key) == null && mo.containsKey(key))) ! return (false); } else { if (!value.equals(mo.get(key))) ! return (false); } } return (true); ! } ! /** * Return the value to which this map maps the specified key. Returns --- 235,249 ---- if (value == null) { if (!(mo.get(key) == null && mo.containsKey(key))) ! return (false); } else { if (!value.equals(mo.get(key))) ! return (false); } } return (true); ! } ! /** * Return the value to which this map maps the specified key. Returns *************** *** 255,263 **** */ public Object get(Object key) { ! return (map.get(key)); ! } ! /** * Return the hash code value for this map. This implementation uses --- 255,263 ---- */ public Object get(Object key) { ! return (map.get(key)); ! } ! /** * Return the hash code value for this map. This implementation uses *************** *** 266,296 **** */ public int hashCode() { ! int h = 0; java.util.Iterator i = map.entrySet().iterator(); while (i.hasNext()) ! h += i.next().hashCode(); return (h); ! } ! /** * Return <code>true</code> if this map contains no mappings. */ public boolean isEmpty() { ! return (map.isEmpty()); ! } ! /** * Return a set view of the keys contained in this map. */ public Set keySet() { ! return (map.keySet()); ! } ! /** * Associate the specified value with the specified key in this map. --- 266,296 ---- */ public int hashCode() { ! int h = 0; java.util.Iterator i = map.entrySet().iterator(); while (i.hasNext()) ! h += i.next().hashCode(); return (h); ! } ! /** * Return <code>true</code> if this map contains no mappings. */ public boolean isEmpty() { ! return (map.isEmpty()); ! } ! /** * Return a set view of the keys contained in this map. */ public Set keySet() { ! return (map.keySet()); ! } ! /** * Associate the specified value with the specified key in this map. *************** *** 302,306 **** */ public Object put(Object key, Object value) { ! synchronized (this) { HashMap temp = (HashMap) map.clone(); --- 302,306 ---- */ public Object put(Object key, Object value) { ! synchronized (this) { HashMap temp = (HashMap) map.clone(); *************** *** 309,315 **** return (result); } ! } ! /** * Copy all of the mappings from the specified map to this one, replacing --- 309,315 ---- return (result); } ! } ! /** * Copy all of the mappings from the specified map to this one, replacing *************** *** 319,323 **** */ public void putAll(Map in) { ! synchronized (this) { HashMap temp = (HashMap) map.clone(); --- 319,323 ---- */ public void putAll(Map in) { ! synchronized (this) { HashMap temp = (HashMap) map.clone(); *************** *** 325,331 **** map = temp; } ! } ! /** * Remove any mapping for this key, and return any previously --- 325,331 ---- map = temp; } ! } ! /** * Remove any mapping for this key, and return any previously *************** *** 335,339 **** */ public Object remove(Object key) { ! synchronized (this) { HashMap temp = (HashMap) map.clone(); --- 335,339 ---- */ public Object remove(Object key) { ! synchronized (this) { HashMap temp = (HashMap) map.clone(); *************** *** 342,367 **** return (result); } ! } ! /** * Return the number of key-value mappings in this map. */ public int size() { ! return (map.size()); ! } ! /** * Return a collection view of the values contained in this map. */ public Collection values() { ! return (map.values()); ! } public String toString() { return map.toString(); } - } \ No newline at end of file --- 342,369 ---- return (result); } ! } ! /** * Return the number of key-value mappings in this map. */ public int size() { ! return (map.size()); ! } ! /** * Return a collection view of the values contained in this map. */ public Collection values() { ! return (map.values()); ! } public String toString() { return map.toString(); } + + } + Index: IdentityMap.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util/IdentityMap.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** IdentityMap.java 1 Jan 2003 13:58:26 -0000 1.1.1.1 --- IdentityMap.java 4 Jan 2003 11:15:32 -0000 1.2 *************** *** 6,10 **** import java.util.*; ! /** * A hashtable where keys are compared by object identity, * rather than equals(). --- 6,10 ---- import java.util.*; ! /** * A hashtable where keys are compared by object identity, * rather than equals(). *************** *** 25,33 **** return key; } ! public Object getValue() { return value; } ! public Object setValue(Object value) { Object result = this.value; --- 25,33 ---- return key; } ! public Object getValue() { return value; } ! public Object setValue(Object value) { Object result = this.value; *************** *** 73,81 **** return map.size(); } ! public boolean isEmpty() { return map.isEmpty(); } ! public boolean containsKey(Object key) { IdentityKey k = popKey(key); --- 73,81 ---- return map.size(); } ! public boolean isEmpty() { return map.isEmpty(); } ! public boolean containsKey(Object key) { IdentityKey k = popKey(key); *************** *** 84,92 **** return result; } ! public boolean containsValue(Object val) { return map.containsValue(val); } ! public Object get(Object key) { IdentityKey k = popKey(key); --- 84,92 ---- return result; } ! public boolean containsValue(Object val) { return map.containsValue(val); } ! public Object get(Object key) { IdentityKey k = popKey(key); *************** *** 95,103 **** return result; } ! public Object put(Object key, Object value) { return map.put( popKey(key), value ); } ! public Object remove(Object key) { IdentityKey k = popKey(key); --- 95,103 ---- return result; } ! public Object put(Object key, Object value) { return map.put( popKey(key), value ); } ! public Object remove(Object key) { IdentityKey k = popKey(key); *************** *** 106,110 **** return result; } ! public void putAll(Map map) { Iterator iter = map.entrySet().iterator(); --- 106,110 ---- return result; } ! public void putAll(Map map) { Iterator iter = map.entrySet().iterator(); *************** *** 114,118 **** } } ! public void clear() { Iterator iter = map.keySet().iterator(); --- 114,118 ---- } } ! public void clear() { Iterator iter = map.keySet().iterator(); *************** *** 122,135 **** map.clear(); } ! public Set keySet() { // would need an IdentitySet for this! throw new UnsupportedOperationException(); } ! public Collection values() { return map.values(); } ! public Set entrySet() { Set set = new HashSet(); --- 122,135 ---- map.clear(); } ! public Set keySet() { // would need an IdentitySet for this! throw new UnsupportedOperationException(); } ! public Collection values() { return map.values(); } ! public Set entrySet() { Set set = new HashSet(); *************** *** 142,144 **** --- 142,147 ---- } } + + + Index: JDBCExceptionReporter.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util/JDBCExceptionReporter.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** JDBCExceptionReporter.java 1 Jan 2003 13:58:26 -0000 1.1.1.1 --- JDBCExceptionReporter.java 4 Jan 2003 11:15:32 -0000 1.2 *************** *** 9,13 **** public final class JDBCExceptionReporter { ! private static final Log log = LogFactory.getLog(JDBCExceptionReporter.class); --- 9,13 ---- public final class JDBCExceptionReporter { ! private static final Log log = LogFactory.getLog(JDBCExceptionReporter.class); *************** *** 17,48 **** while (warning != null) { log.warn( new StringBuffer(30) ! .append("SQL Warning: ") ! .append( warning.getErrorCode() ) ! .append(", SQLState: ") ! .append( warning.getSQLState() ) ! .toString() ! ); ! log.warn( warning.getMessage() ); ! warning = warning.getNextWarning(); ! } } } ! public static void logExceptions(SQLException ex) { ! if ( log.isErrorEnabled() ) { ! if ( log.isDebugEnabled() ) log.debug( "SQL Exception", ex ); ! while (ex != null) { ! log.warn( new StringBuffer(30) ! .append("SQL Error: ") ! .append( ex.getErrorCode() ) ! .append(", SQLState: ") ! .append( ex.getSQLState() ) ! .toString() ! ); ! log.error( ex.getMessage() ); ! ex = ex.getNextException(); ! } ! } } } --- 17,51 ---- while (warning != null) { log.warn( new StringBuffer(30) ! .append("SQL Warning: ") ! .append( warning.getErrorCode() ) ! .append(", SQLState: ") ! .append( warning.getSQLState() ) ! .toString() ! ); ! log.warn( warning.getMessage() ); ! warning = warning.getNextWarning(); } } + } ! public static void logExceptions(SQLException ex) { ! if ( log.isErrorEnabled() ) { ! if ( log.isDebugEnabled() ) log.debug( "SQL Exception", ex ); ! while (ex != null) { ! log.warn( new StringBuffer(30) ! .append("SQL Error: ") ! .append( ex.getErrorCode() ) ! .append(", SQLState: ") ! .append( ex.getSQLState() ) ! .toString() ! ); ! log.error( ex.getMessage() ); ! ex = ex.getNextException(); } + } + } } + + + Index: JoinedIterator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util/JoinedIterator.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** JoinedIterator.java 1 Jan 2003 13:58:26 -0000 1.1.1.1 --- JoinedIterator.java 4 Jan 2003 11:15:32 -0000 1.2 *************** *** 12,16 **** this.current = 0; } ! public boolean hasNext() { for ( int i = current; i<iterators.length; i++ ) { --- 12,16 ---- this.current = 0; } ! public boolean hasNext() { for ( int i = current; i<iterators.length; i++ ) { *************** *** 19,23 **** return false; } ! public Object next() { if ( iterators[current].hasNext() ) { --- 19,23 ---- return false; } ! public Object next() { if ( iterators[current].hasNext() ) { *************** *** 29,37 **** } } ! public void remove() { iterators[current].remove(); } ! } --- 29,40 ---- } } ! public void remove() { iterators[current].remove(); } ! } + + + Index: LinkedHashCollectionHelper.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util/LinkedHashCollectionHelper.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** LinkedHashCollectionHelper.java 1 Jan 2003 13:58:26 -0000 1.1.1.1 --- LinkedHashCollectionHelper.java 4 Jan 2003 11:15:32 -0000 1.2 *************** *** 19,23 **** } } ! public static Set createLinkedHashSet() { try { --- 19,23 ---- } } ! public static Set createLinkedHashSet() { try { *************** *** 28,32 **** } } ! public static Map createLinkedHashMap() { try { --- 28,32 ---- } } ! public static Map createLinkedHashMap() { try { *************** *** 37,40 **** } } ! } --- 37,43 ---- } } ! } + + + Index: NamingHelper.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util/NamingHelper.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** NamingHelper.java 1 Jan 2003 13:58:28 -0000 1.1.1.1 --- NamingHelper.java 4 Jan 2003 11:15:32 -0000 1.2 *************** *** 18,47 **** public final class NamingHelper { ! private static final Log log = LogFactory.getLog(NamingHelper.class); ! public static InitialContext getInitialContext(Properties props) throws NamingException { ! Hashtable hash = getJndiProperties(props); log.info("JNDI InitialContext properties:" + hash); ! try { return ( hash.size()==0 ) ? ! new InitialContext() : ! new InitialContext(hash); ! } ! catch (NamingException e) { ! log.error("Could not obtain initial context", e); ! throw e; ! } } ! ! /** ! * Bind val to name in ctx, and make sure that all intermediate contexts exist. ! * ! * @param ctx the root context ! * @param name the name as a string ! * @param val the object to be bound ! * @throws NamingException ! */ public static void bind(Context ctx, String name, Object val) throws NamingException { try { --- 18,47 ---- public final class NamingHelper { ! private static final Log log = LogFactory.getLog(NamingHelper.class); ! public static InitialContext getInitialContext(Properties props) throws NamingException { ! Hashtable hash = getJndiProperties(props); log.info("JNDI InitialContext properties:" + hash); ! try { return ( hash.size()==0 ) ? ! new InitialContext() : ! new InitialContext(hash); ! } ! catch (NamingException e) { ! log.error("Could not obtain initial context", e); ! throw e; ! } } ! ! /** ! * Bind val to name in ctx, and make sure that all intermediate contexts exist. ! * ! * @param ctx the root context ! * @param name the name as a string ! * @param val the object to be bound ! * @throws NamingException ! */ public static void bind(Context ctx, String name, Object val) throws NamingException { try { *************** *** 53,57 **** while ( n.size() > 1 ) { String ctxName = n.get(0); ! Context subctx=null; try { --- 53,57 ---- while ( n.size() > 1 ) { String ctxName = n.get(0); ! Context subctx=null; try { *************** *** 60,64 **** } catch (NameNotFoundException nfe) {} ! if (subctx!=null) { log.debug("Found subcontext: " + ctxName); --- 60,64 ---- } catch (NameNotFoundException nfe) {} ! if (subctx!=null) { log.debug("Found subcontext: " + ctxName); *************** *** 72,80 **** } log.trace("binding: " + n); ! ctx.rebind(n, val); } log.debug("Bound name: " + name); } ! /** * Transform JNDI properties passed in the form <tt>hibernate.jndi.*</tt> to the --- 72,80 ---- } log.trace("binding: " + n); ! ctx.rebind(n, val); } log.debug("Bound name: " + name); } ! /** * Transform JNDI properties passed in the form <tt>hibernate.jndi.*</tt> to the *************** *** 98,113 **** } } ! ! String jndiClass = properties.getProperty(Environment.JNDI_CLASS); ! String jndiURL = properties.getProperty(Environment.JNDI_URL); ! // we want to be able to just use the defaults, ! // if JNDI environment properties are not supplied ! // so don't put null in anywhere ! if (jndiClass != null) result.put(Context.INITIAL_CONTEXT_FACTORY, jndiClass); ! if (jndiURL != null) result.put(Context.PROVIDER_URL, jndiURL); ! return result; } ! } --- 98,116 ---- } } ! ! String jndiClass = properties.getProperty(Environment.JNDI_CLASS); ! String jndiURL = properties.getProperty(Environment.JNDI_URL); ! // we want to be able to just use the defaults, ! // if JNDI environment properties are not supplied ! // so don't put null in anywhere ! if (jndiClass != null) result.put(Context.INITIAL_CONTEXT_FACTORY, jndiClass); ! if (jndiURL != null) result.put(Context.PROVIDER_URL, jndiURL); ! return result; } ! } + + + Index: PropertiesHelper.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util/PropertiesHelper.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** PropertiesHelper.java 1 Jan 2003 13:58:28 -0000 1.1.1.1 --- PropertiesHelper.java 4 Jan 2003 11:15:32 -0000 1.2 *************** *** 9,17 **** public final class PropertiesHelper { ! public static boolean getBoolean(String property, Properties properties) { return Boolean.valueOf( properties.getProperty(property) ).booleanValue(); } ! public static int getInt(String property, Properties properties, int defaultValue) { String propValue = properties.getProperty(property); --- 9,17 ---- public final class PropertiesHelper { ! public static boolean getBoolean(String property, Properties properties) { return Boolean.valueOf( properties.getProperty(property) ).booleanValue(); } ! public static int getInt(String property, Properties properties, int defaultValue) { String propValue = properties.getProperty(property); *************** *** 19,29 **** } ! ! public static Integer getInteger(String property, Properties properties) { String propValue = properties.getProperty(property); return (propValue==null) ? null : Integer.valueOf(propValue); } ! public static Map toMap(String property, String delim, Properties properties) { Map map = new HashMap(); --- 19,29 ---- } ! ! public static Integer getInteger(String property, Properties properties) { String propValue = properties.getProperty(property); return (propValue==null) ? null : Integer.valueOf(propValue); } ! public static Map toMap(String property, String delim, Properties properties) { Map map = new HashMap(); *************** *** 53,56 **** } } ! } --- 53,59 ---- } } ! } + + + Index: Range.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util/Range.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Range.java 1 Jan 2003 13:58:28 -0000 1.1.1.1 --- Range.java 4 Jan 2003 11:15:32 -0000 1.2 *************** *** 3,7 **** public class Range { ! public static int[] range(int begin, int length) { int[] result = new int[length]; --- 3,7 ---- public class Range { ! public static int[] range(int begin, int length) { int[] result = new int[length]; *************** *** 12,16 **** } ! } --- 12,19 ---- } ! } + + + Index: ReflectHelper.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util/ReflectHelper.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ReflectHelper.java 1 Jan 2003 13:58:29 -0000 1.1.1.1 --- ReflectHelper.java 4 Jan 2003 11:15:32 -0000 1.2 *************** *** 30,34 **** this.propertyName=propertyName; } ! public void set(Object target, Object value) throws HibernateException { try { --- 30,34 ---- this.propertyName=propertyName; } ! public void set(Object target, Object value) throws HibernateException { try { *************** *** 54,58 **** } } ! } --- 54,58 ---- } } ! } *************** *** 91,97 **** return method; } ! } ! static { Method eq; --- 91,97 ---- return method; } ! } ! static { Method eq; *************** *** 116,120 **** } ! public static Method getMethod(Class theClass, String methodName) throws PropertyNotFoundException { --- 116,120 ---- } ! public static Method getMethod(Class theClass, String methodName) throws PropertyNotFoundException { *************** *** 172,176 **** ) { String testStdMethod = Introspector.decapitalize( methods[i].getName().substring(3) ); ! String testOldMethod = methods[i].getName().substring(3); if ( ( testStdMethod.equals(propertyName) || testOldMethod.equals(propertyName) ) && --- 172,176 ---- ) { String testStdMethod = Introspector.decapitalize( methods[i].getName().substring(3) ); ! String testOldMethod = methods[i].getName().substring(3); if ( ( testStdMethod.equals(propertyName) || testOldMethod.equals(propertyName) ) && *************** *** 181,192 **** } } ! } ! return potentialSetter; } public static Getter getGetter(Class theClass, String propertyName) throws PropertyNotFoundException { ! if (theClass==Object.class || theClass==null) throw new PropertyNotFoundException( "Could not find a getter" ); // will be swallowed ! Method result = getter(theClass, propertyName); --- 181,192 ---- } } ! } ! return potentialSetter; } public static Getter getGetter(Class theClass, String propertyName) throws PropertyNotFoundException { ! if (theClass==Object.class || theClass==null) throw new PropertyNotFoundException( "Could not find a getter" ); // will be swallowed ! Method result = getter(theClass, propertyName); *************** *** 203,207 **** return new Getter(theClass, result, propertyName); } ! } private static Method getter(Class theClass, String propertyName) { --- 203,207 ---- return new Getter(theClass, result, propertyName); } ! } private static Method getter(Class theClass, String propertyName) { *************** *** 211,221 **** // only carry on if the method has no parameters if(methods[i].getParameterTypes().length==0) { ! // try "get" if( (methods[i].getName().length() > 3) && methods[i].getName().startsWith("get") ) { String testStdMethod = Introspector.decapitalize( methods[i].getName().substring(3) ); ! String testOldMethod = methods[i].getName().substring(3); ! if( ( testStdMethod.equals(propertyName) || testOldMethod.equals(propertyName) ) && methods[i].getParameterTypes().length==0 --- 211,221 ---- // only carry on if the method has no parameters if(methods[i].getParameterTypes().length==0) { ! // try "get" if( (methods[i].getName().length() > 3) && methods[i].getName().startsWith("get") ) { String testStdMethod = Introspector.decapitalize( methods[i].getName().substring(3) ); ! String testOldMethod = methods[i].getName().substring(3); ! if( ( testStdMethod.equals(propertyName) || testOldMethod.equals(propertyName) ) && methods[i].getParameterTypes().length==0 *************** *** 228,242 **** String testStdMethod = Introspector.decapitalize( methods[i].getName().substring(2) ); ! String testOldMethod = methods[i].getName().substring(2); ! if( ! ( testStdMethod.equals(propertyName) || testOldMethod.equals(propertyName) ) && ! methods[i].getParameterTypes().length==0 ! ) return methods[i]; } } ! } ! return null; } ! public static Type reflectedPropertyType(Class theClass, String name) throws MappingException { return TypeFactory.hueristicType( getGetter(theClass, name).getReturnType().getName() ); --- 228,242 ---- String testStdMethod = Introspector.decapitalize( methods[i].getName().substring(2) ); ! String testOldMethod = methods[i].getName().substring(2); ! if( ! ( testStdMethod.equals(propertyName) || testOldMethod.equals(propertyName) ) && ! methods[i].getParameterTypes().length==0 ! ) return methods[i]; } } ! } ! return null; } ! public static Type reflectedPropertyType(Class theClass, String name) throws MappingException { return TypeFactory.hueristicType( getGetter(theClass, name).getReturnType().getName() ); *************** *** 277,288 **** try { ! Constructor constructor = clazz.getDeclaredConstructor(NO_CLASSES); if (!isPublic(clazz, constructor)) { constructor.setAccessible(true); } return constructor; ! } catch (NoSuchMethodException nme) { throw new PropertyNotFoundException( ! "Object class " + clazz.getName() + " must declare a default (no-argument) constructor" ); --- 277,289 ---- try { ! Constructor constructor = clazz.getDeclaredConstructor(NO_CLASSES); if (!isPublic(clazz, constructor)) { constructor.setAccessible(true); } return constructor; ! } ! catch (NoSuchMethodException nme) { throw new PropertyNotFoundException( ! "Object class " + clazz.getName() + " must declare a default (no-argument) constructor" ); *************** *** 295,298 **** return (Modifier.isAbstract(modifier) || Modifier.isInterface(modifier)); } ! } --- 296,302 ---- return (Modifier.isAbstract(modifier) || Modifier.isInterface(modifier)); } ! } + + + Index: StringHelper.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util/StringHelper.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** StringHelper.java 1 Jan 2003 13:58:30 -0000 1.1.1.1 --- StringHelper.java 4 Jan 2003 11:15:32 -0000 1.2 *************** *** 7,16 **** public final class StringHelper { ! public static String join(String seperator, String[] strings) { int length = strings.length; if (length==0) return ""; StringBuffer buf = new StringBuffer( length * strings[0].length() ) ! .append(strings[0]); for (int i=1; i<length; i++) { buf.append(seperator).append(strings[i]); --- 7,16 ---- public final class StringHelper { ! public static String join(String seperator, String[] strings) { int length = strings.length; if (length==0) return ""; StringBuffer buf = new StringBuffer( length * strings[0].length() ) ! .append(strings[0]); for (int i=1; i<length; i++) { buf.append(seperator).append(strings[i]); *************** *** 34,43 **** else { return new StringBuffer( template.substring(0, loc) ) ! .append(replacement) ! .append( replace( ! template.substring( loc + placeholder.length() ), ! placeholder, ! replacement ! ) ).toString(); } } --- 34,43 ---- else { return new StringBuffer( template.substring(0, loc) ) ! .append(replacement) ! .append( replace( ! template.substring( loc + placeholder.length() ), ! placeholder, ! replacement ! ) ).toString(); } } *************** *** 51,57 **** else { return new StringBuffer( template.substring(0, loc) ) ! .append(replacement) ! .append( template.substring( loc + placeholder.length() ) ) ! .toString(); } } --- 51,57 ---- else { return new StringBuffer( template.substring(0, loc) ) ! .append(replacement) ! .append( template.substring( loc + placeholder.length() ) ) ! .toString(); } } *************** *** 100,104 **** if ( Dialect.QUOTE.indexOf(quote) > -1 ) { return table.substring( 0, table.length()-1 ) + suffix + quote; ! } else { return table + suffix; --- 100,104 ---- if ( Dialect.QUOTE.indexOf(quote) > -1 ) { return table.substring( 0, table.length()-1 ) + suffix + quote; ! } else { return table + suffix; *************** *** 114,118 **** return qualified; } ! public static String root(String qualifiedName) { int loc = qualifiedName.indexOf("."); --- 114,118 ---- return qualified; } ! public static String root(String qualifiedName) { int loc = qualifiedName.indexOf("."); *************** *** 141,145 **** return result; } ! private static String[] multiply(String[] strings, String placeholder, String[] replacements) { String[] results = new String[ replacements.length * strings.length ]; --- 141,145 ---- return result; } ! private static String[] multiply(String[] strings, String placeholder, String[] replacements) { String[] results = new String[ replacements.length * strings.length ]; *************** *** 152,170 **** return results; } ! public static String unQuote(String name) { return ( Dialect.QUOTE.indexOf( name.charAt(0) ) > -1 ) ? ! name.substring(1, name.length()-1) : ! name; ! } ! ! public static void unQuoteInPlace(String[] names) { ! for ( int i=0; i<names.length; i++ ) names[i] = unQuote( names[i] ); ! } ! public static String[] unQuote(String[] names) { ! String[] unquoted = new String[ names.length ]; ! for ( int i=0; i<names.length; i++ ) unquoted[i] = unQuote( names[i] ); ! return unquoted; ! } ! } --- 152,173 ---- return results; } ! public static String unQuote(String name) { return ( Dialect.QUOTE.indexOf( name.charAt(0) ) > -1 ) ? ! name.substring(1, name.length()-1) : ! name; ! } ! ! public static void unQuoteInPlace(String[] names) { ! for ( int i=0; i<names.length; i++ ) names[i] = unQuote( names[i] ); ! } ! public static String[] unQuote(String[] names) { ! String[] unquoted = new String[ names.length ]; ! for ( int i=0; i<names.length; i++ ) unquoted[i] = unQuote( names[i] ); ! return unquoted; ! } ! } + + + Index: XMLHelper.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/util/XMLHelper.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** XMLHelper.java 1 Jan 2003 13:58:30 -0000 1.1.1.1 --- XMLHelper.java 4 Jan 2003 11:15:32 -0000 1.2 *************** *** 15,20 **** private static final Log log = LogFactory.getLog(XMLHelper.class); private static final EntityResolver dtdResolver = new DTDEntityResolver(); ! ! private XMLHelper() { //cannot be instantiated } --- 15,20 ---- private static final Log log = LogFactory.getLog(XMLHelper.class); private static final EntityResolver dtdResolver = new DTDEntityResolver(); ! ! private XMLHelper() { //cannot be instantiated } *************** *** 38,48 **** log.error( "Error parsing XML: " + file + '(' + error.getLineNumber() + ')', error ); } ! public void fatalError(SAXParseException error) { ! error(error); } public void warning(SAXParseException error) { log.warn( "Warning parsing XML: " + file + '(' + error.getLineNumber() + ')', error ); } ! } ); return builder.parse(source).getDocumentElement().getOwnerDocument(); --- 38,48 ---- log.error( "Error parsing XML: " + file + '(' + error.getLineNumber() + ')', error ); } ! public void fatalError(SAXParseException error) { ! error(error); } public void warning(SAXParseException error) { log.warn( "Warning parsing XML: " + file + '(' + error.getLineNumber() + ')', error ); } ! } ); return builder.parse(source).getDocumentElement().getOwnerDocument(); *************** *** 50,56 **** ! public static Document parseString(String xml) throws IOException, SAXException, ParserConfigurationException { return parseInputSource( new InputSource( new ByteArrayInputStream( xml.getBytes() ) ) ); } ! } --- 50,59 ---- ! public static Document parseString(String xml) throws IOException, SAXException, ParserConfigurationException { return parseInputSource( new InputSource( new ByteArrayInputStream( xml.getBytes() ) ) ); } ! } + + + |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/proxy In directory sc8-pr-cvs1:/tmp/cvs-serv14211/src/net/sf/hibernate/proxy Modified Files: CGLIBLazyInitializer.java HibernateProxy.java HibernateProxyHelper.java LazyInitializer.java SerializableProxy.java Log Message: reformatted code with beautiful, shiny, happy TABS! improved an exception Index: CGLIBLazyInitializer.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/proxy/CGLIBLazyInitializer.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** CGLIBLazyInitializer.java 1 Jan 2003 13:56:40 -0000 1.1.1.1 --- CGLIBLazyInitializer.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 15,24 **** /** ! * */ public final class CGLIBLazyInitializer extends LazyInitializer implements MethodInterceptor { private Class[] interfaces; ! public static HibernateProxy getProxy(Class persistentClass, Class[] interfaces, Method getIdentifierMethod, Serializable id, SessionImplementor session) throws HibernateException { try { --- 15,24 ---- /** ! * */ public final class CGLIBLazyInitializer extends LazyInitializer implements MethodInterceptor { private Class[] interfaces; ! public static HibernateProxy getProxy(Class persistentClass, Class[] interfaces, Method getIdentifierMethod, Serializable id, SessionImplementor session) throws HibernateException { try { *************** *** 35,56 **** } } ! private CGLIBLazyInitializer(Class persistentClass, Class[] interfaces, Serializable id, Method getIdentifierMethod, SessionImplementor session) { super(persistentClass, id, getIdentifierMethod, session); ! this.interfaces = interfaces; } ! ! public boolean invokeSuper(Object obj, Method method, Object args[]) throws Throwable { ! return false; ! } ! ! ! public Object afterReturn(Object obj, Method method, Object args[], boolean invokedSuper, Object retValFromSuper, Throwable e) throws Throwable{ ! return invoke(method, args); ! } ! protected Object serializableProxy() { return new SerializableProxy(persistentClass, interfaces, id, getIdentifierMethod); } - } \ No newline at end of file --- 35,58 ---- } } ! private CGLIBLazyInitializer(Class persistentClass, Class[] interfaces, Serializable id, Method getIdentifierMethod, SessionImplementor session) { super(persistentClass, id, getIdentifierMethod, session); ! this.interfaces = interfaces; } ! ! public boolean invokeSuper(Object obj, Method method, Object args[]) throws Throwable { ! return false; ! } ! ! ! public Object afterReturn(Object obj, Method method, Object args[], boolean invokedSuper, Object retValFromSuper, Throwable e) throws Throwable{ ! return invoke(method, args); ! } ! protected Object serializableProxy() { return new SerializableProxy(persistentClass, interfaces, id, getIdentifierMethod); } + + } + Index: HibernateProxy.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/proxy/HibernateProxy.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** HibernateProxy.java 1 Jan 2003 13:56:41 -0000 1.1.1.1 --- HibernateProxy.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 8,9 **** --- 8,12 ---- } + + + Index: HibernateProxyHelper.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/proxy/HibernateProxyHelper.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** HibernateProxyHelper.java 1 Jan 2003 13:56:41 -0000 1.1.1.1 --- HibernateProxyHelper.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 15,19 **** */ public static Object unproxy(Object object, SessionImplementor session) throws SQLException, HibernateException { ! if ( object instanceof HibernateProxy ) { HibernateProxy proxy = (HibernateProxy) object; --- 15,19 ---- */ public static Object unproxy(Object object, SessionImplementor session) throws SQLException, HibernateException { ! if ( object instanceof HibernateProxy ) { HibernateProxy proxy = (HibernateProxy) object; *************** *** 31,37 **** } ! private HibernateProxyHelper() { //cant instantiate } } --- 31,40 ---- } ! private HibernateProxyHelper() { //cant instantiate } } + + + Index: LazyInitializer.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/proxy/LazyInitializer.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** LazyInitializer.java 1 Jan 2003 13:56:42 -0000 1.1.1.1 --- LazyInitializer.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 16,23 **** /** ! * */ public abstract class LazyInitializer { ! protected Object target = null; protected Serializable id; --- 16,23 ---- /** ! * */ public abstract class LazyInitializer { ! protected Object target = null; protected Serializable id; *************** *** 26,30 **** protected Method getIdentifierMethod; protected boolean overridesEquals; ! protected LazyInitializer(Class persistentClass, Serializable id, Method getIdentifierMethod, SessionImplementor session) { this.id = id; --- 26,30 ---- protected Method getIdentifierMethod; protected boolean overridesEquals; ! protected LazyInitializer(Class persistentClass, Serializable id, Method getIdentifierMethod, SessionImplementor session) { this.id = id; *************** *** 48,52 **** } } ! private void initializeWrapExceptions() { try { --- 48,52 ---- } } ! private void initializeWrapExceptions() { try { *************** *** 60,64 **** protected abstract Object serializableProxy(); ! protected final Object invoke(Method method, Object[] args) throws Throwable { --- 60,64 ---- protected abstract Object serializableProxy(); ! protected final Object invoke(Method method, Object[] args) throws Throwable { *************** *** 70,75 **** if ( "writeReplace".equals(methodName) ) { ! if (target==null && session!=null ) target = session.getEntity( ! new Key( id, session.getFactory().getPersister(persistentClass) ) ); if (target==null) { --- 70,75 ---- if ( "writeReplace".equals(methodName) ) { ! if (target==null && session!=null ) target = session.getEntity( ! new Key( id, session.getFactory().getPersister(persistentClass) ) ); if (target==null) { *************** *** 78,82 **** } else {*/ ! return serializableProxy(); //} } --- 78,82 ---- } else {*/ ! return serializableProxy(); //} } *************** *** 101,106 **** } else if ( params==1 && !overridesEquals && "equals".equals(methodName) ) { ! // less dodgy because Hibernate forces == to be same as identifier equals ! return new Boolean( id.equals( getIdentifierMethod.invoke( args[0], null ) ) ); } --- 101,106 ---- } else if ( params==1 && !overridesEquals && "equals".equals(methodName) ) { ! // less dodgy because Hibernate forces == to be same as identifier equals ! return new Boolean( id.equals( getIdentifierMethod.invoke( args[0], null ) ) ); } *************** *** 112,116 **** throw ite.getTargetException(); } ! } --- 112,116 ---- throw ite.getTargetException(); } ! } *************** *** 155,162 **** */ public final Object getImplementation(SessionImplementor s) throws HibernateException { ! return s.getEntity( new Key( ! getIdentifier(), ! s.getFactory().getPersister( getPersistentClass() ) ! ) ); } } --- 155,165 ---- */ public final Object getImplementation(SessionImplementor s) throws HibernateException { ! return s.getEntity( new Key( ! getIdentifier(), ! s.getFactory().getPersister( getPersistentClass() ) ! ) ); } } + + + Index: SerializableProxy.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/proxy/SerializableProxy.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** SerializableProxy.java 1 Jan 2003 13:56:42 -0000 1.1.1.1 --- SerializableProxy.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 31,38 **** try { return CGLIBLazyInitializer.getProxy( ! persistentClass, ! interfaces, (getIdentifierMethod==null) ? null : ReflectHelper.getMethod(persistentClass, getIdentifierMethod), ! id, null ); --- 31,38 ---- try { return CGLIBLazyInitializer.getProxy( ! persistentClass, ! interfaces, (getIdentifierMethod==null) ? null : ReflectHelper.getMethod(persistentClass, getIdentifierMethod), ! id, null ); *************** *** 45,46 **** --- 45,49 ---- } } + + + |
From: <one...@us...> - 2003-01-04 11:23:56
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/ps In directory sc8-pr-cvs1:/tmp/cvs-serv14211/src/net/sf/hibernate/ps Modified Files: PreparedStatementCache.java Log Message: reformatted code with beautiful, shiny, happy TABS! improved an exception Index: PreparedStatementCache.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/ps/PreparedStatementCache.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PreparedStatementCache.java 3 Jan 2003 22:47:24 -0000 1.2 --- PreparedStatementCache.java 4 Jan 2003 11:15:30 -0000 1.3 *************** *** 14,23 **** */ public final class PreparedStatementCache { ! Log log = LogFactory.getLog(PreparedStatementCache.class); private final int maxSize; private final ArrayList open = new ArrayList(); ! static final class Entry { --- 14,23 ---- */ public final class PreparedStatementCache { ! Log log = LogFactory.getLog(PreparedStatementCache.class); private final int maxSize; private final ArrayList open = new ArrayList(); ! static final class Entry { *************** *** 38,42 **** return sql.hashCode(); } ! } private final Map cache = new HashMap(); --- 38,42 ---- return sql.hashCode(); } ! } private final Map cache = new HashMap(); *************** *** 49,57 **** log.info("prepared statement cache size: " + maxSize); } ! public PreparedStatement getPreparedStatement(String sql, Connection connection, boolean scrollable) throws SQLException { Entry e = new Entry(sql, connection, scrollable); ! PreparedStatement ps; synchronized(this) { --- 49,57 ---- log.info("prepared statement cache size: " + maxSize); } ! public PreparedStatement getPreparedStatement(String sql, Connection connection, boolean scrollable) throws SQLException { Entry e = new Entry(sql, connection, scrollable); ! PreparedStatement ps; synchronized(this) { *************** *** 62,66 **** if (ps!=null) entries.remove( entryMap.get(ps) ); } ! if (ps==null) { --- 62,66 ---- if (ps!=null) entries.remove( entryMap.get(ps) ); } ! if (ps==null) { *************** *** 68,73 **** try { ps = scrollable ? ! connection.prepareStatement(sql, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY) : ! connection.prepareStatement(sql); } catch (SQLException sqle) { --- 68,73 ---- try { ps = scrollable ? ! connection.prepareStatement(sql, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY) : ! connection.prepareStatement(sql); } catch (SQLException sqle) { *************** *** 83,94 **** if ( log.isTraceEnabled() ) log.trace("returning cached statement: " + sql); } ! return ps; } ! public void closePreparedStatement(PreparedStatement ps) { log.trace("recaching"); ! PreparedStatement old=null; synchronized(this) { --- 83,94 ---- if ( log.isTraceEnabled() ) log.trace("returning cached statement: " + sql); } ! return ps; } ! public void closePreparedStatement(PreparedStatement ps) { log.trace("recaching"); ! PreparedStatement old=null; synchronized(this) { *************** *** 99,103 **** old = (PreparedStatement) cache.put(e, ps); ! if (old==null) { reapCounter++; --- 99,103 ---- old = (PreparedStatement) cache.put(e, ps); ! if (old==null) { reapCounter++; *************** *** 108,114 **** entries.add(e); ! } ! if (old!=null) { try { --- 108,114 ---- entries.add(e); ! } ! if (old!=null) { try { *************** *** 119,123 **** } } ! reap(); --- 119,123 ---- } } ! reap(); *************** *** 130,140 **** } ! public void closeAll(Connection connection) { log.trace("closing all statements for connection"); ! ArrayList templist = new ArrayList(25); ! synchronized(this) { Iterator iter = entries.iterator(); //slowish --- 130,140 ---- } ! public void closeAll(Connection connection) { log.trace("closing all statements for connection"); ! ArrayList templist = new ArrayList(25); ! synchronized(this) { Iterator iter = entries.iterator(); //slowish *************** *** 145,157 **** } } ! close(templist); ! } ! private void reap() { ArrayList templist = new ArrayList(25); ! synchronized(this) { if (reapCounter<20) return; --- 145,157 ---- } } ! close(templist); ! } ! private void reap() { ArrayList templist = new ArrayList(25); ! synchronized(this) { if (reapCounter<20) return; *************** *** 162,172 **** reapCounter = 0; } ! if ( log.isTraceEnabled() ) log.trace( "reaping: " + templist.size() + " statements" ); ! close(templist); ! } ! private void close(List templist) { Iterator iter = templist.iterator(); --- 162,172 ---- reapCounter = 0; } ! if ( log.isTraceEnabled() ) log.trace( "reaping: " + templist.size() + " statements" ); ! close(templist); ! } ! private void close(List templist) { Iterator iter = templist.iterator(); *************** *** 182,186 **** } } ! protected void finalize() { --- 182,186 ---- } } ! protected void finalize() { *************** *** 197,200 **** } } - } \ No newline at end of file --- 197,202 ---- } } + + } + |
From: <one...@us...> - 2003-01-04 11:23:56
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister In directory sc8-pr-cvs1:/tmp/cvs-serv14211/src/net/sf/hibernate/persister Modified Files: AbstractEntityPersister.java ClassPersister.java EntityPersister.java Loadable.java MultiTableEntityPersister.java Queryable.java Log Message: reformatted code with beautiful, shiny, happy TABS! improved an exception Index: AbstractEntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/AbstractEntityPersister.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** AbstractEntityPersister.java 1 Jan 2003 13:56:33 -0000 1.1.1.1 --- AbstractEntityPersister.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 52,64 **** private static final Log log = LogFactory.getLog(AbstractEntityPersister.class); ! protected static final Class[] NO_CLASSES = new Class[0]; ! private final Class mappedClass; ! protected transient final Dialect dialect; private transient final Constructor constructor; ! private transient final IdentifierGenerator idgen; private transient final boolean polymorphic; --- 52,64 ---- private static final Log log = LogFactory.getLog(AbstractEntityPersister.class); ! protected static final Class[] NO_CLASSES = new Class[0]; ! private final Class mappedClass; ! protected transient final Dialect dialect; private transient final Constructor constructor; ! private transient final IdentifierGenerator idgen; private transient final boolean polymorphic; *************** *** 75,94 **** private transient final boolean useIdentityColumn; private transient final Class superclass; ! ! private transient final String identitySelectString; ! ! private transient final Class[] proxyInterfaces; ! private transient final Class concreteProxyClass; ! private transient final boolean hasProxy; private transient final boolean hasEmbeddedIdentifier; private transient final String[] identifierColumnNames; private transient final Cascades.IdentifierValue unsavedIdentifierValue; ! private transient final HashMap idTypesByPropertyPath = new HashMap(); private transient final HashMap idColumnNamesByPropertyPath = new HashMap(); protected transient final HashMap columnNamesByPropertyPath = new HashMap(); protected transient final HashMap typesByPropertyPath = new HashMap(); ! private transient final String identifierPropertyName; private transient final Type identifierType; --- 75,94 ---- private transient final boolean useIdentityColumn; private transient final Class superclass; ! ! private transient final String identitySelectString; ! ! private transient final Class[] proxyInterfaces; ! private transient final Class concreteProxyClass; ! private transient final boolean hasProxy; private transient final boolean hasEmbeddedIdentifier; private transient final String[] identifierColumnNames; private transient final Cascades.IdentifierValue unsavedIdentifierValue; ! private transient final HashMap idTypesByPropertyPath = new HashMap(); private transient final HashMap idColumnNamesByPropertyPath = new HashMap(); protected transient final HashMap columnNamesByPropertyPath = new HashMap(); protected transient final HashMap typesByPropertyPath = new HashMap(); ! private transient final String identifierPropertyName; private transient final Type identifierType; *************** *** 96,103 **** private transient final ReflectHelper.Getter identifierGetter; private transient final Method proxyGetIdentifierMethod; ! private transient final String[] propertyNames; private transient final Type[] propertyTypes; ! private transient final String versionPropertyName; private transient final String versionColumnName; --- 96,103 ---- private transient final ReflectHelper.Getter identifierGetter; private transient final Method proxyGetIdentifierMethod; ! private transient final String[] propertyNames; private transient final Type[] propertyTypes; ! private transient final String versionPropertyName; private transient final String versionColumnName; *************** *** 113,117 **** private transient final Cascades.CascadeStyle[] cascadeStyles; ! private transient final CacheConcurrencyStrategy cache; public final Class getMappedClass() { --- 113,117 ---- private transient final Cascades.CascadeStyle[] cascadeStyles; ! private transient final CacheConcurrencyStrategy cache; public final Class getMappedClass() { *************** *** 128,135 **** for (int i=0; i<cols.length; i++) { buf.append(name) ! .append('.') ! .append( cols[i] ) ! .append(" as ") ! .append( aliasColumn(cols[i], suffix) ); if (i!=cols.length-1) buf.append(", "); } --- 128,135 ---- for (int i=0; i<cols.length; i++) { buf.append(name) ! .append('.') ! .append( cols[i] ) ! .append(" as ") ! .append( aliasColumn(cols[i], suffix) ); if (i!=cols.length-1) buf.append(", "); } *************** *** 148,166 **** String idprop = getIdentifierPropertyName(); ! if ( ! PathExpressionParser.ENTITY_ID.equals(path) || ! ( idprop!=null && path.equals(idprop) ) ){ cols = getIdentifierColumnNames(); } ! else if ( ! path.startsWith(PathExpressionParser.ENTITY_ID + '.') || ( idprop!=null && path.startsWith(idprop + '.') ) ) { int loc = path.indexOf("."); ! String componentPath = path.substring(loc+1); ! if ( getIdentifierType().isComponentType() ) { cols = getIdentifierPropertyColumnNames(componentPath); --- 148,166 ---- String idprop = getIdentifierPropertyName(); ! if ( ! PathExpressionParser.ENTITY_ID.equals(path) || ! ( idprop!=null && path.equals(idprop) ) ){ cols = getIdentifierColumnNames(); } ! else if ( ! path.startsWith(PathExpressionParser.ENTITY_ID + '.') || ( idprop!=null && path.startsWith(idprop + '.') ) ) { int loc = path.indexOf("."); ! String componentPath = path.substring(loc+1); ! if ( getIdentifierType().isComponentType() ) { cols = getIdentifierPropertyColumnNames(componentPath); *************** *** 188,199 **** String idprop = getIdentifierPropertyName(); ! if ( ! PathExpressionParser.ENTITY_ID.equals(path) || ! ( idprop!=null && path.equals(idprop) ) ){ return getIdentifierType(); ! } ! else if ( ! path.startsWith(PathExpressionParser.ENTITY_ID + '.') || ( idprop!=null && path.startsWith(idprop + '.') ) ) { --- 188,199 ---- String idprop = getIdentifierPropertyName(); ! if ( ! PathExpressionParser.ENTITY_ID.equals(path) || ! ( idprop!=null && path.equals(idprop) ) ){ return getIdentifierType(); ! } ! else if ( ! path.startsWith(PathExpressionParser.ENTITY_ID + '.') || ( idprop!=null && path.startsWith(idprop + '.') ) ) { *************** *** 209,214 **** return cascadeStyles; } ! ! /** * Set the given values to the mapped properties of the given object */ --- 209,214 ---- return cascadeStyles; } ! ! /** * Set the given values to the mapped properties of the given object */ *************** *** 219,223 **** } ! /** * Return the values of the mapped properties of the object */ --- 219,223 ---- } ! /** * Return the values of the mapped properties of the object */ *************** *** 307,311 **** } } ! // Getters and Setters --- 307,311 ---- } } ! // Getters and Setters *************** *** 345,357 **** return hasCascades; } ! public CacheConcurrencyStrategy getCache() { return cache; } ! public boolean hasIdentifierProperty() { return identifierGetter!=null; } ! public Method getProxyGetIdentifierMethod() { return proxyGetIdentifierMethod; --- 345,357 ---- return hasCascades; } ! public CacheConcurrencyStrategy getCache() { return cache; } ! public boolean hasIdentifierProperty() { return identifierGetter!=null; } ! public Method getProxyGetIdentifierMethod() { return proxyGetIdentifierMethod; *************** *** 372,384 **** return useIdentityColumn; } ! public boolean isUnsaved(Serializable id) { return unsavedIdentifierValue.isUnsaved(id); } ! public String[] getPropertyNames() { return propertyNames; } ! public String getIdentifierPropertyName() { return identifierPropertyName; --- 372,384 ---- return useIdentityColumn; } ! public boolean isUnsaved(Serializable id) { return unsavedIdentifierValue.isUnsaved(id); } ! public String[] getPropertyNames() { return propertyNames; } ! public String getIdentifierPropertyName() { return identifierPropertyName; *************** *** 388,395 **** return versionColumnName; } ! public final String[] getIdentifierPropertyColumnNames(String path) { return (String[]) idColumnNamesByPropertyPath.get(path); ! } public final Type getIdentifierPropertyType(String path) { return (Type) idTypesByPropertyPath.get(path); --- 388,395 ---- return versionColumnName; } ! public final String[] getIdentifierPropertyColumnNames(String path) { return (String[]) idColumnNamesByPropertyPath.get(path); ! } public final Type getIdentifierPropertyType(String path) { return (Type) idTypesByPropertyPath.get(path); *************** *** 402,410 **** return implementsLifecycle; } ! public boolean implementsValidatable() { return implementsValidatable; } ! public boolean hasCollections() { return hasCollections; --- 402,410 ---- return implementsLifecycle; } ! public boolean implementsValidatable() { return implementsValidatable; } ! public boolean hasCollections() { return hasCollections; *************** *** 430,434 **** return hasProxy; } ! /** * The query that returns the generated identifier for an identity column --- 430,434 ---- return hasProxy; } ! /** * The query that returns the generated identifier for an identity column *************** *** 440,457 **** public IdentifierGenerator getIdentifierGenerator() throws HibernateException { if (idgen==null) throw new HibernateException( ! "No ID SchemaExport is configured for class " + ! className + " (Try using insert() with an assigned ID)" ); return idgen; } ! protected void check(int rows, Serializable id) throws HibernateException { ! if (rows<1) { ! throw new StaleObjectStateException( getMappedClass(), id ); ! } ! else if (rows>1) { ! throw new HibernateException( "Duplicate identifier in table for " + getClassName() + ": " + id ); ! } } --- 440,457 ---- public IdentifierGenerator getIdentifierGenerator() throws HibernateException { if (idgen==null) throw new HibernateException( ! "No ID SchemaExport is configured for class " + ! className + " (Try using insert() with an assigned ID)" ); return idgen; } ! protected void check(int rows, Serializable id) throws HibernateException { ! if (rows<1) { ! throw new StaleObjectStateException( getMappedClass(), id ); ! } ! else if (rows>1) { ! throw new HibernateException( "Duplicate identifier in table for " + getClassName() + ": " + id ); ! } } *************** *** 466,470 **** mutable = model.isMutable(); ! polymorphic = model.isPolymorphic(); explicitPolymorphism = model.isExplicitPolymorphism(); --- 466,470 ---- mutable = model.isMutable(); ! polymorphic = model.isPolymorphic(); explicitPolymorphism = model.isExplicitPolymorphism(); *************** *** 472,476 **** superclass = inherited ? model.getSuperclass().getPersistentClass() : null; hasSubclasses = model.hasSubclasses(); ! constructor = ReflectHelper.getDefaultConstructor(mappedClass); abstractClass = ReflectHelper.isAbstractClass(mappedClass); --- 472,476 ---- superclass = inherited ? model.getSuperclass().getPersistentClass() : null; hasSubclasses = model.hasSubclasses(); ! constructor = ReflectHelper.getDefaultConstructor(mappedClass); abstractClass = ReflectHelper.isAbstractClass(mappedClass); *************** *** 479,486 **** hasEmbeddedIdentifier = model.hasEmbeddedIdentifier(); ! identifierPropertyName = model.hasIdentifierProperty() ? model.getIdentifierProperty().getName() : null; idgen = model.getIdentifier().getIdentifierGenerator(); Value idValue = model.getIdentifier(); ! identifierType = idValue.getType(); if (identifierPropertyName!=null) { --- 479,486 ---- hasEmbeddedIdentifier = model.hasEmbeddedIdentifier(); ! identifierPropertyName = model.hasIdentifierProperty() ? model.getIdentifierProperty().getName() : null; idgen = model.getIdentifier().getIdentifierGenerator(); Value idValue = model.getIdentifier(); ! identifierType = idValue.getType(); if (identifierPropertyName!=null) { *************** *** 502,506 **** // HYDRATE SPAN ! int m=0; Iterator iter = model.getPropertyClosureIterator(); --- 502,506 ---- // HYDRATE SPAN ! int m=0; Iterator iter = model.getPropertyClosureIterator(); *************** *** 509,513 **** } hydrateSpan=m; ! // IDENTIFIER --- 509,513 ---- } hydrateSpan=m; ! // IDENTIFIER *************** *** 523,528 **** i++; } ! ! if ( idValue.isComposite() ) { --- 523,528 ---- i++; } ! ! if ( idValue.isComposite() ) { *************** *** 536,540 **** Iterator colIter= prop.getColumnIterator(); int j=0; ! while ( colIter.hasNext() ) { Column col = (Column) colIter.next(); cols[j++] = col.getName(); --- 536,540 ---- Iterator colIter= prop.getColumnIterator(); int j=0; ! while ( colIter.hasNext() ) { Column col = (Column) colIter.next(); cols[j++] = col.getName(); *************** *** 548,586 **** } ! } - IdentifierGenerator idgen = model.getIdentifier().getIdentifierGenerator(); useIdentityColumn = dialect.supportsIdentityColumns() && ( idgen instanceof NativeGenerator ); identitySelectString = (useIdentityColumn) ? dialect.getIdentitySelectString() : null; ! ! ! // UNSAVED-VALUE: ! ! String cts = model.getIdentifier().getNullValue(); ! if ( cts==null || "any".equals(cts) ) { ! unsavedIdentifierValue=Cascades.SAVE_ANY; ! } ! else if ( "none".equals(cts) ) { ! unsavedIdentifierValue=Cascades.SAVE_NONE; ! } ! else if ( "null".equals(cts) ) { ! unsavedIdentifierValue=Cascades.SAVE_NULL; ! } else { ! try { ! unsavedIdentifierValue = new Cascades.IdentifierValue( ( (IdentifierType) model.getIdentifier().getType() ).stringToObject(cts) ); ! } catch (ClassCastException cce) { throw new MappingException("Bad identifier type: " + model.getIdentifier().getType().getClass().getName() ); } ! catch (Exception e) { ! throw new MappingException("Could not parse unsaved-value: " + cts); ! } } ! ! // VERSION: ! ! if ( model.isVersioned() ) { versionColumnName = ( (Column) model.getVersion().getColumnIterator().next() ).getName(); } --- 548,586 ---- } ! } ! IdentifierGenerator idgen = model.getIdentifier().getIdentifierGenerator(); useIdentityColumn = dialect.supportsIdentityColumns() && ( idgen instanceof NativeGenerator ); identitySelectString = (useIdentityColumn) ? dialect.getIdentitySelectString() : null; ! ! ! // UNSAVED-VALUE: ! ! String cts = model.getIdentifier().getNullValue(); ! if ( cts==null || "any".equals(cts) ) { ! unsavedIdentifierValue=Cascades.SAVE_ANY; ! } ! else if ( "none".equals(cts) ) { ! unsavedIdentifierValue=Cascades.SAVE_NONE; ! } ! else if ( "null".equals(cts) ) { ! unsavedIdentifierValue=Cascades.SAVE_NULL; ! } else { ! try { ! unsavedIdentifierValue = new Cascades.IdentifierValue( ( (IdentifierType) model.getIdentifier().getType() ).stringToObject(cts) ); ! } catch (ClassCastException cce) { throw new MappingException("Bad identifier type: " + model.getIdentifier().getType().getClass().getName() ); } ! catch (Exception e) { ! throw new MappingException("Could not parse unsaved-value: " + cts); ! } } ! ! // VERSION: ! ! if ( model.isVersioned() ) { versionColumnName = ( (Column) model.getVersion().getColumnIterator().next() ).getName(); } *************** *** 609,618 **** setters = new ReflectHelper.Setter[hydrateSpan]; cascadeStyles = new Cascades.CascadeStyle[hydrateSpan]; ! iter = model.getPropertyClosureIterator(); i=0; int tempVersionProperty=-66; boolean foundCascade = false; ! while( iter.hasNext() ) { Property prop = (Property) iter.next(); --- 609,618 ---- setters = new ReflectHelper.Setter[hydrateSpan]; cascadeStyles = new Cascades.CascadeStyle[hydrateSpan]; ! iter = model.getPropertyClosureIterator(); i=0; int tempVersionProperty=-66; boolean foundCascade = false; ! while( iter.hasNext() ) { Property prop = (Property) iter.next(); *************** *** 625,629 **** cascadeStyles[i] = prop.cascade(); if ( cascadeStyles[i]!=Cascades.STYLE_NONE ) foundCascade = true; ! i++; } --- 625,629 ---- cascadeStyles[i] = prop.cascade(); if ( cascadeStyles[i]!=Cascades.STYLE_NONE ) foundCascade = true; ! i++; } *************** *** 631,635 **** hasCascades = foundCascade; versionProperty = tempVersionProperty; ! // CALLBACK INTERFACES implementsLifecycle = Lifecycle.class.isAssignableFrom(mappedClass); --- 631,635 ---- hasCascades = foundCascade; versionProperty = tempVersionProperty; ! // CALLBACK INTERFACES implementsLifecycle = Lifecycle.class.isAssignableFrom(mappedClass); *************** *** 661,665 **** proxyInterfaces = (Class[]) pis.toArray(NO_CLASSES); } ! private boolean initHasCollections() { return initHasCollections(propertyTypes); --- 661,665 ---- proxyInterfaces = (Class[]) pis.toArray(NO_CLASSES); } ! private boolean initHasCollections() { return initHasCollections(propertyTypes); *************** *** 672,676 **** } else if ( types[i].isComponentType() ) { ! if ( initHasCollections( ( (AbstractComponentType) types[i] ).getSubtypes() ) ) return true; --- 672,676 ---- } else if ( types[i].isComponentType() ) { ! if ( initHasCollections( ( (AbstractComponentType) types[i] ).getSubtypes() ) ) return true; *************** *** 679,687 **** return false; } ! public ClassMetadata getClassMetadata() { return this; } ! public Class getConcreteProxyClass() { return concreteProxyClass; --- 679,687 ---- return false; } ! public ClassMetadata getClassMetadata() { return this; } ! public Class getConcreteProxyClass() { return concreteProxyClass; *************** *** 690,707 **** //TODO: refactor! this is a duplicate of a method in the Loader heirarchy protected static String aliasColumn(String name, String suffix) { ! char quote = name.charAt(0); ! boolean nameEscaped = Dialect.QUOTE.indexOf(quote) > -1; ! ! if (nameEscaped) name = name.substring(1, name.length()-1); ! ! StringBuffer aliasBuilder = new StringBuffer(name.length()); ! ! if (nameEscaped) aliasBuilder.append(quote); ! aliasBuilder.append(name); ! aliasBuilder.append(suffix); ! if (nameEscaped) aliasBuilder.append(quote); ! ! return aliasBuilder.toString(); } --- 690,707 ---- //TODO: refactor! this is a duplicate of a method in the Loader heirarchy protected static String aliasColumn(String name, String suffix) { ! char quote = name.charAt(0); ! boolean nameEscaped = Dialect.QUOTE.indexOf(quote) > -1; ! ! if (nameEscaped) name = name.substring(1, name.length()-1); ! ! StringBuffer aliasBuilder = new StringBuffer(name.length()); ! ! if (nameEscaped) aliasBuilder.append(quote); ! aliasBuilder.append(name); ! aliasBuilder.append(suffix); ! if (nameEscaped) aliasBuilder.append(quote); ! ! return aliasBuilder.toString(); } *************** *** 709,716 **** return superclass; } ! public boolean isExplicitPolymorphism() { return explicitPolymorphism; } ! } --- 709,719 ---- return superclass; } ! public boolean isExplicitPolymorphism() { return explicitPolymorphism; } ! } + + + Index: ClassPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/ClassPersister.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ClassPersister.java 1 Jan 2003 13:56:33 -0000 1.1.1.1 --- ClassPersister.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 18,33 **** import net.sf.hibernate.metadata.ClassMetadata; ! /** * Concrete <tt>ClassPersister</tt>s implement mapping and persistence logic for * a particular persistent class.<br> * <br> * Implementors must be threadsafe (preferrably immutable) and must provide a constructor ! * of type * <tt>(net.sf.hibernate.map.PersistentClass, net.sf.hibernate.impl.SessionFactoryImplementor)</tt>. ! * * @see EntityPersister */ public interface ClassPersister extends Serializable { ! /** * Finish the initialization of this object, once all <tt>ClassPersisters</tt> have --- 18,33 ---- import net.sf.hibernate.metadata.ClassMetadata; ! /** * Concrete <tt>ClassPersister</tt>s implement mapping and persistence logic for * a particular persistent class.<br> * <br> * Implementors must be threadsafe (preferrably immutable) and must provide a constructor ! * of type * <tt>(net.sf.hibernate.map.PersistentClass, net.sf.hibernate.impl.SessionFactoryImplementor)</tt>. ! * * @see EntityPersister */ public interface ClassPersister extends Serializable { ! /** * Finish the initialization of this object, once all <tt>ClassPersisters</tt> have *************** *** 57,61 **** */ public String getClassName(); ! /** * Does it have a composite key? --- 57,61 ---- */ public String getClassName(); ! /** * Does it have a composite key? *************** *** 95,99 **** */ public boolean hasCollections(); ! /** * Does this class declare any cascading save/update/deletes? --- 95,99 ---- */ public boolean hasCollections(); ! /** * Does this class declare any cascading save/update/deletes? *************** *** 117,127 **** */ public boolean isUnsaved(Serializable id); ! ! /** * Set the given values to the mapped properties of the given object */ public void setPropertyValues(Object object, Object[] values) throws HibernateException; ! /** * Return the values of the mapped properties of the object */ --- 117,127 ---- */ public boolean isUnsaved(Serializable id); ! ! /** * Set the given values to the mapped properties of the given object */ public void setPropertyValues(Object object, Object[] values) throws HibernateException; ! /** * Return the values of the mapped properties of the object */ *************** *** 132,141 **** */ public void setPropertyValue(Object object, int i, Object value) throws HibernateException; ! /** * Get the value of a particular property */ public Object getPropertyValue(Object object, int i) throws HibernateException; ! /** * Compare two snapshots of the state of an instance to determine if the persistent state was modified --- 132,141 ---- */ public void setPropertyValue(Object object, int i, Object value) throws HibernateException; ! /** * Get the value of a particular property */ public Object getPropertyValue(Object object, int i) throws HibernateException; ! /** * Compare two snapshots of the state of an instance to determine if the persistent state was modified *************** *** 163,167 **** */ public Method getProxyGetIdentifierMethod(); ! /** * Are instances of this class versioned by a timestamp or version number column? --- 163,167 ---- */ public Method getProxyGetIdentifierMethod(); ! /** * Are instances of this class versioned by a timestamp or version number column? *************** *** 188,192 **** */ public Object instantiate(Serializable id) throws HibernateException; ! /** * Return the <tt>IdentifierGenerator</tt> for the class --- 188,192 ---- */ public Object instantiate(Serializable id) throws HibernateException; ! /** * Return the <tt>IdentifierGenerator</tt> for the class *************** *** 198,202 **** */ public Object load(Serializable id, Object optionalObject, LockMode lockMode, SessionImplementor session) throws HibernateException, SQLException; ! /** * Do a version check (optional operation) --- 198,202 ---- */ public Object load(Serializable id, Object optionalObject, LockMode lockMode, SessionImplementor session) throws HibernateException, SQLException; ! /** * Do a version check (optional operation) *************** *** 204,213 **** public void lock(Serializable id, Object version, Object object, LockMode lockMode, SessionImplementor session) throws HibernateException, SQLException; ! /** * Persist an instance */ public void insert(Serializable id, Object[] fields, Object object, SessionImplementor session) throws SQLException, HibernateException; ! /** * Persist an instance, using a natively generated identifier (optional operation) */ --- 204,213 ---- public void lock(Serializable id, Object version, Object object, LockMode lockMode, SessionImplementor session) throws HibernateException, SQLException; ! /** * Persist an instance */ public void insert(Serializable id, Object[] fields, Object object, SessionImplementor session) throws SQLException, HibernateException; ! /** * Persist an instance, using a natively generated identifier (optional operation) */ *************** *** 216,227 **** /** * Delete a persistent instance ! */ public void delete(Serializable id, Object version, Object object, SessionImplementor session) throws SQLException, HibernateException; /** * Update a persistent instance ! */ ! public void update(Serializable id, Object[] fields, int[] dirtyFields, Object oldVersion, Object object, SessionImplementor session) throws SQLException, HibernateException; ! /** * Get the Hibernate types of the class properties --- 216,227 ---- /** * Delete a persistent instance ! */ public void delete(Serializable id, Object version, Object object, SessionImplementor session) throws SQLException, HibernateException; /** * Update a persistent instance ! */ ! public void update(Serializable id, Object[] fields, int[] dirtyFields, Object oldVersion, Object object, SessionImplementor session) throws SQLException, HibernateException; ! /** * Get the Hibernate types of the class properties *************** *** 230,234 **** /** ! * Get the names of the class properties - doesn't have to be the names of the * actual Java properties (used for XML generation only) */ --- 230,234 ---- /** ! * Get the names of the class properties - doesn't have to be the names of the * actual Java properties (used for XML generation only) */ *************** *** 239,243 **** */ public Cascades.CascadeStyle[] getPropertyCascadeStyles(); ! /** * Get the identifier type --- 239,243 ---- */ public Cascades.CascadeStyle[] getPropertyCascadeStyles(); ! /** * Get the identifier type *************** *** 246,251 **** /** ! * Get the name of the identifier property (or return null) - need not return the ! * name of an actual Java property */ public String getIdentifierPropertyName(); --- 246,251 ---- /** ! * Get the name of the identifier property (or return null) - need not return the ! * name of an actual Java property */ public String getIdentifierPropertyName(); *************** *** 266,269 **** --- 266,272 ---- } + + + Index: EntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/EntityPersister.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** EntityPersister.java 1 Jan 2003 13:56:37 -0000 1.1.1.1 --- EntityPersister.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 44,69 **** import net.sf.hibernate.engine.Versioning; ! /** * The default implementation of the <tt>ClassPersister</tt> interface. ! * Implements the "table-per-class hierarchy" mapping strategy for an entity * class.<br> */ public class EntityPersister extends AbstractEntityPersister implements Queryable { ! private final SessionFactoryImplementor factory; [...1022 lines suppressed...] buf.append(", ") ! .append(name) ! .append('.') ! .append( cols[i] ) ! .append(" as ") ! .append( aliasColumn(cols[i], suffix) ); } return buf.toString(); } ! public String getConcreteClassAlias(String alias) { return alias; } ! } + + + Index: Loadable.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/Loadable.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Loadable.java 1 Jan 2003 13:56:37 -0000 1.1.1.1 --- Loadable.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 8,12 **** * Implemented by a <tt>ClassPersister</tt> that uses <tt>Loader</tt>. There are several optional * operations used only by loaders that inherit <tt>OuterJoinLoader</tt>. ! * * @see net.sf.hibernate.loader.Loader * @see net.sf.hibernate.loader.OuterJoinLoader --- 8,12 ---- * Implemented by a <tt>ClassPersister</tt> that uses <tt>Loader</tt>. There are several optional * operations used only by loaders that inherit <tt>OuterJoinLoader</tt>. ! * * @see net.sf.hibernate.loader.Loader * @see net.sf.hibernate.loader.OuterJoinLoader *************** *** 23,27 **** */ public boolean hasSubclasses(); ! /** * Get the name of the column used as a discriminator --- 23,27 ---- */ public boolean hasSubclasses(); ! /** * Get the name of the column used as a discriminator *************** *** 36,40 **** /** * Get the concrete subclass corresponding to the given discriminator ! * value */ public Class getSubclassForDiscriminatorValue(Object value); --- 36,40 ---- /** * Get the concrete subclass corresponding to the given discriminator ! * value */ public Class getSubclassForDiscriminatorValue(Object value); *************** *** 44,48 **** */ public String[] getPropertyColumnNames(int i); ! //USED BY OuterJoinLoader + subclasses --- 44,48 ---- */ public String[] getPropertyColumnNames(int i); ! //USED BY OuterJoinLoader + subclasses *************** *** 51,55 **** */ public String getTableName(); ! /** * How many properties are there, for this class and all subclasses? --- 51,55 ---- */ public String getTableName(); ! /** * How many properties are there, for this class and all subclasses? *************** *** 87,91 **** */ public String[] toColumns(String name, int i); ! /** * Given a query alias and an identifying suffix, render the --- 87,91 ---- */ public String[] toColumns(String name, int i); ! /** * Given a query alias and an identifying suffix, render the *************** *** 116,117 **** --- 116,120 ---- } + + + Index: MultiTableEntityPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/MultiTableEntityPersister.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** MultiTableEntityPersister.java 1 Jan 2003 13:56:40 -0000 1.1.1.1 --- MultiTableEntityPersister.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 46,55 **** import net.sf.hibernate.engine.Versioning; ! /** * A <tt>ClassPersister</tt> implementing the normalized "table-per-subclass" * mapping strategy.<br> */ public class MultiTableEntityPersister extends AbstractEntityPersister { ! private final SessionFactoryImplementor factory; [...1216 lines suppressed...] if (tab!=0) buf.append('_').append(tab); buf.append('.') ! .append( cols[i] ) ! .append(" as ") ! .append( aliasColumn( subclassColumnClosureAliases[i], suffix) ); } return buf.toString(); } ! public String getConcreteClassAlias(String alias) { int tab = tableNumbers[ tableNumbers.length-1 ]; return alias + ( (tab==0) ? "" : '_' +Integer.toString(tab) ); } ! } + + + Index: Queryable.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/persister/Queryable.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Queryable.java 1 Jan 2003 13:56:40 -0000 1.1.1.1 --- Queryable.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 30,34 **** */ public String getDiscriminatorSQLString(); ! /** * Given a component path expression, get the type of the property --- 30,34 ---- */ public String getDiscriminatorSQLString(); ! /** * Given a component path expression, get the type of the property *************** *** 57,58 **** --- 57,61 ---- public String[] toColumns(String name, String property) throws QueryException; } + + + |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/class2hbm In directory sc8-pr-cvs1:/tmp/cvs-serv14211/src/net/sf/hibernate/tool/class2hbm Modified Files: MapGenerator.java ReflectedArrayProperty.java ReflectedClass.java ReflectedCollectionProperty.java ReflectedComponent.java ReflectedListProperty.java ReflectedMapProperty.java ReflectedProperty.java ReflectedSetProperty.java Log Message: reformatted code with beautiful, shiny, happy TABS! improved an exception Index: MapGenerator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/class2hbm/MapGenerator.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** MapGenerator.java 1 Jan 2003 13:57:22 -0000 1.1.1.1 --- MapGenerator.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 75,84 **** */ public class MapGenerator { ! private static String defaultKeys[] = { "uid", "UID", "id", "ID", "key", "KEY", "pk", "PK" }; private ClassLoader classLoader; private boolean verbose = true; ! public static void main(String[] args) { --- 75,84 ---- */ public class MapGenerator { ! private static String defaultKeys[] = { "uid", "UID", "id", "ID", "key", "KEY", "pk", "PK" }; private ClassLoader classLoader; private boolean verbose = true; ! public static void main(String[] args) { *************** *** 87,99 **** if( len == 0 ) { System.out.println( "<!-- No args provided, no classes reflected! -->" ); ! } else if( len == 1 && "--interact".equals(args[0]) ){ MapGenerator map = new MapGenerator( null, ClassLoader.getSystemClassLoader() ); map.interact(); ! } else { //MapGenerator map = new MapGenerator( args ); MapGenerator map = new MapGenerator( null, ClassLoader.getSystemClassLoader() ); for( int i=0; i<len; i++ ) { if(args[i].startsWith("--")) { ! /* Shouldn't all of these options be else if? (Everman) */ if(args[i].startsWith("--setUID=")) { --- 87,101 ---- if( len == 0 ) { System.out.println( "<!-- No args provided, no classes reflected! -->" ); ! } ! else if( len == 1 && "--interact".equals(args[0]) ){ MapGenerator map = new MapGenerator( null, ClassLoader.getSystemClassLoader() ); map.interact(); ! } ! else { //MapGenerator map = new MapGenerator( args ); MapGenerator map = new MapGenerator( null, ClassLoader.getSystemClassLoader() ); for( int i=0; i<len; i++ ) { if(args[i].startsWith("--")) { ! /* Shouldn't all of these options be else if? (Everman) */ if(args[i].startsWith("--setUID=")) { *************** *** 109,113 **** catch( NumberFormatException e ) { System.err.println("<!-- Can't set maxDepth " ! + e.getMessage() + "-->"); } } --- 111,115 ---- catch( NumberFormatException e ) { System.err.println("<!-- Can't set maxDepth " ! + e.getMessage() + "-->"); } } *************** *** 118,122 **** outputWriter = makeWriter( args[i].substring(9) ); } ! //Next option added by Eric Everman 5-16-2002 //See protected abstractClasses for details --- 120,124 ---- outputWriter = makeWriter( args[i].substring(9) ); } ! //Next option added by Eric Everman 5-16-2002 //See protected abstractClasses for details *************** *** 143,147 **** } } ! private static FileWriter makeWriter( String fileName ) { try { --- 145,149 ---- } } ! private static FileWriter makeWriter( String fileName ) { try { *************** *** 155,163 **** } } ! /** how low will you go? the depth of component nesting followed */ protected int maxDepth = 0; ! /** candidate UID property names; presence of one of these with a * supported type (String, Long, long) will stop --- 157,165 ---- } } ! /** how low will you go? the depth of component nesting followed */ protected int maxDepth = 0; ! /** candidate UID property names; presence of one of these with a * supported type (String, Long, long) will stop *************** *** 166,180 **** */ protected String[] niceKeys = defaultKeys; ! /** the XML we make; this buffer is shared by all string emitters * created by this MapGenerator instance */ protected StringBuffer buf; ! /** a cache of seen reflected classes; Class -> ReflectedClass * <br>also necessary to avoid infinite regress */ protected Hashtable rClasses; ! /** * <p>A list of class names which are treated as 'abstract' in that they are not --- 168,182 ---- */ protected String[] niceKeys = defaultKeys; ! /** the XML we make; this buffer is shared by all string emitters * created by this MapGenerator instance */ protected StringBuffer buf; ! /** a cache of seen reflected classes; Class -> ReflectedClass * <br>also necessary to avoid infinite regress */ protected Hashtable rClasses; ! /** * <p>A list of class names which are treated as 'abstract' in that they are not *************** *** 197,201 **** */ protected Hashtable abstractClasses = new Hashtable(5); ! /** a cache of emitted components for the current property; Class -> Integer * <br>also necessary to avoid infinite regress by tracking --- 199,203 ---- */ protected Hashtable abstractClasses = new Hashtable(5); ! /** a cache of emitted components for the current property; Class -> Integer * <br>also necessary to avoid infinite regress by tracking *************** *** 203,227 **** */ protected Hashtable cycleBuster; ! /** just to prevent duplicate table names; String -> Integer */ private Hashtable usedTableNames; ! /** just to prevent duplicate column names; String -> Integer */ private Hashtable usedColumnNames; ! /** the top level collections; <br> currently just a placeholder * because top level collections are not supported */ private Vector entities; ! /** the top level (most souper) ReflectedClasses; * <br>these are the classes eventually dumped as <class> in the XML */ private Vector roots; ! private char[] prefix = StringHelper.repeat("\t", 100).toCharArray(); ! /** the only MapGenerator constructor * --- 205,229 ---- */ protected Hashtable cycleBuster; ! /** just to prevent duplicate table names; String -> Integer */ private Hashtable usedTableNames; ! /** just to prevent duplicate column names; String -> Integer */ private Hashtable usedColumnNames; ! /** the top level collections; <br> currently just a placeholder * because top level collections are not supported */ private Vector entities; ! /** the top level (most souper) ReflectedClasses; * <br>these are the classes eventually dumped as <class> in the XML */ private Vector roots; ! private char[] prefix = StringHelper.repeat("\t", 100).toCharArray(); ! /** the only MapGenerator constructor * *************** *** 238,244 **** } } ! private String interact_usage = "usage: class.name | uid=<newUID> | done"; ! /** won't somebody please make a GUI? */ --- 240,246 ---- } } ! private String interact_usage = "usage: class.name | uid=<newUID> | done"; ! /** won't somebody please make a GUI? */ *************** *** 249,253 **** System.out.println(interact_usage); System.out.print("? "); ! boolean allIsWell = true; while( allIsWell ) { int tt; --- 251,255 ---- System.out.println(interact_usage); System.out.print("? "); ! boolean allIsWell = true; while( allIsWell ) { int tt; *************** *** 263,291 **** case StreamTokenizer.TT_EOL: st.eolIsSignificant(false); break; case StreamTokenizer.TT_NUMBER: ! System.out.println("number!? "); ! System.out.println(interact_usage); ! System.out.print("? "); ! break; case StreamTokenizer.TT_WORD: ! String name = st.sval; ! if( "done".equals(name) ) { ! allIsWell = false; ! } ! else if( name.startsWith("uid=") ) { ! String uid = name.substring(4); ! System.out.print("niceKey(" + uid + ")=>" ); // debug ! addUID( uid ); ! for( int i=0; i<niceKeys.length; i++ ) { ! System.out.print(" "); ! System.out.print(niceKeys[i]); ! } ! System.out.print("\n? "); ! } ! else { ! System.out.println("addClass(" + name + ")" ); // debug ! addClass( name, true ); ! System.out.print("? "); } ! break; default: /* ignore */ break; } --- 265,293 ---- case StreamTokenizer.TT_EOL: st.eolIsSignificant(false); break; case StreamTokenizer.TT_NUMBER: ! System.out.println("number!? "); ! System.out.println(interact_usage); ! System.out.print("? "); ! break; case StreamTokenizer.TT_WORD: ! String name = st.sval; ! if( "done".equals(name) ) { ! allIsWell = false; ! } ! else if( name.startsWith("uid=") ) { ! String uid = name.substring(4); ! System.out.print("niceKey(" + uid + ")=>" ); // debug ! addUID( uid ); ! for( int i=0; i<niceKeys.length; i++ ) { ! System.out.print(" "); ! System.out.print(niceKeys[i]); } ! System.out.print("\n? "); ! } ! else { ! System.out.println("addClass(" + name + ")" ); // debug ! addClass( name, true ); ! System.out.print("? "); ! } ! break; default: /* ignore */ break; } *************** *** 293,297 **** System.out.println( getXML() ); } ! /** * start over --- 295,299 ---- System.out.println( getXML() ); } ! /** * start over *************** *** 304,312 **** this.usedTableNames = new Hashtable(); buf.append("<?xml version=\"1.0\"?>\n") ! .append("<!DOCTYPE hibernate-mapping PUBLIC\n") ! .append("\t\"-//Hibernate/Hibernate Mapping DTD//EN\"\n") ! .append("\t\"http://hibernate.sourceforge.net/hibernate-mapping.dtd\">\n"); } ! /** * add a class to the map and reflect upon it --- 306,314 ---- this.usedTableNames = new Hashtable(); buf.append("<?xml version=\"1.0\"?>\n") ! .append("<!DOCTYPE hibernate-mapping PUBLIC\n") ! .append("\t\"-//Hibernate/Hibernate Mapping DTD//EN\"\n") ! .append("\t\"http://hibernate.sourceforge.net/hibernate-mapping.dtd\">\n"); } ! /** * add a class to the map and reflect upon it *************** *** 321,330 **** if( rc == null && verbose ) { buf.append("<!-- ") ! .append(clazz.getName()) ! .append(" cannot be added, no UID found! -->\n"); } } } ! /** * set the list of candidate UIDs to a single name --- 323,332 ---- if( rc == null && verbose ) { buf.append("<!-- ") ! .append(clazz.getName()) ! .append(" cannot be added, no UID found! -->\n"); } } } ! /** * set the list of candidate UIDs to a single name *************** *** 335,339 **** niceKeys = uida; } ! /** * add a new name to the front of the list of candidate UIDs --- 337,341 ---- niceKeys = uida; } ! /** * add a new name to the front of the list of candidate UIDs *************** *** 353,357 **** } } ! /** used by gui */ public ReflectedClass[] getRoots() { --- 355,359 ---- } } ! /** used by gui */ public ReflectedClass[] getRoots() { *************** *** 360,376 **** return v; } ! private ReflectedClass reallyAdd( Class clazz, boolean verbose ) { ReflectedClass rc = (ReflectedClass) rClasses.get(clazz); ! Class superclass = clazz.getSuperclass(); if( rc == null ) { // not already added rc = new ReflectedClass( this, clazz ); ! } else if( rc.isPersistent() ) { if( verbose ) { buf.append("<!-- ") ! .append(clazz.getName()) ! .append(" already added -->\n"); } return rc; --- 362,378 ---- return v; } ! private ReflectedClass reallyAdd( Class clazz, boolean verbose ) { ReflectedClass rc = (ReflectedClass) rClasses.get(clazz); ! Class superclass = clazz.getSuperclass(); if( rc == null ) { // not already added rc = new ReflectedClass( this, clazz ); ! } else if( rc.isPersistent() ) { if( verbose ) { buf.append("<!-- ") ! .append(clazz.getName()) ! .append(" already added -->\n"); } return rc; *************** *** 381,405 **** // add properties from superclasses rc.addSuperclassProps(); ! roots.add( rc ); ! } else if ( // added by Eric Everman on 5-16-2002 ! superclass!=null && ! abstractClasses.containsKey( superclass.getName() ) ) { //The user has requested that class diving go no farther by //marking the next class up the chain as abstract. ! rc.addSuperclassProps(); //add superclass props ! if( rc.getUidProp( niceKeys ) != null ) { //Thank goodness, its persistable roots.add( rc ); ! } else { //User specified an abstract 'root' class which is not persistable rc.setPersistent( false ); return null; //generic can't add message generated by addClass } ! ! } else { // add superclasses 'til root is found --- 383,408 ---- // add properties from superclasses rc.addSuperclassProps(); ! roots.add( rc ); ! } else if ( // added by Eric Everman on 5-16-2002 ! superclass!=null && ! abstractClasses.containsKey( superclass.getName() ) ) { //The user has requested that class diving go no farther by //marking the next class up the chain as abstract. ! rc.addSuperclassProps(); //add superclass props ! if( rc.getUidProp( niceKeys ) != null ) { //Thank goodness, its persistable roots.add( rc ); ! } ! else { //User specified an abstract 'root' class which is not persistable rc.setPersistent( false ); return null; //generic can't add message generated by addClass } ! ! } else { // add superclasses 'til root is found *************** *** 410,414 **** // report!? (addClass will do it when it sees null) return null; ! } else { ReflectedClass sup = reallyAdd( superclass, false ); // recurse --- 413,417 ---- // report!? (addClass will do it when it sees null) return null; ! } else { ReflectedClass sup = reallyAdd( superclass, false ); // recurse *************** *** 423,427 **** return rc; } ! class PEntity { // we don't make these yet --- 426,430 ---- return rc; } ! class PEntity { // we don't make these yet *************** *** 430,434 **** } } ! /** used to make unique table and column names * @param best is the desired name --- 433,437 ---- } } ! /** used to make unique table and column names * @param best is the desired name *************** *** 457,461 **** return nextName( best, usedColumnNames ); } ! /** adds spaces to the front of lines in buf for indentation * @param n indentation level --- 460,464 ---- return nextName( best, usedColumnNames ); } ! /** adds spaces to the front of lines in buf for indentation * @param n indentation level *************** *** 466,470 **** buf.append( prefix, 0, e ); } ! /** after all classes are added * @return the XML --- 469,473 ---- buf.append( prefix, 0, e ); } ! /** after all classes are added * @return the XML *************** *** 489,493 **** return buf.toString(); } ! private Class checkClassNamed( String className, boolean v ) { try { --- 492,496 ---- return buf.toString(); } ! private Class checkClassNamed( String className, boolean v ) { try { *************** *** 497,508 **** catch( Exception e ) { if(v) buf.append("<!-- Class ") ! .append(className) ! .append(" gave exception ") ! .append(e) ! .append(" -->\n"); return null; } } ! /** this is the factory to make a ReflectedProperty * <br>using this factory will insure that the property --- 500,511 ---- catch( Exception e ) { if(v) buf.append("<!-- Class ") ! .append(className) ! .append(" gave exception ") ! .append(e) ! .append(" -->\n"); return null; } } ! /** this is the factory to make a ReflectedProperty * <br>using this factory will insure that the property *************** *** 516,520 **** String tynm = cls.getName(); Type htyp = TypeFactory.basic(tynm); ! if ( htyp != null ) { return new ReflectedProperty( name, cls, this, "basic" ); --- 519,523 ---- String tynm = cls.getName(); Type htyp = TypeFactory.basic(tynm); ! if ( htyp != null ) { return new ReflectedProperty( name, cls, this, "basic" ); *************** *** 557,561 **** } } ! /** verify that a class is <b>hibernate-persistable</b> * --- 560,564 ---- } } ! /** verify that a class is <b>hibernate-persistable</b> * *************** *** 603,607 **** return null; } ! */ // must have a default constructor Constructor z; --- 606,610 ---- return null; } ! */ // must have a default constructor Constructor z; *************** *** 616,621 **** // ugh if(v) buf.append(c) ! .append(className) ! .append(" cannot be reflected due to a SecurityException! -->\n"); return null; } --- 619,624 ---- // ugh if(v) buf.append(c) ! .append(className) ! .append(" cannot be reflected due to a SecurityException! -->\n"); return null; } *************** *** 634,639 **** // ugh if(v) buf.append(c) ! .append(className) ! .append(" cannot be reflected due to a SecurityException! -->\n"); return null; } --- 637,642 ---- // ugh if(v) buf.append(c) ! .append(className) ! .append(" cannot be reflected due to a SecurityException! -->\n"); return null; } *************** *** 641,646 **** if( z == null ) { if(v) buf.append(c) ! .append(className) ! .append(" has no 0-arg constructor! -->\n"); return null; } --- 644,649 ---- if( z == null ) { if(v) buf.append(c) ! .append(className) ! .append(" has no 0-arg constructor! -->\n"); return null; } *************** *** 648,657 **** return clazz; } ! public void setClassLoader(ClassLoader classLoader) { this.classLoader = classLoader; } ! ! } --- 651,660 ---- return clazz; } ! public void setClassLoader(ClassLoader classLoader) { this.classLoader = classLoader; } ! ! } *************** *** 670,672 **** --- 673,678 ---- * */ + + + Index: ReflectedArrayProperty.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/class2hbm/ReflectedArrayProperty.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ReflectedArrayProperty.java 1 Jan 2003 13:57:23 -0000 1.1.1.1 --- ReflectedArrayProperty.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 6,10 **** */ class ReflectedArrayProperty extends ReflectedProperty { ! protected ReflectedProperty element; --- 6,10 ---- */ class ReflectedArrayProperty extends ReflectedProperty { ! protected ReflectedProperty element; *************** *** 28,32 **** this.element = map.makeProperty( roleName, elmcls ); // TO DO ! // if elmcls is a collection, it would be nice to make // the top level collection template here with role name roleName } --- 28,32 ---- this.element = map.makeProperty( roleName, elmcls ); // TO DO ! // if elmcls is a collection, it would be nice to make // the top level collection template here with role name roleName } *************** *** 41,49 **** emitCollectionInCompositeStr(level); } ! ! //<!ELEMENT array (key, index, (element|one-to-many|many-to-many|subcollection|composite-element))> ! // <!ATTLIST array role CDATA #REQUIRED> ! // <!ATTLIST array table CDATA #IMPLIED> ! protected void getXML( int level, StringBuffer buf ) { this.buf = buf; --- 41,49 ---- emitCollectionInCompositeStr(level); } ! ! //<!ELEMENT array (key, index, (element|one-to-many|many-to-many|subcollection|composite-element))> ! // <!ATTLIST array role CDATA #REQUIRED> ! // <!ATTLIST array table CDATA #IMPLIED> ! protected void getXML( int level, StringBuffer buf ) { this.buf = buf; *************** *** 64,65 **** --- 64,68 ---- } } + + + Index: ReflectedClass.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/class2hbm/ReflectedClass.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ReflectedClass.java 1 Jan 2003 13:57:24 -0000 1.1.1.1 --- ReflectedClass.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 10,16 **** /** a ReflectedClass is created by MapGenerator instances for ! * every class encountered, from map.addClass(), while chasing the * superclass chain, or grokking properties ! * * @version 1.x * @author <a href="mailto:dou...@al...">e</a> --- 10,16 ---- /** a ReflectedClass is created by MapGenerator instances for ! * every class encountered, from map.addClass(), while chasing the * superclass chain, or grokking properties ! * * @version 1.x * @author <a href="mailto:dou...@al...">e</a> *************** *** 25,30 **** private ReflectedProperty uid; private boolean persistent; // true => persistent class or subclass ! // false => component or serializable ! private Hashtable setprops; private Hashtable getprops; --- 25,30 ---- private ReflectedProperty uid; private boolean persistent; // true => persistent class or subclass ! // false => component or serializable ! private Hashtable setprops; private Hashtable getprops; *************** *** 44,48 **** return clazz.getName(); } ! /** used by gui */ public ReflectedProperty[] getProperties() { --- 44,48 ---- return clazz.getName(); } ! /** used by gui */ public ReflectedProperty[] getProperties() { *************** *** 55,59 **** return rp; } ! /** used by gui */ public ReflectedClass[] getSubclasses() { --- 55,59 ---- return rp; } ! /** used by gui */ public ReflectedClass[] getSubclasses() { *************** *** 62,66 **** return v; } ! protected void addReflectedClass( ReflectedClass rc ) { subs.add( rc ); --- 62,66 ---- return v; } ! protected void addReflectedClass( ReflectedClass rc ) { subs.add( rc ); *************** *** 92,96 **** return ( props.size() != 0 ); } ! /** add to this class the properties of all its superclasses */ --- 92,96 ---- return ( props.size() != 0 ); } ! /** add to this class the properties of all its superclasses */ *************** *** 105,110 **** } } ! ! /** dump the OR-Mapping XML for a root class and all of its subclasses * that share a table and UID */ --- 105,110 ---- } } ! ! /** dump the OR-Mapping XML for a root class and all of its subclasses * that share a table and UID */ *************** *** 117,130 **** map.emitPrefix(level);; buf.append("<!-- ") ! .append(name) ! .append(" root -->\n"); // a root class -- polymorphic style map.emitPrefix(level);; buf.append("<class name=\"") ! .append(name) ! .append("\" table=\"") ! .append(map.tableNameFor(name)) ! .append((subs.size() > 0) ? "\" discriminator-value=\"" + shortName : "") ! .append("\">\n"); // first find the uid if( uid == null ) { --- 117,130 ---- map.emitPrefix(level);; buf.append("<!-- ") ! .append(name) ! .append(" root -->\n"); // a root class -- polymorphic style map.emitPrefix(level);; buf.append("<class name=\"") ! .append(name) ! .append("\" table=\"") ! .append(map.tableNameFor(name)) ! .append((subs.size() > 0) ? "\" discriminator-value=\"" + shortName : "") ! .append("\">\n"); // first find the uid if( uid == null ) { *************** *** 132,138 **** map.emitPrefix(level); buf.append("<!-- NO UID!? class=\"") ! .append(name) ! .append("\" -->\n"); ! } else { uid.getUidXML(level+1, buf); } --- 132,139 ---- map.emitPrefix(level); buf.append("<!-- NO UID!? class=\"") ! .append(name) ! .append("\" -->\n"); ! } ! else { uid.getUidXML(level+1, buf); } *************** *** 160,165 **** buf.append("</class>\n"); } ! ! /** dump the OR-Mapping XML for a non-root class and all of its * subclasses that share its table and UID */ --- 161,166 ---- buf.append("</class>\n"); } ! ! /** dump the OR-Mapping XML for a non-root class and all of its * subclasses that share its table and UID */ *************** *** 171,181 **** map.emitPrefix(level);; buf.append("<!-- ") ! .append(name) ! .append(" -->\n"); // a sub class -- polymorphic style map.emitPrefix(level);; buf.append("<subclass name=\"") ! .append(name) ! .append("\">\n"); // now the properties already classified by heuristic Enumeration ps = props.elements(); --- 172,182 ---- map.emitPrefix(level);; buf.append("<!-- ") ! .append(name) ! .append(" -->\n"); // a sub class -- polymorphic style map.emitPrefix(level);; buf.append("<subclass name=\"") ! .append(name) ! .append("\">\n"); // now the properties already classified by heuristic Enumeration ps = props.elements(); *************** *** 194,200 **** buf.append("</subclass>\n"); } ! /** dump the OR-Mapping XML for a class used as a component ! * * @param propName the property name of the property containing this component */ --- 195,201 ---- buf.append("</subclass>\n"); } ! /** dump the OR-Mapping XML for a class used as a component ! * * @param propName the property name of the property containing this component */ *************** *** 206,218 **** map.emitPrefix(level);; buf.append("<!-- ") ! .append(name) ! .append(" -->\n");*/ // a component map.emitPrefix(level);; buf.append("<component name=\"") ! .append(propName) ! .append("\" class=\"") ! .append(name) ! .append("\">\n"); // now the properties already classified by heuristic Enumeration ps = props.elements(); --- 207,219 ---- map.emitPrefix(level);; buf.append("<!-- ") ! .append(name) ! .append(" -->\n");*/ // a component map.emitPrefix(level);; buf.append("<component name=\"") ! .append(propName) ! .append("\" class=\"") ! .append(name) ! .append("\">\n"); // now the properties already classified by heuristic Enumeration ps = props.elements(); *************** *** 233,238 **** map.emitPrefix(level);; buf.append("<composite-element class=\"") ! .append(name) ! .append("\">\n"); // now the properties already classified by heuristic Enumeration ps = props.elements(); --- 234,239 ---- map.emitPrefix(level);; buf.append("<composite-element class=\"") ! .append(name) ! .append("\">\n"); // now the properties already classified by heuristic Enumeration ps = props.elements(); *************** *** 247,251 **** buf.append("</composite-element>\n"); } ! protected void getXMLasMany2Many(int level) { // dumps in buf --- 248,252 ---- buf.append("</composite-element>\n"); } ! protected void getXMLasMany2Many(int level) { // dumps in buf *************** *** 255,264 **** map.emitPrefix(level);; buf.append("<many-to-many class=\"" ) ! .append(name) ! .append("\" column=\"") ! .append(map.columnNameFor(name)) ! .append("\"/>\n"); } ! private String capitalize( String s ) { char c = s.charAt(0); --- 256,265 ---- map.emitPrefix(level);; buf.append("<many-to-many class=\"" ) ! .append(name) ! .append("\" column=\"") ! .append(map.columnNameFor(name)) ! .append("\"/>\n"); } ! private String capitalize( String s ) { char c = s.charAt(0); *************** *** 269,273 **** /** called to determine if the class has a UID property ! * * @param niceKeys an array of candidate UID names * @return the UID ReflectedProperty --- 270,274 ---- /** called to determine if the class has a UID property ! * * @param niceKeys an array of candidate UID names * @return the UID ReflectedProperty *************** *** 327,331 **** private void maybeAddProp( String name, Class type ! , Hashtable thisprops, Hashtable thatprops ) { Object ty = thatprops.get( name ); if( ty == type ) { --- 328,332 ---- private void maybeAddProp( String name, Class type ! , Hashtable thisprops, Hashtable thatprops ) { Object ty = thatprops.get( name ); if( ty == type ) { *************** *** 344,348 **** maybeAddProp( name, type, setprops, getprops ); } ! private void addGetter( String name, Class type ) { maybeAddProp( name, type, getprops, setprops ); --- 345,349 ---- maybeAddProp( name, type, setprops, getprops ); } ! private void addGetter( String name, Class type ) { maybeAddProp( name, type, getprops, setprops ); *************** *** 377,381 **** if( restyp == void.class && name.startsWith("set") ) { addSetter( Introspector.decapitalize(name.substring(3)) ! , argtyp[0] ); } } --- 378,382 ---- if( restyp == void.class && name.startsWith("set") ) { addSetter( Introspector.decapitalize(name.substring(3)) ! , argtyp[0] ); } } *************** *** 383,391 **** if( name.startsWith("get") ) { addGetter( Introspector.decapitalize(name.substring(3)) ! , restyp ); } else if( restyp == boolean.class && name.startsWith("is") ) { addGetter( Introspector.decapitalize(name.substring(2)) ! , restyp ); } } --- 384,392 ---- if( name.startsWith("get") ) { addGetter( Introspector.decapitalize(name.substring(3)) ! , restyp ); } else if( restyp == boolean.class && name.startsWith("is") ) { addGetter( Introspector.decapitalize(name.substring(2)) ! , restyp ); } } *************** *** 396,401 **** } } ! } --- 397,405 ---- } } ! } + + + Index: ReflectedCollectionProperty.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/class2hbm/ReflectedCollectionProperty.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ReflectedCollectionProperty.java 1 Jan 2003 13:57:24 -0000 1.1.1.1 --- ReflectedCollectionProperty.java 4 Jan 2003 11:15:31 -0000 1.2 *************** *** 6,10 **** */ class ReflectedCollectionProperty extends ReflectedProperty { ! /** * Constructor for ReflectedListProperty. --- 6,10 ---- */ class ReflectedCollectionProperty extends ReflectedProperty { ! /** * Constructor for ReflectedListProperty. *************** *** 15,29 **** super(name, type, map, "bag"); } ! protected void getXMLinArray( int level, StringBuffer buf ) { this.buf = buf; emitSubCollectionStr(level, name); } ! protected void getXMLinComposite( int level, StringBuffer buf ) { this.buf = buf; emitCollectionInCompositeStr(level); } ! protected void getXML( int level, StringBuffer buf ) { this.buf = buf; --- 15,29 ---- super(name, type, map, "bag"); } ! protected void getXMLinArray( int level, StringBuffer buf ) { this.buf = buf; emitSubCollectionStr(level, name); } ! protected void getXMLinComposite( int level, StringBuffer buf ) { this.buf = buf; emitCollectionInCompositeStr(level); } ! protected void getXML( int level, StringBuffer buf ) { this.buf = buf; *************** *** 37,38 **** --- 37,41 ---- } } + + + Index: ReflectedComponent.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/class2hbm/ReflectedComponent.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ReflectedComponent.java 1 Jan 2003 13:57:25 -0000 1.1.1.1 --- ReflectedComponent.java 4 Jan 2003 11:15:31 -0000 1.2 *************** *** 16,22 **** private ReflectedClass component; // my component private int kind = KIND_UNKNOWN; ! protected ReflectedComponent( String name, Class type ! , MapGenerator map, ReflectedClass comp ) { super( name, type, map, "prospective-component" ); --- 16,22 ---- private ReflectedClass component; // my component private int kind = KIND_UNKNOWN; ! protected ReflectedComponent( String name, Class type ! , MapGenerator map, ReflectedClass comp ) { super( name, type, map, "prospective-component" ); *************** *** 26,30 **** private int determineKind() { // this decision has to be delayed to avoid circularities ! // e.g., a component which includes itself will not have // access to this info until it is fully processed // but we cache it here... --- 26,30 ---- private int determineKind() { // this decision has to be delayed to avoid circularities ! // e.g., a component which includes itself will not have // access to this info until it is fully processed // but we cache it here... *************** *** 55,82 **** else { buf.append("<!-- BUG unknown kind! name=\"") ! .append(name) ! .append("\" type=\"") ! .append(type.getName()) ! .append("\" -->\n"); kind = KIND_BASIC; return KIND_BASIC; } } ! protected void getXMLinArray( int level, StringBuffer buf ) { this.buf = buf; switch( determineKind() ) { case KIND_BASIC: ! super.getXML( level, buf ); ! break; case KIND_COMPONENT: ! getXMLas(level, true); ! break; case KIND_ASSOCIATION: ! component.getXMLasMany2Many(level); ! break; default: ! emitPCommentStr(level, "BUG! unknown component kind", name, type.getName()); ! break; } } --- 55,82 ---- else { buf.append("<!-- BUG unknown kind! name=\"") ! .append(name) ! .append("\" type=\"") ! .append(type.getName()) ! .append("\" -->\n"); kind = KIND_BASIC; return KIND_BASIC; } } ! protected void getXMLinArray( int level, StringBuffer buf ) { this.buf = buf; switch( determineKind() ) { case KIND_BASIC: ! super.getXML( level, buf ); ! break; case KIND_COMPONENT: ! getXMLas(level, true); ! break; case KIND_ASSOCIATION: ! component.getXMLasMany2Many(level); ! break; default: ! emitPCommentStr(level, "BUG! unknown component kind", name, type.getName()); ! break; } } *************** *** 86,116 **** getXMLinArray( level, buf ); } ! protected void emitMany2OneStr(int level) { map.emitPrefix(level); buf.append("<many-to-one name=\"" ) ! .append(name) ! .append("\" column=\"") ! .append(map.columnNameFor(name)) ! .append("\" class=\"") ! .append(tynm) ! .append("\"/>\n"); } ! protected void getXML( int level, StringBuffer buf ) { this.buf = buf; switch( determineKind() ) { case KIND_BASIC: ! super.getXML( level, buf ); ! return; case KIND_COMPONENT: ! getXMLas(level, false); //go on... ! return; case KIND_ASSOCIATION: ! emitMany2OneStr(level); ! return; default: ! emitPCommentStr(level, "BUG! unknown component kind", name, type.getName()); ! return; } } --- 86,116 ---- getXMLinArray( level, buf ); } ! protected void emitMany2OneStr(int level) { map.emitPrefix(level); buf.append("<many-to-one name=\"" ) ! .append(name) ! .append("\" column=\"") ! .append(map.columnNameFor(name)) ! .append("\" class=\"") ! .append(tynm) ! .append("\"/>\n"); } ! protected void getXML( int level, StringBuffer buf ) { this.buf = buf; switch( determineKind() ) { case KIND_BASIC: ! super.getXML( level, buf ); ! return; case KIND_COMPONENT: ! getXMLas(level, false); //go on... ! return; case KIND_ASSOCIATION: ! emitMany2OneStr(level); ! return; default: ! emitPCommentStr(level, "BUG! unknown component kind", name, type.getName()); ! return; } } *************** *** 144,147 **** } } ! } --- 144,150 ---- } } ! } + + + Index: ReflectedListProperty.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/class2hbm/ReflectedListProperty.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ReflectedListProperty.java 1 Jan 2003 13:57:25 -0000 1.1.1.1 --- ReflectedListProperty.java 4 Jan 2003 11:15:31 -0000 1.2 *************** *** 6,10 **** */ class ReflectedListProperty extends ReflectedProperty { ! /** * Constructor for ReflectedListProperty. --- 6,10 ---- */ class ReflectedListProperty extends ReflectedProperty { ! /** * Constructor for ReflectedListProperty. *************** *** 15,29 **** super(name, type, map, "list"); } ! protected void getXMLinArray( int level, StringBuffer buf ) { this.buf = buf; emitSubCollectionStr(level, name); } ! protected void getXMLinComposite( int level, StringBuffer buf ) { this.buf = buf; emitCollectionInCompositeStr(level); } ! protected void getXML( int level, StringBuffer buf ) { this.buf = buf; --- 15,29 ---- super(name, type, map, "list"); } ! protected void getXMLinArray( int level, StringBuffer buf ) { this.buf = buf; emitSubCollectionStr(level, name); } ! protected void getXMLinComposite( int level, StringBuffer buf ) { this.buf = buf; emitCollectionInCompositeStr(level); } ! protected void getXML( int level, StringBuffer buf ) { this.buf = buf; *************** *** 38,39 **** --- 38,42 ---- } } + + + Index: ReflectedMapProperty.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/class2hbm/ReflectedMapProperty.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ReflectedMapProperty.java 1 Jan 2003 13:57:25 -0000 1.1.1.1 --- ReflectedMapProperty.java 4 Jan 2003 11:15:31 -0000 1.2 *************** *** 6,10 **** */ class ReflectedMapProperty extends ReflectedProperty { ! /** * Constructor for ReflectedMapProperty. --- 6,10 ---- */ class ReflectedMapProperty extends ReflectedProperty { ! /** * Constructor for ReflectedMapProperty. *************** *** 15,29 **** super(name, type, map, "map"); } ! protected void getXMLinArray( int level, StringBuffer buf ) { this.buf = buf; emitSubCollectionStr(level, name); } ! protected void getXMLinComposite( int level, StringBuffer buf ) { this.buf = buf; emitCollectionInCompositeStr(level); } ! protected void getXML( int level, StringBuffer buf ) { this.buf = buf; --- 15,29 ---- super(name, type, map, "map"); } ! protected void getXMLinArray( int level, StringBuffer buf ) { this.buf = buf; emitSubCollectionStr(level, name); } ! protected void getXMLinComposite( int level, StringBuffer buf ) { this.buf = buf; emitCollectionInCompositeStr(level); } ! protected void getXML( int level, StringBuffer buf ) { this.buf = buf; *************** *** 38,39 **** --- 38,42 ---- } } + + + Index: ReflectedProperty.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/class2hbm/ReflectedProperty.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ReflectedProperty.java 1 Jan 2003 13:57:27 -0000 1.1.1.1 --- ReflectedProperty.java 4 Jan 2003 11:15:31 -0000 1.2 *************** *** 14,27 **** import net.sf.hibernate.type.CurrencyType; ! /** a ReflectedProperty is made by an instance of MapGenerator * to model properties of Reflected classes;<br> * basic properties are handled here: primitive, enum, custom;<br> * subclasses handle more involved cases ! * * @version 1.x * @author <a href="mailto:dou...@al...">e</a> */ public class ReflectedProperty { ! protected boolean isUid; protected Class type; --- 14,27 ---- import net.sf.hibernate.type.CurrencyType; ! /** a ReflectedProperty is made by an instance of MapGenerator * to model properties of Reflected classes;<br> * basic properties are handled here: primitive, enum, custom;<br> * subclasses handle more involved cases ! * * @version 1.x * @author <a href="mailto:dou...@al...">e</a> */ public class ReflectedProperty { ! protected boolean isUid; protected Class type; *************** *** 53,60 **** shortTypeNames.put( Timestamp.class.getName(), Hibernate.TIMESTAMP.getName() ); shortTypeNames.put( java.util.Date.class.getName(), Hibernate.TIMESTAMP.getName() ); ! shortTypeNames.put( java.sql.Date.class.getName(), Hibernate.DATE.getName() ); shortTypeNames.put( byte[].class.getName(), Hibernate.BINARY.getName() ); // not shorter, but nicer ! shortTypeNames.put( Blob.class.getName(), Hibernate.BLOB.getName() ); ! shortTypeNames.put( Clob.class.getName(), Hibernate.CLOB.getName() ); } --- 53,60 ---- shortTypeNames.put( Timestamp.class.getName(), Hibernate.TIMESTAMP.getName() ); shortTypeNames.put( java.util.Date.class.getName(), Hibernate.TIMESTAMP.getName() ); ! shortTypeNames.put( java.sql.Date.class.getName(), Hibernate.DATE.getName() ); shortTypeNames.put( byte[].class.getName(), Hibernate.BINARY.getName() ); // not shorter, but nicer ! shortTypeNames.put( Blob.class.getName(), Hibernate.BLOB.getName() ); ! shortTypeNames.put( Clob.class.getName(), Hibernate.CLOB.getName() ); } *************** *** 65,69 **** ReflectedProperty( String name, Class type ! , MapGenerator map, String comment ) { this.name = name; this.type = type; --- 65,69 ---- ReflectedProperty( String name, Class type ! , MapGenerator map, String comment ) { this.name = name; this.type = type; *************** *** 78,87 **** return name; } ! /** used by gui */ public String getTypeName() { return tynm; } ! protected boolean isUidOK() { /*if( long.class == type ) return true; --- 78,87 ---- return name; } ! /** used by gui */ public String getTypeName() { return tynm; } ! protected boolean isUidOK() { /*if( long.class == type ) return true; *************** *** 92,105 **** return ( !type.isArray() ); // since arrays never implement equals properly } ! protected void emitIntUidStr(int level) { map.emitPrefix(level); buf.append("<id name=\"") ! .append(name) ! .append("\" type=\"") ! .append(tynm) // or just use "long" ? ! .append("\" column=\"") ! .append(map.columnNameFor(name)) ! .append("\">\n"); map.emitPrefix(level+1); buf.append("<generator class=\"hilo.long\"/>\n"); --- 92,105 ---- return ( !type.isArray() ); // since arrays never implement equals properly } ! protected void emitIntUidStr(int level) { map.emitPrefix(level); buf.append("<id name=\"") ! .append(name) ! .append("\" type=\"") ! .append(tynm) // or just use "long" ? ! .append("\" column=\"") ! .append(map.columnNameFor(name)) ! .append("\">\n"); map.emitPrefix(level+1); buf.append("<generator class=\"hilo.long\"/>\n"); *************** *** 107,137 **** buf.append("</id>\n"); } ! protected void emitStrUidStr(int level) { map.emitPrefix(level); buf.append("<id name=\"" ) ! .append(name) ! .append("\" type=\"") ! .append(tynm) // or just use "string" ? ! .append("\">\n"); map.emitPrefix(level+1); buf.append("<column name=\"") ! .append(map.columnNameFor(name)) ! .append("\" length=\"16\"/>\n"); map.emitPrefix(level+1); buf.append("<generator class=\"hilo.hex\"/>\n"); map.emitPrefix(level); buf.append("</id>\n"); ! } protected void emitPropertyStr(int level) { map.emitPrefix(level); buf.append("<property name=\"" ) ! .append(name) ! .append("\" column=\"") ! .append(map.columnNameFor(name)) ! .append("\" type=\"") ! .append(tynm) ! .append("\"/>\n"); } --- 107,137 ---- buf.append("</id>\n"); } ! protected void emitStrUidStr(int level) { map.emitPrefix(level); buf.append("<id name=\"" ) ! .append(name) ! .append("\" type=\"") ! .append(tynm) // or just use "string" ? ! .append("\">\n"); map.emitPrefix(level+1); buf.append("<column name=\"") ! .append(map.columnNameFor(name)) ! .append("\" length=\"16\"/>\n"); map.emitPrefix(level+1); buf.append("<generator class=\"hilo.hex\"/>\n"); map.emitPrefix(level); buf.append("</id>\n"); ! } protected void emitPropertyStr(int level) { map.emitPrefix(level); buf.append("<property name=\"" ) ! .append(name) ! .append("\" column=\"") ! .append(map.columnNameFor(name)) ! .append("\" type=\"") ! .append(tynm) ! .append("\"/>\n"); } *************** *** 139,159 **** /*map.emitPrefix(level); buf.append("<!-- ") ! .append(comment) ! .append(" name=\"") ! .append(name) ! .append("\" type=\"") ! .append(tynm) ! .append("\" -->\n");*/ } protected void emitCollectionStrL( int level, String collection ! , String name, boolean lazy ) { map.emitPrefix(level); buf.append("<") ! .append(collection) ! .append(" role=\"" ) ! .append(name) ! .append("\" table=\"") ! .append(map.tableNameFor(name)); if( lazy ) { buf.append("\" lazy=\"true"); --- 139,159 ---- /*map.emitPrefix(level); buf.append("<!-- ") ! .append(comment) ! .append(" name=\"") ! .append(name) ! .append("\" type=\"") ! .append(tynm) ! .append("\" -->\n");*/ } protected void emitCollectionStrL( int level, String collection ! , String name, boolean lazy ) { map.emitPrefix(level); buf.append("<") ! .append(collection) ! .append(" role=\"" ) ! .append(name) ! .append("\" table=\"") ! .append(map.tableNameFor(name)); if( lazy ) { buf.append("\" lazy=\"true"); *************** *** 164,203 **** map.emitPrefix(level); buf.append("<key column=\"") ! .append(map.columnNameFor(key)) ! .append("\"/>\n"); } protected void emitCollectionStrI( int level, String idx ) { map.emitPrefix(level); buf.append("<index column=\"") ! .append(map.columnNameFor(idx)) ! .append("\"/>\n"); } protected void emitCollectionStrIT( int level, String idx, String type ) { map.emitPrefix(level); buf.append("<index column=\"") ! .append(map.columnNameFor(idx)) ! .append("\" type =\"") ! .append(type) ! .append("\"/>\n"); } protected void emitCollectionStrE( int level, String elm ) { map.emitPrefix(level); buf.append("<element column=\"") ! .append(map.columnNameFor(elm)) ! .append("\"/>\n"); } protected void emitCollectionStrET( int level, String elm, String type ) { map.emitPrefix(level); buf.append("<element column=\"") ! .append(map.columnNameFor(elm)) ! .append("\" type =\"") ! .append(type) ! .append("\"/>\n"); } protected void emitCollectionStrR( int level, String collection ) { map.emitPrefix(level); buf.append("</") ! .append(collection) ! .append(">\n"); } //protected void emitCollectionStrLazy(int level) { --- 164,203 ---- map.emitPrefix(level); buf.append("<key column=\"") ! .append(map.columnNameFor(key)) ! .append("\"/>\n"); } protected void emitCollectionStrI( int level, String idx ) { map.emitPrefix(level); buf.append("<index column=\"") ! .append(map.columnNameFor(idx)) ! .append("\"/>\n"); } protected void emitCollectionStrIT( int level, String idx, String type ) { map.emitPrefix(level); buf.append("<index column=\"") ! .append(map.columnNameFor(idx)) ! .append("\" type =\"") ! .append(type) ! .append("\"/>\n"); } protected void emitCollectionStrE( int level, String elm ) { map.emitPrefix(level); buf.append("<element column=\"") ! .append(map.columnNameFor(elm)) ! .append("\"/>\n"); } protected void emitCollectionStrET( int level, String elm, String type ) { map.emitPrefix(level); buf.append("<element column=\"") ! .append(map.columnNameFor(elm)) ! .append("\" type =\"") ! .append(type) ! .append("\"/>\n"); } protected void emitCollectionStrR( int level, String collection ) { map.emitPrefix(level); buf.append("</") ! .append(collection) ! .append(">\n"); } //protected void emitCollectionStrLazy(int level) { *************** *** 206,240 **** //} ! //<!ELEMENT subcollection (column*)> ! // <!ATTLIST subcollection column CDATA #IMPLIED> ! // <!ATTLIST subcollection role CDATA #REQUIRED> ! // <!ATTLIST subcollection length CDATA #IMPLIED> ! // <!ATTLIST subcollection not-null CDATA #IMPLIED> ! protected void emitSubCollectionStr( int level, String name ) { map.emitPrefix(level); buf.append("<subcollection role=\"" ) ! .append(name) ! .append("\" column=\"") ! .append(map.columnNameFor(name)) ! .append("\">\n"); } ! ! //<!ELEMENT collection (column*)> ! // <!ATTLIST collection name CDATA #REQUIRED> ! // <!ATTLIST collection role CDATA #IMPLIED> ! // <!ATTLIST collection column CDATA #IMPLIED> ! // <!ATTLIST collection length CDATA #IMPLIED> ! // <!ATTLIST collection not-null CDATA #IMPLIED> ! protected void emitCollectionInCompositeStr(int level) { map.emitPrefix(level); buf.append("<collection name=\"" ) ! .append(name) ! .append("\" column=\"") ! .append(map.columnNameFor(name)) ! .append("\">\n"); } ! protected void getUidXML(int level, StringBuffer buf) { this.buf = buf; --- 206,240 ---- //} ! //<!ELEMENT subcollection (column*)> ! // <!ATTLIST subcollection column CDATA #IMPLIED> ! // <!ATTLIST subcollection role CDATA #REQUIRED> ! // <!ATTLIST subcollection length CDATA #IMPLIED> ! // <!ATTLIST subcollection not-null CDATA #IMPLIED> ! protected void emitSubCollectionStr( int level, String name ) { map.emitPrefix(level); buf.append("<subcollection role=\"" ) ! .append(name) ! .append("\" column=\"") ! .append(map.columnNameFor(name)) ! .append("\">\n"); } ! ! //<!ELEMENT collection (column*)> ! // <!ATTLIST collection name CDATA #REQUIRED> ! // <!ATTLIST collection role CDATA #IMPLIED> ! // <!ATTLIST collection column CDATA #IMPLIED> ! // <!ATTLIST collection length CDATA #IMPLIED> ! // <!ATTLIST collection not-null CDATA #IMPLIED> ! protected void emitCollectionInCompositeStr(int level) { map.emitPrefix(level); buf.append("<collection name=\"" ) ! .append(name) ! .append("\" column=\"") ! .append(map.columnNameFor(name)) ! .append("\">\n"); } ! protected void getUidXML(int level, StringBuffer buf) { this.buf = buf; *************** *** 253,262 **** emitPropertyStr(level); } ! protected void getXMLinArray( int level, StringBuffer buf ) { this.buf = buf; emitCollectionStrET(level, "elm", tynm); } ! protected void getXML( int level, StringBuffer buf ) { this.buf = buf; --- 253,262 ---- emitPropertyStr(level); } ! protected void getXMLinArray( int level, StringBuffer buf ) { this.buf = buf; emitCollectionStrET(level, "elm", tynm); } ! protected void getXML( int level, StringBuffer buf ) { this.buf = buf; *************** *** 267,268 **** --- 267,271 ---- } } + + + Index: ReflectedSetProperty.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/tool/class2hbm/ReflectedSetProperty.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ReflectedSetProperty.java 1 Jan 2003 13:57:27 -0000 1.1.1.1 --- ReflectedSetProperty.java 4 Jan 2003 11:15:31 -0000 1.2 *************** *** 6,10 **** */ class ReflectedSetProperty extends ReflectedProperty { ! /** * Constructor for ReflectedListProperty. --- 6,10 ---- */ class ReflectedSetProperty extends ReflectedProperty { ! /** * Constructor for ReflectedListProperty. *************** *** 15,29 **** super(name, type, map, "set"); } ! protected void getXMLinArray( int level, StringBuffer buf ) { this.buf = buf; emitSubCollectionStr(level, name); } ! protected void getXMLinComposite( int level, StringBuffer buf ) { this.buf = buf; emitCollectionInCompositeStr(level); } ! protected void getXML( int level, StringBuffer buf ) { this.buf = buf; --- 15,29 ---- super(name, type, map, "set"); } ! protected void getXMLinArray( int level, StringBuffer buf ) { this.buf = buf; emitSubCollectionStr(level, name); } ! protected void getXMLinComposite( int level, StringBuffer buf ) { this.buf = buf; emitCollectionInCompositeStr(level); } ! protected void getXML( int level, StringBuffer buf ) { this.buf = buf; *************** *** 37,38 **** --- 37,41 ---- } } + + + |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/transaction In directory sc8-pr-cvs1:/tmp/cvs-serv14211/src/net/sf/hibernate/transaction Modified Files: JBossTransactionManagerLookup.java JDBCTransaction.java JDBCTransactionFactory.java JNDITransactionManagerLookup.java JTATransaction.java JTATransactionFactory.java OrionTransactionManagerLookup.java ResinTransactionManagerLookup.java TransactionFactory.java TransactionManagerLookup.java WebSphereTransactionManagerLookup.java WeblogicTransactionManagerLookup.java Log Message: reformatted code with beautiful, shiny, happy TABS! improved an exception Index: JBossTransactionManagerLookup.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/transaction/JBossTransactionManagerLookup.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** JBossTransactionManagerLookup.java 1 Jan 2003 13:57:53 -0000 1.1.1.1 --- JBossTransactionManagerLookup.java 4 Jan 2003 11:15:31 -0000 1.2 *************** *** 3,7 **** public final class JBossTransactionManagerLookup extends JNDITransactionManagerLookup { ! /** * @see net.sf.hibernate.transaction.JNDITransactionManagerLookup#getName() --- 3,7 ---- public final class JBossTransactionManagerLookup extends JNDITransactionManagerLookup { ! /** * @see net.sf.hibernate.transaction.JNDITransactionManagerLookup#getName() *************** *** 14,17 **** return "UserTransaction"; } ! } --- 14,20 ---- return "UserTransaction"; } ! } + + + Index: JDBCTransaction.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/transaction/JDBCTransaction.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** JDBCTransaction.java 1 Jan 2003 13:57:53 -0000 1.1.1.1 --- JDBCTransaction.java 4 Jan 2003 11:15:31 -0000 1.2 *************** *** 15,19 **** /** * Implements a basic transaction strategy for JDBC connections.This is the ! * default <tt>Transaction</tt> implementation used if none is explicitly * specified. */ --- 15,19 ---- /** * Implements a basic transaction strategy for JDBC connections.This is the ! * default <tt>Transaction</tt> implementation used if none is explicitly * specified. */ *************** *** 25,34 **** private static final Log log = LogFactory.getLog(JDBCTransaction.class); ! public JDBCTransaction(SessionImplementor session) throws HibernateException { this.session = session; begin(); } ! private void begin() throws HibernateException { --- 25,34 ---- private static final Log log = LogFactory.getLog(JDBCTransaction.class); ! public JDBCTransaction(SessionImplementor session) throws HibernateException { this.session = session; begin(); } ! private void begin() throws HibernateException { *************** *** 38,48 **** toggleAutoCommit = session.connection().getAutoCommit(); if (toggleAutoCommit) session.connection().setAutoCommit(false); ! } catch (SQLException e) { log.error("Begin failed", e); throw new TransactionException("Begin failed with SQL exception: ", e); ! } } ! public void commit() throws HibernateException, SQLException { --- 38,48 ---- toggleAutoCommit = session.connection().getAutoCommit(); if (toggleAutoCommit) session.connection().setAutoCommit(false); ! } catch (SQLException e) { log.error("Begin failed", e); throw new TransactionException("Begin failed with SQL exception: ", e); ! } } ! public void commit() throws HibernateException, SQLException { *************** *** 65,69 **** toggleAutoCommit(); } ! public void rollback() throws HibernateException { --- 65,69 ---- toggleAutoCommit(); } ! public void rollback() throws HibernateException { *************** *** 74,78 **** rolledBack=true; ! } catch (SQLException e) { log.error("Rollback failed", e); --- 74,78 ---- rolledBack=true; ! } catch (SQLException e) { log.error("Rollback failed", e); *************** *** 101,103 **** return committed; } ! } \ No newline at end of file --- 101,105 ---- return committed; } ! } ! ! Index: JDBCTransactionFactory.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/transaction/JDBCTransactionFactory.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** JDBCTransactionFactory.java 1 Jan 2003 13:57:53 -0000 1.1.1.1 --- JDBCTransactionFactory.java 4 Jan 2003 11:15:31 -0000 1.2 *************** *** 13,24 **** */ public final class JDBCTransactionFactory implements TransactionFactory { ! public JDBCTransactionFactory() throws HibernateException { } ! public Transaction beginTransaction(SessionImplementor session) throws HibernateException { return new JDBCTransaction(session); } public void configure(Properties props) throws HibernateException {} - } \ No newline at end of file --- 13,26 ---- */ public final class JDBCTransactionFactory implements TransactionFactory { ! public JDBCTransactionFactory() throws HibernateException { } ! public Transaction beginTransaction(SessionImplementor session) throws HibernateException { return new JDBCTransaction(session); } public void configure(Properties props) throws HibernateException {} + + } + Index: JNDITransactionManagerLookup.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/transaction/JNDITransactionManagerLookup.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** JNDITransactionManagerLookup.java 1 Jan 2003 13:57:53 -0000 1.1.1.1 --- JNDITransactionManagerLookup.java 4 Jan 2003 11:15:31 -0000 1.2 *************** *** 14,18 **** */ public abstract class JNDITransactionManagerLookup implements TransactionManagerLookup { ! /** * @see net.sf.hibernate.transaction.TransactionManagerLookup#getTransactionManager(java.util.Properties) --- 14,18 ---- */ public abstract class JNDITransactionManagerLookup implements TransactionManagerLookup { ! /** * @see net.sf.hibernate.transaction.TransactionManagerLookup#getTransactionManager(java.util.Properties) *************** *** 28,31 **** protected abstract String getName(); ! } --- 28,34 ---- protected abstract String getName(); ! } + + + Index: JTATransaction.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/transaction/JTATransaction.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** JTATransaction.java 1 Jan 2003 13:57:54 -0000 1.1.1.1 --- JTATransaction.java 4 Jan 2003 11:15:31 -0000 1.2 *************** *** 25,29 **** * Implements a basic transaction strategy for JTA transactions. Instances check to * see if there is an existing JTA transaction. If none exists, a new transaction ! * is started. If one exists, all work is done in the existing context. The * following properties are used to locate the underlying <tt>UserTransaction</tt>: * <br><br> --- 25,29 ---- * Implements a basic transaction strategy for JTA transactions. Instances check to * see if there is an existing JTA transaction. If none exists, a new transaction ! * is started. If one exists, all work is done in the existing context. The * following properties are used to locate the underlying <tt>UserTransaction</tt>: * <br><br> *************** *** 42,46 **** static final Log log = LogFactory.getLog(JTATransaction.class); ! public void commit() throws HibernateException, SQLException { --- 42,46 ---- static final Log log = LogFactory.getLog(JTATransaction.class); ! public void commit() throws HibernateException, SQLException { *************** *** 61,65 **** } } ! public void rollback() throws HibernateException { --- 61,65 ---- } } ! public void rollback() throws HibernateException { *************** *** 130,134 **** final int status; try { ! status = ut.getStatus(); } catch (SystemException se) { --- 130,134 ---- final int status; try { ! status = ut.getStatus(); } catch (SystemException se) { *************** *** 140,153 **** } else { ! return status==Status.STATUS_MARKED_ROLLBACK || ! status == Status.STATUS_ROLLING_BACK || ! status == Status.STATUS_ROLLEDBACK; } } ! public boolean wasCommitted() throws TransactionException { final int status; try { ! status = ut.getStatus(); } catch (SystemException se) { --- 140,153 ---- } else { ! return status==Status.STATUS_MARKED_ROLLBACK || ! status == Status.STATUS_ROLLING_BACK || ! status == Status.STATUS_ROLLEDBACK; } } ! public boolean wasCommitted() throws TransactionException { final int status; try { ! status = ut.getStatus(); } catch (SystemException se) { *************** *** 162,173 **** } } ! public void afterCompletion(int status) { log.trace("transaction completion callback"); session.afterTransactionCompletion(); } ! public void beforeCompletion() { } ! } --- 162,176 ---- } } ! public void afterCompletion(int status) { log.trace("transaction completion callback"); session.afterTransactionCompletion(); } ! public void beforeCompletion() { } ! } + + + Index: JTATransactionFactory.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/transaction/JTATransactionFactory.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** JTATransactionFactory.java 1 Jan 2003 13:57:54 -0000 1.1.1.1 --- JTATransactionFactory.java 4 Jan 2003 11:15:31 -0000 1.2 *************** *** 25,29 **** Log log = LogFactory.getLog(JTATransactionFactory.class); ! private static final String DEFAULT_USER_TRANSACTION_NAME = "java:comp/UserTransaction"; --- 25,29 ---- Log log = LogFactory.getLog(JTATransactionFactory.class); ! private static final String DEFAULT_USER_TRANSACTION_NAME = "java:comp/UserTransaction"; *************** *** 36,40 **** public void configure(Properties props) throws HibernateException { ! try { context = NamingHelper.getInitialContext(props); --- 36,40 ---- public void configure(Properties props) throws HibernateException { ! try { context = NamingHelper.getInitialContext(props); *************** *** 46,50 **** utName = props.getProperty(Environment.USER_TRANSACTION); ! String tmLookupClass = props.getProperty(Environment.TRANSACTION_MANAGER_STRATEGY); if (tmLookupClass==null) { --- 46,50 ---- utName = props.getProperty(Environment.USER_TRANSACTION); ! String tmLookupClass = props.getProperty(Environment.TRANSACTION_MANAGER_STRATEGY); if (tmLookupClass==null) { *************** *** 70,81 **** } } ! if (utName==null) utName = DEFAULT_USER_TRANSACTION_NAME; ! } ! public Transaction beginTransaction(SessionImplementor session) throws HibernateException { return new JTATransaction(session, context, utName, transactionManager); } ! } --- 70,84 ---- } } ! if (utName==null) utName = DEFAULT_USER_TRANSACTION_NAME; ! } ! public Transaction beginTransaction(SessionImplementor session) throws HibernateException { return new JTATransaction(session, context, utName, transactionManager); } ! } + + + Index: OrionTransactionManagerLookup.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/transaction/OrionTransactionManagerLookup.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** OrionTransactionManagerLookup.java 1 Jan 2003 13:57:54 -0000 1.1.1.1 --- OrionTransactionManagerLookup.java 4 Jan 2003 11:15:31 -0000 1.2 *************** *** 3,8 **** public class OrionTransactionManagerLookup ! extends JNDITransactionManagerLookup { ! /** * @see net.sf.hibernate.transaction.JNDITransactionManagerLookup#getName() --- 3,8 ---- public class OrionTransactionManagerLookup ! extends JNDITransactionManagerLookup { ! /** * @see net.sf.hibernate.transaction.JNDITransactionManagerLookup#getName() *************** *** 11,18 **** return "java:comp/UserTransaction"; } ! public String getUserTransactionName() { return "java:comp/UserTransaction"; } ! } --- 11,21 ---- return "java:comp/UserTransaction"; } ! public String getUserTransactionName() { return "java:comp/UserTransaction"; } ! } + + + Index: ResinTransactionManagerLookup.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/transaction/ResinTransactionManagerLookup.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ResinTransactionManagerLookup.java 1 Jan 2003 13:57:54 -0000 1.1.1.1 --- ResinTransactionManagerLookup.java 4 Jan 2003 11:15:31 -0000 1.2 *************** *** 3,8 **** public class ResinTransactionManagerLookup ! extends JNDITransactionManagerLookup { ! /** * @see net.sf.hibernate.transaction.JNDITransactionManagerLookup#getName() --- 3,8 ---- public class ResinTransactionManagerLookup ! extends JNDITransactionManagerLookup { ! /** * @see net.sf.hibernate.transaction.JNDITransactionManagerLookup#getName() *************** *** 15,18 **** return "java:comp/UserTransaction"; } ! } --- 15,21 ---- return "java:comp/UserTransaction"; } ! } + + + Index: TransactionFactory.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/transaction/TransactionFactory.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** TransactionFactory.java 1 Jan 2003 13:57:54 -0000 1.1.1.1 --- TransactionFactory.java 4 Jan 2003 11:15:31 -0000 1.2 *************** *** 9,13 **** /** ! * An abstract factory for <tt>Transaction</tt> instances. Concrete implementations * are specified by <tt>hibernate.transaction.factory_class</tt>.<br> * <br> --- 9,13 ---- /** ! * An abstract factory for <tt>Transaction</tt> instances. Concrete implementations * are specified by <tt>hibernate.transaction.factory_class</tt>.<br> * <br> *************** *** 30,32 **** */ public void configure(Properties props) throws HibernateException; ! } \ No newline at end of file --- 30,34 ---- */ public void configure(Properties props) throws HibernateException; ! } ! ! Index: TransactionManagerLookup.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/transaction/TransactionManagerLookup.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** TransactionManagerLookup.java 1 Jan 2003 13:57:54 -0000 1.1.1.1 --- TransactionManagerLookup.java 4 Jan 2003 11:15:31 -0000 1.2 *************** *** 8,16 **** /** ! * Concrete implementations locate and return the JTA * <tt>TransactionManager</tt>. */ public interface TransactionManagerLookup { ! /** * Obtain the JTA <tt>TransactionManager</tt> --- 8,16 ---- /** ! * Concrete implementations locate and return the JTA * <tt>TransactionManager</tt>. */ public interface TransactionManagerLookup { ! /** * Obtain the JTA <tt>TransactionManager</tt> *************** *** 22,26 **** * or <tt>null</tt> (optional operation). */ ! public String getUserTransactionName(); ! } --- 22,29 ---- * or <tt>null</tt> (optional operation). */ ! public String getUserTransactionName(); ! } + + + Index: WebSphereTransactionManagerLookup.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/transaction/WebSphereTransactionManagerLookup.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** WebSphereTransactionManagerLookup.java 1 Jan 2003 13:57:55 -0000 1.1.1.1 --- WebSphereTransactionManagerLookup.java 4 Jan 2003 11:15:31 -0000 1.2 *************** *** 14,18 **** private static final Log log = LogFactory.getLog(WebSphereTransactionManagerLookup.class); ! /** * @see net.sf.hibernate.transaction.TransactionManagerLookup#getTransactionManager(Properties) --- 14,18 ---- private static final Log log = LogFactory.getLog(WebSphereTransactionManagerLookup.class); ! /** * @see net.sf.hibernate.transaction.TransactionManagerLookup#getTransactionManager(Properties) *************** *** 30,35 **** } return (TransactionManager) clazz ! .getMethod("getTransactionManager", null) ! .invoke(null, null); } catch (Exception e) { --- 30,35 ---- } return (TransactionManager) clazz ! .getMethod("getTransactionManager", null) ! .invoke(null, null); } catch (Exception e) { *************** *** 37,44 **** } } ! public String getUserTransactionName() { return "jta/usertransaction"; } ! } --- 37,47 ---- } } ! public String getUserTransactionName() { return "jta/usertransaction"; } ! } + + + Index: WeblogicTransactionManagerLookup.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/transaction/WeblogicTransactionManagerLookup.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** WeblogicTransactionManagerLookup.java 1 Jan 2003 13:57:54 -0000 1.1.1.1 --- WeblogicTransactionManagerLookup.java 4 Jan 2003 11:15:31 -0000 1.2 *************** *** 3,7 **** public final class WeblogicTransactionManagerLookup extends JNDITransactionManagerLookup { ! /** * @see net.sf.hibernate.transaction.JNDITransactionManagerLookup#getName() --- 3,7 ---- public final class WeblogicTransactionManagerLookup extends JNDITransactionManagerLookup { ! /** * @see net.sf.hibernate.transaction.JNDITransactionManagerLookup#getName() *************** *** 10,17 **** return "javax.transaction.TransactionCoordinator"; } ! public String getUserTransactionName() { return "javax.transaction.UserTransaction"; } ! } --- 10,20 ---- return "javax.transaction.TransactionCoordinator"; } ! public String getUserTransactionName() { return "javax.transaction.UserTransaction"; } ! } + + + |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping In directory sc8-pr-cvs1:/tmp/cvs-serv14211/src/net/sf/hibernate/mapping Modified Files: Array.java Association.java Bag.java Collection.java Column.java Component.java Constraint.java ForeignKey.java Index.java IndexedCollection.java IntegerValue.java List.java ManyToOne.java Map.java OneToMany.java OneToOne.java PersistentClass.java PrimaryKey.java PrimitiveArray.java Property.java RelationalModel.java Root.java RootClass.java Set.java Subclass.java Table.java UniqueKey.java Value.java Log Message: reformatted code with beautiful, shiny, happy TABS! improved an exception Index: Array.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Array.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Array.java 2 Jan 2003 11:01:49 -0000 1.2 --- Array.java 4 Jan 2003 11:15:29 -0000 1.3 *************** *** 13,17 **** private Class elementClass; ! public Array(Node node, String prefix, PersistentClass owner, Root root) throws MappingException { super(node, prefix, owner, root); --- 13,17 ---- private Class elementClass; ! public Array(Node node, String prefix, PersistentClass owner, Root root) throws MappingException { super(node, prefix, owner, root); *************** *** 51,57 **** public Class getElementClass() { ! return elementClass; } ! public PersistentCollectionType getType() { return TypeFactory.array( getRole(), getElementClass() ); --- 51,57 ---- public Class getElementClass() { ! return elementClass; } ! public PersistentCollectionType getType() { return TypeFactory.array( getRole(), getElementClass() ); *************** *** 65,69 **** return true; } ! } --- 65,72 ---- return true; } ! } + + + Index: Association.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Association.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Association.java 2 Jan 2003 11:01:49 -0000 1.2 --- Association.java 4 Jan 2003 11:15:29 -0000 1.3 *************** *** 11,15 **** private final int joinedFetch; ! private int initJoinedFetch(Node node) { Node jfNode = node.getAttributes().getNamedItem("outer-join"); --- 11,15 ---- private final int joinedFetch; ! private int initJoinedFetch(Node node) { Node jfNode = node.getAttributes().getNamedItem("outer-join"); *************** *** 43,47 **** public abstract void createForeignKeys(Root root, Table table); ! } --- 43,50 ---- public abstract void createForeignKeys(Root root, Table table); ! } + + + Index: Bag.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Bag.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Bag.java 1 Jan 2003 13:56:13 -0000 1.1.1.1 --- Bag.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 9,25 **** public class Bag extends Collection { ! public Bag(Node node, String prefix, PersistentClass owner, Root root) ! throws MappingException { super(node, prefix, owner, root); } ! public PersistentCollectionType getType() { return TypeFactory.bag( getRole() ); } ! public Class wrapperClass() { return net.sf.hibernate.collection.Bag.class; } ! } --- 9,28 ---- public class Bag extends Collection { ! public Bag(Node node, String prefix, PersistentClass owner, Root root) ! throws MappingException { super(node, prefix, owner, root); } ! public PersistentCollectionType getType() { return TypeFactory.bag( getRole() ); } ! public Class wrapperClass() { return net.sf.hibernate.collection.Bag.class; } ! } + + + Index: Collection.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Collection.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Collection.java 3 Jan 2003 13:36:01 -0000 1.4 --- Collection.java 4 Jan 2003 11:15:29 -0000 1.5 *************** *** 103,110 **** String tableName; if (tableNode!=null) { ! tableName = tableNode.getNodeValue(); } else { ! tableName = barerole; } Node schemaNode = atts.getNamedItem("schema"); --- 103,110 ---- String tableName; if (tableNode!=null) { ! tableName = tableNode.getNodeValue(); } else { ! tableName = barerole; } Node schemaNode = atts.getNamedItem("schema"); *************** *** 131,135 **** table = persistentClass.getTable(); } ! NodeList list = node.getChildNodes(); for ( int i=0; i<list.getLength(); i++ ) { --- 131,135 ---- table = persistentClass.getTable(); } ! NodeList list = node.getChildNodes(); for ( int i=0; i<list.getLength(); i++ ) { *************** *** 147,151 **** element = new Value(subnode, DEFAULT_ELEMENT_COLUMN_NAME, true, table, root); } ! else if ( "many-to-many".equals(name) ) { element = new ManyToOne(subnode, Root.ROOT_ROLE_NAME, DEFAULT_ELEMENT_COLUMN_NAME, true, table, root); } --- 147,151 ---- element = new Value(subnode, DEFAULT_ELEMENT_COLUMN_NAME, true, table, root); } ! else if ( "many-to-many".equals(name) ) { element = new ManyToOne(subnode, Root.ROOT_ROLE_NAME, DEFAULT_ELEMENT_COLUMN_NAME, true, table, root); } *************** *** 157,161 **** } } ! if (!inverse) { if (!isOneToMany) element.createForeignKeys(root, table); --- 157,161 ---- } } ! if (!inverse) { if (!isOneToMany) element.createForeignKeys(root, table); *************** *** 165,170 **** } ! if ( !isIndexed() ) createIndex(); ! doneSecondPass=true; } --- 165,170 ---- } ! if ( !isIndexed() ) createIndex(); ! doneSecondPass=true; } *************** *** 176,180 **** this.lazy = lazy; } ! public String getRole() { return role; --- 176,180 ---- this.lazy = lazy; } ! public String getRole() { return role; *************** *** 188,196 **** return false; } ! public boolean isArray() { return false; } ! public boolean isOneToMany() { return isOneToMany; --- 188,196 ---- return false; } ! public boolean isArray() { return false; } ! public boolean isOneToMany() { return isOneToMany; *************** *** 201,208 **** } 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; } --- 201,208 ---- } 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; } *************** *** 214,218 **** return cache; } ! public boolean isInverse() { return inverse; --- 214,218 ---- return cache; } ! public boolean isInverse() { return inverse; *************** *** 222,226 **** return owner.getPersistentClass(); } ! } --- 222,229 ---- return owner.getPersistentClass(); } ! } + + + Index: Column.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Column.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Column.java 1 Jan 2003 13:56:14 -0000 1.1.1.1 --- Column.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 40,44 **** this.name = name; } ! public boolean isNullable() { return nullable; --- 40,44 ---- this.name = name; } ! public boolean isNullable() { return nullable; *************** *** 65,69 **** sqlType = (typeNode==null) ? null : typeNode.getNodeValue(); } ! public int getTypeIndex() { return typeIndex; --- 65,69 ---- sqlType = (typeNode==null) ? null : typeNode.getNodeValue(); } ! public int getTypeIndex() { return typeIndex; *************** *** 72,76 **** this.typeIndex = typeIndex; } ! public int getSQLType(Mapping pi) throws MappingException { try { --- 72,76 ---- this.typeIndex = typeIndex; } ! public int getSQLType(Mapping pi) throws MappingException { try { *************** *** 78,110 **** } catch (Exception e) { ! throw new MappingException( ! "Could not determine type for column " + name + " of type " + type.getClass().getName() + ": " + e.getClass().getName(), ! e ); } } ! public boolean isUnique() { return unique; } ! ! public String getSqlType(Dialect dialect, Mapping pi) throws HibernateException { return (sqlType==null) ? dialect.getTypeName( getSQLType(pi), getLength() ) : sqlType; } - public boolean equals(Object object) { - return object instanceof Column && equals( (Column) object ); - } - - public boolean equals(Column column) { - if (null == column) return false; - if (this == column) return true; - - return name.equals(column.name); - } - public int hashCode() { - return name.hashCode(); - } - } \ No newline at end of file --- 78,112 ---- } catch (Exception e) { ! throw new MappingException( ! "Could not determine type for column " + name + " of type " + type.getClass().getName() + ": " + e.getClass().getName(), ! e ); } } ! public boolean isUnique() { return unique; } ! ! public String getSqlType(Dialect dialect, Mapping pi) throws HibernateException { return (sqlType==null) ? dialect.getTypeName( getSQLType(pi), getLength() ) : sqlType; } + + public boolean equals(Object object) { + return object instanceof Column && equals( (Column) object ); + } + + public boolean equals(Column column) { + if (null == column) return false; + if (this == column) return true; + + return name.equals(column.name); + } + + public int hashCode() { + return name.hashCode(); + } + } Index: Component.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Component.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Component.java 2 Jan 2003 11:01:49 -0000 1.2 --- Component.java 4 Jan 2003 11:15:29 -0000 1.3 *************** *** 81,85 **** //component path path += Root.ROLE_SEPERATOR + StringHelper.unqualify(className); ! NodeList list = node.getChildNodes(); for ( int i=0; i<list.getLength(); i++ ) { --- 81,85 ---- //component path path += Root.ROLE_SEPERATOR + StringHelper.unqualify(className); ! NodeList list = node.getChildNodes(); for ( int i=0; i<list.getLength(); i++ ) { *************** *** 141,145 **** setType( new net.sf.hibernate.type.ComponentType(componentClass, types, names, joinedFetch, cascade, parentProperty, embedded) ); } ! public Class getComponentClass() { return componentClass; --- 141,145 ---- setType( new net.sf.hibernate.type.ComponentType(componentClass, types, names, joinedFetch, cascade, parentProperty, embedded) ); } ! public Class getComponentClass() { return componentClass; *************** *** 151,159 **** return embedded; } ! public boolean isComposite() { return true; } ! } --- 151,162 ---- return embedded; } ! public boolean isComposite() { return true; } ! } + + + Index: Constraint.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Constraint.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Constraint.java 1 Jan 2003 13:56:15 -0000 1.1.1.1 --- Constraint.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 10,14 **** private final ArrayList columns = new ArrayList(); private Table table; ! public String getName() { return name; --- 10,14 ---- private final ArrayList columns = new ArrayList(); private Table table; ! public String getName() { return name; *************** *** 21,25 **** } public void addColumn(Column column) { ! if ( !columns.contains(column) ) columns.add(column); } public int getColumnSpan() { --- 21,25 ---- } public void addColumn(Column column) { ! if ( !columns.contains(column) ) columns.add(column); } public int getColumnSpan() { *************** *** 35,47 **** this.table = table; } ! public String sqlDropString(Dialect dialect) { return "alter table " + getTable().getQualifiedName() + " drop constraint " + getName(); } ! public String sqlCreateString(Dialect dialect, Mapping p) { StringBuffer buf = new StringBuffer("alter table ") ! .append( getTable().getQualifiedName() ) ! .append( sqlConstraintString( dialect, getName() ) ); return buf.toString(); } --- 35,47 ---- this.table = table; } ! public String sqlDropString(Dialect dialect) { return "alter table " + getTable().getQualifiedName() + " drop constraint " + getName(); } ! public String sqlCreateString(Dialect dialect, Mapping p) { StringBuffer buf = new StringBuffer("alter table ") ! .append( getTable().getQualifiedName() ) ! .append( sqlConstraintString( dialect, getName() ) ); return buf.toString(); } *************** *** 49,51 **** --- 49,54 ---- public abstract String sqlConstraintString(Dialect d, String constraintName); } + + + Index: ForeignKey.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/ForeignKey.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ForeignKey.java 1 Jan 2003 13:56:15 -0000 1.1.1.1 --- ForeignKey.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 30,35 **** } public void setReferencedTable(Table referencedTable) throws MappingException { ! if ( referencedTable.getPrimaryKey().getColumnSpan()!=getColumnSpan() ) ! throw new MappingException("Foreign key must have same number of columns as referenced primary key"); Iterator fkCols = getColumnIterator(); --- 30,35 ---- } public void setReferencedTable(Table referencedTable) throws MappingException { ! if ( referencedTable.getPrimaryKey().getColumnSpan()!=getColumnSpan() ) ! throw new MappingException("Foreign key must have same number of columns as referenced primary key"); Iterator fkCols = getColumnIterator(); *************** *** 41,45 **** this.referencedTable = referencedTable; } ! public Class getReferencedClass() { return referencedClass; --- 41,45 ---- this.referencedTable = referencedTable; } ! public Class getReferencedClass() { return referencedClass; *************** *** 51,55 **** public ForeignKey() { } ! } --- 51,58 ---- public ForeignKey() { } ! } + + + Index: Index.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Index.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Index.java 1 Jan 2003 13:56:16 -0000 1.1.1.1 --- Index.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 10,24 **** import net.sf.hibernate.dialect.Dialect; ! public class Index implements RelationalModel { private Table table; private ArrayList columns = new ArrayList(); private String name; public String sqlCreateString(Dialect dialect, Mapping p) ! throws HibernateException { StringBuffer buf = new StringBuffer("create index ") ! .append( dialect.qualifyIndexName() ? name : StringHelper.unqualify(name) ) ! .append(" on ") ! .append( table.getQualifiedName() ) ! .append(" ("); Iterator iter = getColumnIterator(); while ( iter.hasNext() ) { --- 10,24 ---- import net.sf.hibernate.dialect.Dialect; ! public class Index implements RelationalModel { private Table table; private ArrayList columns = new ArrayList(); private String name; public String sqlCreateString(Dialect dialect, Mapping p) ! throws HibernateException { StringBuffer buf = new StringBuffer("create index ") ! .append( dialect.qualifyIndexName() ? name : StringHelper.unqualify(name) ) ! .append(" on ") ! .append( table.getQualifiedName() ) ! .append(" ("); Iterator iter = getColumnIterator(); while ( iter.hasNext() ) { *************** *** 42,46 **** } public void addColumn(Column column) { ! if (!columns.contains(column)) columns.add(column); } public String getName() { --- 42,46 ---- } public void addColumn(Column column) { ! if (!columns.contains(column)) columns.add(column); } public String getName() { *************** *** 51,52 **** --- 51,55 ---- } } + + + Index: IndexedCollection.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/IndexedCollection.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** IndexedCollection.java 1 Jan 2003 13:56:16 -0000 1.1.1.1 --- IndexedCollection.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 38,43 **** getTable().setPrimaryKey(pk); } ! ! } --- 38,46 ---- getTable().setPrimaryKey(pk); } ! ! } + + + Index: IntegerValue.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/IntegerValue.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IntegerValue.java 2 Jan 2003 11:01:49 -0000 1.2 --- IntegerValue.java 4 Jan 2003 11:15:29 -0000 1.3 *************** *** 19,23 **** col.setTypeIndex(0); } ! } --- 19,26 ---- col.setTypeIndex(0); } ! } + + + Index: List.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/List.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** List.java 1 Jan 2003 13:56:16 -0000 1.1.1.1 --- List.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 10,14 **** private boolean doneSecondPass; ! public List(Node node, String prefix, PersistentClass owner, Root root) throws MappingException { super(node, prefix, owner, root); --- 10,14 ---- private boolean doneSecondPass; ! public List(Node node, String prefix, PersistentClass owner, Root root) throws MappingException { super(node, prefix, owner, root); *************** *** 39,43 **** return net.sf.hibernate.collection.List.class; } ! } --- 39,46 ---- return net.sf.hibernate.collection.List.class; } ! } + + + Index: ManyToOne.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/ManyToOne.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ManyToOne.java 2 Jan 2003 11:01:49 -0000 1.2 --- ManyToOne.java 4 Jan 2003 11:15:29 -0000 1.3 *************** *** 13,24 **** public class ManyToOne extends Association { ! // A many-to-one association public ManyToOne(Node node, String path, String defaultColumnName, boolean isNullable, Table table, Root root) throws MappingException { super(node, path, defaultColumnName, isNullable, table, root); } - - protected Type typeFromXML(Node node) throws MappingException { NamedNodeMap atts = node.getAttributes(); Node typeNode = atts.getNamedItem("class"); --- 13,24 ---- public class ManyToOne extends Association { ! // A many-to-one association public ManyToOne(Node node, String path, String defaultColumnName, boolean isNullable, Table table, Root root) throws MappingException { super(node, path, defaultColumnName, isNullable, table, root); } + protected Type typeFromXML(Node node) throws MappingException { + NamedNodeMap atts = node.getAttributes(); Node typeNode = atts.getNamedItem("class"); *************** *** 34,39 **** public void setTypeByReflection(Class propertyClass, String propertyName) throws MappingException { try { ! if (getType()==null) setType( TypeFactory.manyToOne( ! ReflectHelper.getGetter(propertyClass, propertyName).getReturnType() ) ); } --- 34,39 ---- public void setTypeByReflection(Class propertyClass, String propertyName) throws MappingException { try { ! if (getType()==null) setType( TypeFactory.manyToOne( ! ReflectHelper.getGetter(propertyClass, propertyName).getReturnType() ) ); } *************** *** 42,50 **** } } ! public void createForeignKeys(Root root, Table table) { createForeignKeyOfClass(root, table, ( (EntityType) getType() ).getPersistentClass() ); } ! } --- 42,53 ---- } } ! public void createForeignKeys(Root root, Table table) { createForeignKeyOfClass(root, table, ( (EntityType) getType() ).getPersistentClass() ); } ! } + + + Index: Map.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Map.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Map.java 2 Jan 2003 11:01:49 -0000 1.3 --- Map.java 4 Jan 2003 11:15:29 -0000 1.4 *************** *** 12,16 **** public class Map extends IndexedCollection { ! private final boolean sorted; private Comparator comparator; --- 12,16 ---- public class Map extends IndexedCollection { ! private final boolean sorted; private Comparator comparator; *************** *** 19,23 **** public Map(Node node, String prefix, PersistentClass owner, Root root) throws MappingException { super(node, prefix, owner, root); ! Node sortedAtt = node.getAttributes().getNamedItem("sort"); --- 19,23 ---- public Map(Node node, String prefix, PersistentClass owner, Root root) throws MappingException { super(node, prefix, owner, root); ! Node sortedAtt = node.getAttributes().getNamedItem("sort"); *************** *** 67,79 **** doneSecondPass = true; } ! public PersistentCollectionType getType() { return sorted ? TypeFactory.sortedMap( getRole(), comparator ): TypeFactory.map( getRole() ); } ! public Class wrapperClass() { return sorted ? net.sf.hibernate.collection.SortedMap.class : net.sf.hibernate.collection.Map.class; } ! } --- 67,82 ---- doneSecondPass = true; } ! public PersistentCollectionType getType() { return sorted ? TypeFactory.sortedMap( getRole(), comparator ): TypeFactory.map( getRole() ); } ! public Class wrapperClass() { return sorted ? net.sf.hibernate.collection.SortedMap.class : net.sf.hibernate.collection.Map.class; } ! } + + + Index: OneToMany.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/OneToMany.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** OneToMany.java 1 Jan 2003 13:56:17 -0000 1.1.1.1 --- OneToMany.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 18,27 **** return type; } ! public OneToMany(Node node, PersistentClass owner) throws MappingException { this.referencingTable = (owner==null) ? null : owner.getTable(); try { type = (EntityType) Hibernate.association( ReflectHelper.classForName( ! node.getAttributes().getNamedItem("class").getNodeValue() ) ); } --- 18,27 ---- return type; } ! public OneToMany(Node node, PersistentClass owner) throws MappingException { this.referencingTable = (owner==null) ? null : owner.getTable(); try { type = (EntityType) Hibernate.association( ReflectHelper.classForName( ! node.getAttributes().getNamedItem("class").getNodeValue() ) ); } *************** *** 30,37 **** } } ! public Table getReferencingTable() { return referencingTable; } } --- 30,40 ---- } } ! public Table getReferencingTable() { return referencingTable; } } + + + Index: OneToOne.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/OneToOne.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OneToOne.java 2 Jan 2003 11:01:49 -0000 1.2 --- OneToOne.java 4 Jan 2003 11:15:29 -0000 1.3 *************** *** 21,25 **** private AssociationType.ForeignKeyType foreignKeyType; private Value identifier; ! // A one-to-one association public OneToOne(Node node, Value identifier, String path, boolean isNullable, Table table, Root root) throws MappingException { --- 21,25 ---- private AssociationType.ForeignKeyType foreignKeyType; private Value identifier; ! // A one-to-one association public OneToOne(Node node, Value identifier, String path, boolean isNullable, Table table, Root root) throws MappingException { *************** *** 27,33 **** this.identifier = identifier; } - - protected Type typeFromXML(Node node) throws MappingException { NamedNodeMap atts = node.getAttributes(); Node constrNode = atts.getNamedItem("constrained"); --- 27,33 ---- this.identifier = identifier; } + protected Type typeFromXML(Node node) throws MappingException { + NamedNodeMap atts = node.getAttributes(); Node constrNode = atts.getNamedItem("constrained"); *************** *** 48,53 **** public void setTypeByReflection(Class propertyClass, String propertyName) throws MappingException { try { ! if (getType()==null) setType( TypeFactory.oneToOne( ! ReflectHelper.getGetter(propertyClass, propertyName).getReturnType(), foreignKeyType ) ); } --- 48,53 ---- public void setTypeByReflection(Class propertyClass, String propertyName) throws MappingException { try { ! if (getType()==null) setType( TypeFactory.oneToOne( ! ReflectHelper.getGetter(propertyClass, propertyName).getReturnType(), foreignKeyType ) ); } *************** *** 59,63 **** if (constrained) createForeignKeyOfClass( root, table, ( (EntityType) getType() ).getPersistentClass() ); } ! public java.util.List getConstraintColumns() { ArrayList list = new ArrayList(); --- 59,63 ---- if (constrained) createForeignKeyOfClass( root, table, ( (EntityType) getType() ).getPersistentClass() ); } ! public java.util.List getConstraintColumns() { ArrayList list = new ArrayList(); *************** *** 67,69 **** --- 67,72 ---- } } + + + Index: PersistentClass.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/PersistentClass.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PersistentClass.java 2 Jan 2003 11:01:49 -0000 1.2 --- PersistentClass.java 4 Jan 2003 11:15:29 -0000 1.3 *************** *** 20,24 **** private final ArrayList subclassTables = new ArrayList(); private Class proxyInterface; //can be final ! protected PersistentClass(Node node) throws MappingException { NamedNodeMap atts = node.getAttributes(); --- 20,24 ---- private final ArrayList subclassTables = new ArrayList(); private Class proxyInterface; //can be final ! protected PersistentClass(Node node) throws MappingException { NamedNodeMap atts = node.getAttributes(); *************** *** 44,69 **** Node discriminatorNode = atts.getNamedItem("discriminator-value"); discriminatorValue = (discriminatorNode==null) ? className : discriminatorNode.getNodeValue(); ! } ! public String getDiscriminatorValue() { return discriminatorValue; } ! protected void addSubclass(Subclass subclass) { subclasses.add(subclass); } ! protected void propertiesFromXML(Node node, Root root) throws MappingException { ! NodeList list = node.getChildNodes(); String path = StringHelper.unqualify(className); Table table = getTable(); for ( int i=0; i<list.getLength(); i++ ) { ! Node subnode = list.item(i); String name = subnode.getNodeName(); String propertyName = Property.getPropertyName(subnode); ! Root.CollectionType collectType = Root.CollectionType.collectionTypeFromString(name); Value value = null; --- 44,69 ---- Node discriminatorNode = atts.getNamedItem("discriminator-value"); discriminatorValue = (discriminatorNode==null) ? className : discriminatorNode.getNodeValue(); ! } ! public String getDiscriminatorValue() { return discriminatorValue; } ! protected void addSubclass(Subclass subclass) { subclasses.add(subclass); } ! protected void propertiesFromXML(Node node, Root root) throws MappingException { ! NodeList list = node.getChildNodes(); String path = StringHelper.unqualify(className); Table table = getTable(); for ( int i=0; i<list.getLength(); i++ ) { ! Node subnode = list.item(i); String name = subnode.getNodeName(); String propertyName = Property.getPropertyName(subnode); ! Root.CollectionType collectType = Root.CollectionType.collectionTypeFromString(name); Value value = null; *************** *** 92,96 **** root.addPersistentClass(subclass); } ! if ( value!=null) { value.setTypeByReflection(persistentClass, propertyName); value.createForeignKeys(root, table); --- 92,96 ---- root.addPersistentClass(subclass); } ! if ( value!=null) { value.setTypeByReflection(persistentClass, propertyName); value.createForeignKeys(root, table); *************** *** 99,107 **** } } ! public boolean hasSubclasses() { return subclasses.size() > 0; } ! public int getSubclassSpan() { int n = subclasses.size(); --- 99,107 ---- } } ! public boolean hasSubclasses() { return subclasses.size() > 0; } ! public int getSubclassSpan() { int n = subclasses.size(); *************** *** 143,151 **** return table; } ! public Class getPersistentClass() { return persistentClass; } ! public String getName() { return persistentClass.getName(); --- 143,151 ---- return table; } ! public Class getPersistentClass() { return persistentClass; } ! public String getName() { return persistentClass.getName(); *************** *** 167,171 **** public abstract Iterator getPropertyClosureIterator(); public abstract Iterator getTableClosureIterator(); ! protected void addSubclassProperty(Property p) { subclassProperties.add(p); --- 167,171 ---- public abstract Iterator getPropertyClosureIterator(); public abstract Iterator getTableClosureIterator(); ! protected void addSubclassProperty(Property p) { subclassProperties.add(p); *************** *** 190,191 **** --- 190,194 ---- public abstract Value getKey(); } + + + Index: PrimaryKey.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/PrimaryKey.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** PrimaryKey.java 1 Jan 2003 13:56:20 -0000 1.1.1.1 --- PrimaryKey.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 7,11 **** public class PrimaryKey extends Constraint { ! public String sqlConstraintString(Dialect d) { StringBuffer buf = new StringBuffer(" primary key ("); --- 7,11 ---- public class PrimaryKey extends Constraint { ! public String sqlConstraintString(Dialect d) { StringBuffer buf = new StringBuffer(" primary key ("); *************** *** 19,24 **** public String sqlConstraintString(Dialect d, String constraintName) { ! StringBuffer buf = new StringBuffer( ! d.getAddPrimaryKeyConstraintString(constraintName) ).append('('); Iterator iter = getColumnIterator(); --- 19,24 ---- public String sqlConstraintString(Dialect d, String constraintName) { ! StringBuffer buf = new StringBuffer( ! d.getAddPrimaryKeyConstraintString(constraintName) ).append('('); Iterator iter = getColumnIterator(); *************** *** 30,32 **** --- 30,35 ---- } } + + + Index: PrimitiveArray.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/PrimitiveArray.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** PrimitiveArray.java 1 Jan 2003 13:56:20 -0000 1.1.1.1 --- PrimitiveArray.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 17,18 **** --- 17,21 ---- } + + + Index: Property.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Property.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Property.java 1 Jan 2003 13:56:20 -0000 1.1.1.1 --- Property.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 13,17 **** private final Value value; private String cascade; ! public String toString() { return "Property: " + name; --- 13,17 ---- private final Value value; private String cascade; ! public String toString() { return "Property: " + name; *************** *** 36,45 **** public Property(Node node, Value value, Root root) throws MappingException { name = getPropertyName(node); ! this.value=value; Type type = value.getType(); if (type==null) throw new MappingException( "Could not determine a property type for: " + name ); Node cascadeNode = node.getAttributes().getNamedItem("cascade"); cascade = (cascadeNode==null) ? root.getDefaultCascade() : cascadeNode.getNodeValue(); ! } public Value getValue() { --- 36,45 ---- public Property(Node node, Value value, Root root) throws MappingException { name = getPropertyName(node); ! this.value=value; Type type = value.getType(); if (type==null) throw new MappingException( "Could not determine a property type for: " + name ); Node cascadeNode = node.getAttributes().getNamedItem("cascade"); cascade = (cascadeNode==null) ? root.getDefaultCascade() : cascadeNode.getNodeValue(); ! } public Value getValue() { *************** *** 52,57 **** if (propertyName==null) propertyName = atts.getNamedItem("role"); return (propertyName==null) ? null : propertyName.getNodeValue(); ! } ! public Cascades.CascadeStyle cascade() throws MappingException { if ( value.getType().isComponentType() ) { --- 52,57 ---- if (propertyName==null) propertyName = atts.getNamedItem("role"); return (propertyName==null) ? null : propertyName.getNodeValue(); ! } ! public Cascades.CascadeStyle cascade() throws MappingException { if ( value.getType().isComponentType() ) { *************** *** 81,86 **** } } - } --- 81,89 ---- } } + + + } + Index: RelationalModel.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/RelationalModel.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** RelationalModel.java 1 Jan 2003 13:56:20 -0000 1.1.1.1 --- RelationalModel.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 11,12 **** --- 11,15 ---- } + + + Index: Root.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Root.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Root.java 2 Jan 2003 11:01:49 -0000 1.2 --- Root.java 4 Jan 2003 11:15:29 -0000 1.3 *************** *** 53,85 **** return xmlTag; } ! private static final CollectionType MAP = new CollectionType("map") { ! public Collection create(Node node, String prefix, PersistentClass owner, Root root) throws MappingException { ! return new Map(node, prefix, owner, root); ! } }; ! private static final CollectionType SET = new CollectionType("set") { ! public Collection create(Node node, String prefix, PersistentClass owner, Root root) throws MappingException { ! return new Set(node, prefix, owner, root); } }; ! private static final CollectionType LIST = new CollectionType("list") { ! public Collection create(Node node, String prefix, PersistentClass owner, Root root) throws MappingException { ! return new List(node, prefix, owner, root); ! } }; ! private static final CollectionType BAG = new CollectionType("bag") { ! public Collection create(Node node, String prefix, PersistentClass owner, Root root) throws MappingException { ! return new Bag(node, prefix, owner, root); ! } }; ! private static final CollectionType ARRAY = new CollectionType("array") { ! public Collection create(Node node, String prefix, PersistentClass owner, Root root) throws MappingException { ! return new Array(node, prefix, owner, root); ! } }; ! private static final CollectionType PRIMITIVE_ARRAY = new CollectionType("primitive-array") { ! public Collection create(Node node, String prefix, PersistentClass owner, Root root) throws MappingException { ! return new PrimitiveArray(node, prefix, owner, root); ! } }; private static final HashMap INSTANCES = new HashMap(); --- 53,85 ---- return xmlTag; } ! private static final CollectionType MAP = new CollectionType("map") { ! public Collection create(Node node, String prefix, PersistentClass owner, Root root) throws MappingException { ! return new Map(node, prefix, owner, root); ! } }; ! private static final CollectionType SET = new CollectionType("set") { ! public Collection create(Node node, String prefix, PersistentClass owner, Root root) throws MappingException { ! return new Set(node, prefix, owner, root); } }; ! private static final CollectionType LIST = new CollectionType("list") { ! public Collection create(Node node, String prefix, PersistentClass owner, Root root) throws MappingException { ! return new List(node, prefix, owner, root); ! } }; ! private static final CollectionType BAG = new CollectionType("bag") { ! public Collection create(Node node, String prefix, PersistentClass owner, Root root) throws MappingException { ! return new Bag(node, prefix, owner, root); ! } }; ! private static final CollectionType ARRAY = new CollectionType("array") { ! public Collection create(Node node, String prefix, PersistentClass owner, Root root) throws MappingException { ! return new Array(node, prefix, owner, root); ! } }; ! private static final CollectionType PRIMITIVE_ARRAY = new CollectionType("primitive-array") { ! public Collection create(Node node, String prefix, PersistentClass owner, Root root) throws MappingException { ! return new PrimitiveArray(node, prefix, owner, root); ! } }; private static final HashMap INSTANCES = new HashMap(); *************** *** 98,102 **** public Root( ! Document doc, java.util.Map classes, java.util.Map collections, --- 98,102 ---- public Root( ! Document doc, java.util.Map classes, java.util.Map collections, *************** *** 111,117 **** this.tables = tables; this.generators = generators; ! // Create maps for all the collections and classes ! Node hmNode = doc.getElementsByTagName("hibernate-mapping").item(0); Node schemaNode = hmNode.getAttributes().getNamedItem("schema"); --- 111,117 ---- this.tables = tables; this.generators = generators; ! // Create maps for all the collections and classes ! Node hmNode = doc.getElementsByTagName("hibernate-mapping").item(0); Node schemaNode = hmNode.getAttributes().getNamedItem("schema"); *************** *** 137,141 **** if (old!=null) throw new MappingException("duplicate query name: " + qname); } ! } } --- 137,141 ---- if (old!=null) throw new MappingException("duplicate query name: " + qname); } ! } } *************** *** 156,175 **** } ! public Table addTable(String schema, String name) ! { ! String key = schema != null ? schema + "." + name : name; ! ! Table table = (Table)tables.get(key); ! ! if (table == null) { ! table = new Table(); ! table.setName(name); ! table.setSchema(schema); ! tables.put(key, table); ! } ! ! return table; } ! public String getSchemaName() { return schemaName; --- 156,175 ---- } ! public Table addTable(String schema, String name) ! { ! String key = schema != null ? schema + "." + name : name; ! ! Table table = (Table)tables.get(key); ! ! if (table == null) { ! table = new Table(); ! table.setName(name); ! table.setSchema(schema); ! tables.put(key, table); ! } ! ! return table; } ! public String getSchemaName() { return schemaName; *************** *** 182,186 **** public IdentifierGenerator createIDGenerator(Node node) throws Exception { ! String className = node.getAttributes().getNamedItem("class").getNodeValue(); Class idgenClass = (Class) idgenerators.get(className); --- 182,186 ---- public IdentifierGenerator createIDGenerator(Node node) throws Exception { ! String className = node.getAttributes().getNamedItem("class").getNodeValue(); Class idgenClass = (Class) idgenerators.get(className); *************** *** 207,211 **** list.toArray(args); IdentifierGenerator idgen; ! Object gen = null; try { gen = idgenClass.getConstructor(argTypes).newInstance(args); --- 207,211 ---- list.toArray(args); IdentifierGenerator idgen; ! Object gen = null; try { gen = idgenClass.getConstructor(argTypes).newInstance(args); *************** *** 216,220 **** idgen = (IdentifierGenerator) gen; ! if ( PersistentIdentifierGenerator.class.isAssignableFrom(idgenClass) ) { generators.put( ( (PersistentIdentifierGenerator) idgen ).generatorKey(), idgen ); --- 216,220 ---- idgen = (IdentifierGenerator) gen; ! if ( PersistentIdentifierGenerator.class.isAssignableFrom(idgenClass) ) { generators.put( ( (PersistentIdentifierGenerator) idgen ).generatorKey(), idgen ); *************** *** 232,269 **** idgenerators.put("vm.hex", HexGenerator.class); idgenerators.put("assigned", Assigned.class); ! idgenerators.put("native", NativeGenerator.class); ! idgenerators.put("sequence", SequenceGenerator.class); ! idgenerators.put("seqhilo.long", SequenceHiLoGenerator.class); } public CacheConcurrencyStrategy createJCSCache(Node node, String name, PersistentClass owner) throws MappingException { ! String usage = node.getAttributes().getNamedItem("usage").getNodeValue(); ! final Cache jcs; ! try { ! jcs = new JCSCache(); ! } ! catch (NoClassDefFoundError ncf) { ! log.warn( "Could not instantiate cache - probably the JCS jar is missing", ncf ); ! // continue with no cache ! return null; ! } ! try { ! jcs.setClass(name); ! } ! catch (CacheException ce) { ! throw new MappingException("Could not instantiate JCS",ce); ! } ! if ( usage.equals("read-only") ) { ! if ( owner.isMutable() ) log.warn( "read-only cache configured for mutable: " + name ); ! return new ReadOnlyCache(jcs); ! } ! else if ( usage.equals("read-write") ) { ! return new ReadWriteCache(jcs); ! } ! else { ! throw new MappingException("jcs-cache usage attribute should be read-write or read-only"); ! } } ! } --- 232,272 ---- idgenerators.put("vm.hex", HexGenerator.class); idgenerators.put("assigned", Assigned.class); ! idgenerators.put("native", NativeGenerator.class); ! idgenerators.put("sequence", SequenceGenerator.class); ! idgenerators.put("seqhilo.long", SequenceHiLoGenerator.class); } public CacheConcurrencyStrategy createJCSCache(Node node, String name, PersistentClass owner) throws MappingException { ! String usage = node.getAttributes().getNamedItem("usage").getNodeValue(); ! final Cache jcs; ! try { ! jcs = new JCSCache(); ! } ! catch (NoClassDefFoundError ncf) { ! log.warn( "Could not instantiate cache - probably the JCS jar is missing", ncf ); ! // continue with no cache ! return null; ! } ! try { ! jcs.setClass(name); ! } ! catch (CacheException ce) { ! throw new MappingException("Could not instantiate JCS",ce); ! } ! if ( usage.equals("read-only") ) { ! if ( owner.isMutable() ) log.warn( "read-only cache configured for mutable: " + name ); ! return new ReadOnlyCache(jcs); ! } ! else if ( usage.equals("read-write") ) { ! return new ReadWriteCache(jcs); ! } ! else { ! throw new MappingException("jcs-cache usage attribute should be read-write or read-only"); ! } } ! } + + + Index: RootClass.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/RootClass.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RootClass.java 2 Jan 2003 11:01:49 -0000 1.2 --- RootClass.java 4 Jan 2003 11:15:29 -0000 1.3 *************** *** 34,42 **** private final boolean explicitPolymorphism; private Class persister; ! public String toString() { return "RootClass: " + getPersistentClass().getName(); } ! public Property getIdentifierProperty() { return identifierProperty; --- 34,42 ---- private final boolean explicitPolymorphism; private Class persister; ! public String toString() { return "RootClass: " + getPersistentClass().getName(); } ! public Property getIdentifierProperty() { return identifierProperty; *************** *** 48,56 **** return identifierProperty!=null; } ! public Value getDiscriminator() { return discriminator; } ! public boolean isInherited() { return false; --- 48,56 ---- return identifierProperty!=null; } ! public Value getDiscriminator() { return discriminator; } ! public boolean isInherited() { return false; *************** *** 59,67 **** return polymorphic; } ! public void setPolymorphic(boolean polymorphic) { this.polymorphic = polymorphic; } ! public RootClass getRootClass() { return this; --- 59,67 ---- return polymorphic; } ! public void setPolymorphic(boolean polymorphic) { this.polymorphic = polymorphic; } ! public RootClass getRootClass() { return this; *************** *** 73,77 **** return Collections.singleton( getTable() ).iterator(); } ! protected void addSubclass(Subclass subclass) { super.addSubclass(subclass); --- 73,77 ---- return Collections.singleton( getTable() ).iterator(); } ! protected void addSubclass(Subclass subclass) { super.addSubclass(subclass); *************** *** 82,86 **** return explicitPolymorphism; } ! public RootClass(Node node, Root root) throws MappingException { super(node); --- 82,86 ---- return explicitPolymorphism; } ! public RootClass(Node node, Root root) throws MappingException { super(node); *************** *** 89,99 **** //TABLENAME Node tableNameNode = atts.getNamedItem("table"); ! String tableName = (tableNameNode==null) ? ! StringHelper.unqualify( getPersistentClass().getName() ) : ! tableNameNode.getNodeValue(); ! Node schemaNode = atts.getNamedItem("schema"); String schema = schemaNode==null ? root.getSchemaName() : schemaNode.getNodeValue(); ! Table table = root.addTable(schema, tableName); setTable(table); --- 89,99 ---- //TABLENAME Node tableNameNode = atts.getNamedItem("table"); ! String tableName = (tableNameNode==null) ? ! StringHelper.unqualify( getPersistentClass().getName() ) : ! tableNameNode.getNodeValue(); ! Node schemaNode = atts.getNamedItem("schema"); String schema = schemaNode==null ? root.getSchemaName() : schemaNode.getNodeValue(); ! Table table = root.addTable(schema, tableName); setTable(table); *************** *** 111,115 **** } } ! //DISCRIMINATOR (deprecated; to support old DTD) Node discriminatorColumnNode = atts.getNamedItem("discriminator"); --- 111,115 ---- } } ! //DISCRIMINATOR (deprecated; to support old DTD) Node discriminatorColumnNode = atts.getNamedItem("discriminator"); *************** *** 132,140 **** NodeList list = node.getChildNodes(); for ( int i=0; i<list.getLength(); i++ ) { ! Node subnode = list.item(i); String name = subnode.getNodeName(); String propertyName = Property.getPropertyName(subnode); ! if ( "id".equals(name) ) { if (propertyName==null) { --- 132,140 ---- NodeList list = node.getChildNodes(); for ( int i=0; i<list.getLength(); i++ ) { ! Node subnode = list.item(i); String name = subnode.getNodeName(); String propertyName = Property.getPropertyName(subnode); ! if ( "id".equals(name) ) { if (propertyName==null) { *************** *** 217,221 **** cache = root.createJCSCache(subnode, getPersistentClass().getName(), this); } ! } //Primary key constraint --- 217,221 ---- cache = root.createJCSCache(subnode, getPersistentClass().getName(), this); } ! } //Primary key constraint *************** *** 229,237 **** //root.addPrimaryKey(pk); //No good for postgres table.setPrimaryKey(pk); ! propertiesFromXML(node, root); ! } ! public Property getVersion() { return version; --- 229,237 ---- //root.addPrimaryKey(pk); //No good for postgres table.setPrimaryKey(pk); ! propertiesFromXML(node, root); ! } ! public Property getVersion() { return version; *************** *** 243,251 **** return version!=null; } ! public CacheConcurrencyStrategy getCache() { return cache; } ! public boolean isMutable() { return mutable; --- 243,251 ---- return version!=null; } ! public CacheConcurrencyStrategy getCache() { return cache; } ! public boolean isMutable() { return mutable; *************** *** 254,270 **** return embeddedIdentifier; } ! public Class getPersister() { return persister; } ! public Table getRootTable() { return getTable(); } ! public void setPersister(Class persister) { this.persister = persister; } ! public PersistentClass getSuperclass() { return null; --- 254,270 ---- return embeddedIdentifier; } ! public Class getPersister() { return persister; } ! public Table getRootTable() { return getTable(); } ! public void setPersister(Class persister) { this.persister = persister; } ! public PersistentClass getSuperclass() { return null; *************** *** 275,276 **** --- 275,279 ---- } } + + + Index: Set.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Set.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Set.java 1 Jan 2003 13:56:24 -0000 1.1.1.1 --- Set.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 14,18 **** public class Set extends Collection { ! private final boolean sorted; private Comparator comparator; --- 14,18 ---- public class Set extends Collection { ! private final boolean sorted; private Comparator comparator; *************** *** 75,79 **** public void secondPassCompile(Map persistentClasses) ! throws MappingException { super.secondPassCompile(persistentClasses); --- 75,79 ---- public void secondPassCompile(Map persistentClasses) ! throws MappingException { super.secondPassCompile(persistentClasses); *************** *** 84,88 **** } } ! } --- 84,91 ---- } } ! } + + + Index: Subclass.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Subclass.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Subclass.java 1 Jan 2003 13:56:24 -0000 1.1.1.1 --- Subclass.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 15,23 **** private final PersistentClass superclass; private Value key; ! public CacheConcurrencyStrategy getCache() { return getSuperclass().getCache(); } ! public String toString() { return "Subclass: " + getPersistentClass().getName(); --- 15,23 ---- private final PersistentClass superclass; private Value key; ! public CacheConcurrencyStrategy getCache() { return getSuperclass().getCache(); } ! public String toString() { return "Subclass: " + getPersistentClass().getName(); *************** *** 27,35 **** return getSuperclass().getRootClass(); } ! public PersistentClass getSuperclass() { return superclass; } ! public Property getIdentifierProperty() { return getSuperclass().getIdentifierProperty(); --- 27,35 ---- return getSuperclass().getRootClass(); } ! public PersistentClass getSuperclass() { return superclass; } ! public Property getIdentifierProperty() { return getSuperclass().getIdentifierProperty(); *************** *** 53,57 **** return true; } ! public void addProperty(Property p) { super.addProperty(p); --- 53,57 ---- return true; } ! public void addProperty(Property p) { super.addProperty(p); *************** *** 63,73 **** } public Iterator getPropertyClosureIterator() { ! return new JoinedIterator( new Iterator[] { ! getPropertyIterator(), ! getSuperclass().getPropertyClosureIterator() } ); } public Iterator getTableClosureIterator() { ! return new JoinedIterator( new Iterator[] { getSuperclass().getTableClosureIterator(), Collections.singleton( getTable() ).iterator() --- 63,73 ---- } public Iterator getPropertyClosureIterator() { ! return new JoinedIterator( new Iterator[] { ! getPropertyIterator(), ! getSuperclass().getPropertyClosureIterator() } ); } public Iterator getTableClosureIterator() { ! return new JoinedIterator( new Iterator[] { getSuperclass().getTableClosureIterator(), Collections.singleton( getTable() ).iterator() *************** *** 78,87 **** getSuperclass().addSubclassProperty(p); } ! protected void addSubclassTable(Table table) { super.addSubclassTable(table); getSuperclass().addSubclassTable(table); } ! public Subclass(PersistentClass superclass, Node node, Table table, Root root) throws MappingException { super(node); --- 78,87 ---- getSuperclass().addSubclassProperty(p); } ! protected void addSubclassTable(Table table) { super.addSubclassTable(table); getSuperclass().addSubclassTable(table); } ! public Subclass(PersistentClass superclass, Node node, Table table, Root root) throws MappingException { super(node); *************** *** 95,99 **** if (tableNameNode==null) { //ordinary subclasses ! if ( getPersister()==null ) { getRootClass().setPersister(EntityPersister.class); --- 95,99 ---- if (tableNameNode==null) { //ordinary subclasses ! if ( getPersister()==null ) { getRootClass().setPersister(EntityPersister.class); *************** *** 112,116 **** Node schemaNode = atts.getNamedItem("schema"); String schema = schemaNode==null ? root.getSchemaName() : schemaNode.getNodeValue(); ! Table mytable = root.addTable(schema, tableName); setTable(mytable); --- 112,116 ---- Node schemaNode = atts.getNamedItem("schema"); String schema = schemaNode==null ? root.getSchemaName() : schemaNode.getNodeValue(); ! Table mytable = root.addTable(schema, tableName); setTable(mytable); *************** *** 120,124 **** pk.setName( StringHelper.suffix( tableName, "PK" ) ); mytable.setPrimaryKey(pk); ! NodeList subnodes = node.getChildNodes(); for ( int i=0; i<subnodes.getLength(); i++ ) { --- 120,124 ---- pk.setName( StringHelper.suffix( tableName, "PK" ) ); mytable.setPrimaryKey(pk); ! NodeList subnodes = node.getChildNodes(); for ( int i=0; i<subnodes.getLength(); i++ ) { *************** *** 135,142 **** pk.addColumn(col); } ! ForeignKey fk = mytable.createForeignKey( key.getConstraintColumns() ); fk.setReferencedClass( superclass.getPersistentClass() ); ! } --- 135,142 ---- pk.addColumn(col); } ! ForeignKey fk = mytable.createForeignKey( key.getConstraintColumns() ); fk.setReferencedClass( superclass.getPersistentClass() ); ! } *************** *** 157,161 **** return getSuperclass().getPersister(); } ! public Table getRootTable() { return getSuperclass().getRootTable(); --- 157,161 ---- return getSuperclass().getPersister(); } ! public Table getRootTable() { return getSuperclass().getRootTable(); *************** *** 170,177 **** } } ! public boolean isExplicitPolymorphism() { return getSuperclass().isExplicitPolymorphism(); } ! } --- 170,180 ---- } } ! public boolean isExplicitPolymorphism() { return getSuperclass().isExplicitPolymorphism(); } ! } + + + Index: Table.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/mapping/Table.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Table.java 1 Jan 2003 13:56:25 -0000 1.1.1.1 --- Table.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 25,46 **** private IdentifierGenerator identifierGenerator = Assigned.INSTANCE; private PrimaryKey primaryKey; ! private Map indexes = new HashMap(); ! private Map foreignKeys = new HashMap(); ! private Map uniqueKeys = new HashMap(); private final int uniqueInteger; private static int tableCounter=0; ! public Table() { uniqueInteger = tableCounter++; } ! public String getQualifiedName() { return (schema==null) ? name : schema + '.' + name; } ! public String getQualifiedName(String defaultQualifier) { return ( schema==null ) ? ( (defaultQualifier==null) ? name : defaultQualifier + '.' + name ) : getQualifiedName(); } ! public String getName() { return name; --- 25,46 ---- private IdentifierGenerator identifierGenerator = Assigned.INSTANCE; private PrimaryKey primaryKey; ! private Map indexes = new HashMap(); ! private Map foreignKeys = new HashMap(); ! private Map uniqueKeys = new HashMap(); private final int uniqueInteger; private static int tableCounter=0; ! public Table() { uniqueInteger = tableCounter++; } ! public String getQualifiedName() { return (schema==null) ? name : schema + '.' + name; } ! public String getQualifiedName(String defaultQualifier) { return ( schema==null ) ? ( (defaultQualifier==null) ? name : defaultQualifier + '.' + name ) : getQualifiedName(); } ! public String getName() { return name; *************** *** 49,53 **** this.name = name; } ! public Column ... [truncated message content] |
From: <one...@us...> - 2003-01-04 11:23:54
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/metadata In directory sc8-pr-cvs1:/tmp/cvs-serv14211/src/net/sf/hibernate/metadata Modified Files: ClassMetadata.java CollectionMetadata.java Log Message: reformatted code with beautiful, shiny, happy TABS! improved an exception Index: ClassMetadata.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/metadata/ClassMetadata.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ClassMetadata.java 1 Jan 2003 13:56:27 -0000 1.1.1.1 --- ClassMetadata.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 9,48 **** /** * Exposes entity class metadata to the application ! * * @see net.sf.hibernate.SessionFactory#getClassMetadata(Class) */ public interface ClassMetadata { ! /** * The persistent class */ public Class getMappedClass(); ! /** * Get the name of the identifier property (or return null) */ public String getIdentifierPropertyName(); ! /** * Get the names of the class' persistent properties */ public String[] getPropertyNames(); ! /** * Get the identifier Hibernate type */ public Type getIdentifierType(); ! /** * Get the Hibernate types of the class properties */ public Type[] getPropertyTypes(); ! ! /** * Return the values of the mapped properties of the object */ public Object[] getPropertyValues(Object entity) throws HibernateException; ! ! /** * Set the given values to the mapped properties of the given object */ --- 9,48 ---- /** * Exposes entity class metadata to the application ! * * @see net.sf.hibernate.SessionFactory#getClassMetadata(Class) */ public interface ClassMetadata { ! /** * The persistent class */ public Class getMappedClass(); ! /** * Get the name of the identifier property (or return null) */ public String getIdentifierPropertyName(); ! /** * Get the names of the class' persistent properties */ public String[] getPropertyNames(); ! /** * Get the identifier Hibernate type */ public Type getIdentifierType(); ! /** * Get the Hibernate types of the class properties */ public Type[] getPropertyTypes(); ! ! /** * Return the values of the mapped properties of the object */ public Object[] getPropertyValues(Object entity) throws HibernateException; ! ! /** * Set the given values to the mapped properties of the given object */ *************** *** 58,62 **** */ public void setIdentifier(Object object, Serializable id) throws HibernateException; ! /** * Does the class implement the <tt>Lifecycle</tt> interface? --- 58,62 ---- */ public void setIdentifier(Object object, Serializable id) throws HibernateException; ! /** * Does the class implement the <tt>Lifecycle</tt> interface? *************** *** 84,85 **** --- 84,88 ---- public boolean isVersioned(); } + + + Index: CollectionMetadata.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/metadata/CollectionMetadata.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** CollectionMetadata.java 1 Jan 2003 13:56:27 -0000 1.1.1.1 --- CollectionMetadata.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 41,42 **** --- 41,45 ---- public boolean isLazy(); } + + + |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/odmg In directory sc8-pr-cvs1:/tmp/cvs-serv14211/src/net/sf/hibernate/odmg Modified Files: Database.java Implementation.java Name.java OQLQuery.java Transaction.java Log Message: reformatted code with beautiful, shiny, happy TABS! improved an exception Index: Database.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/odmg/Database.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Database.java 1 Jan 2003 13:56:28 -0000 1.1.1.1 --- Database.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 18,22 **** * up objects by name.<br> * <br> ! * Applications may create an instance by calling * <tt>Implementation.newDatabase()</tt> or by instantiating this class * directly. The application should then call <tt>open()</tt> to associate --- 18,22 ---- * up objects by name.<br> * <br> ! * Applications may create an instance by calling * <tt>Implementation.newDatabase()</tt> or by instantiating this class * directly. The application should then call <tt>open()</tt> to associate *************** *** 44,48 **** this.sessionFactory=factory; } ! /** * Get the <tt>Session</tt> underlying the <tt>Transaction</tt> associated --- 44,48 ---- this.sessionFactory=factory; } ! /** * Get the <tt>Session</tt> underlying the <tt>Transaction</tt> associated *************** *** 52,56 **** return currentTransaction().getSession(); } ! /** * Get the <tt>SessionFactory</tt> underlying this <tt>Database</tt>. --- 52,56 ---- return currentTransaction().getSession(); } ! /** * Get the <tt>SessionFactory</tt> underlying this <tt>Database</tt>. *************** *** 94,98 **** }*/ } ! /** * Close the <tt>Database</tt> (but not the underlying <tt>SessionFactory</tt>). --- 94,98 ---- }*/ } ! /** * Close the <tt>Database</tt> (but not the underlying <tt>SessionFactory</tt>). *************** *** 105,109 **** //TODO: remove it from ThreadLocal storage on Implementation } ! /** * Bind a name to a persistent object, making the object persistent if necessary. --- 105,109 ---- //TODO: remove it from ThreadLocal storage on Implementation } ! /** * Bind a name to a persistent object, making the object persistent if necessary. *************** *** 124,128 **** } } ! /** * Retrieve the persistent object bound to the given name. --- 124,128 ---- } } ! /** * Retrieve the persistent object bound to the given name. *************** *** 148,152 **** } } ! /** * Unbind the given name. --- 148,152 ---- } } ! /** * Unbind the given name. *************** *** 172,176 **** } } ! /** * Make the given object persistent. --- 172,176 ---- } } ! /** * Make the given object persistent. *************** *** 203,206 **** } } ! } --- 203,209 ---- } } ! } + + + Index: Implementation.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/odmg/Implementation.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Implementation.java 1 Jan 2003 13:56:28 -0000 1.1.1.1 --- Implementation.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 19,24 **** import net.sf.hibernate.engine.SessionImplementor; /** ! * Singleton class implementing the ODMG <tt>Implementation</tt> interface. ! * Maintains a reference to a default <tt>Database</tt> and also associations * between a <tt>Database</tt> and the creating <tt>Thread</tt>. */ --- 19,24 ---- import net.sf.hibernate.engine.SessionImplementor; /** ! * Singleton class implementing the ODMG <tt>Implementation</tt> interface. ! * Maintains a reference to a default <tt>Database</tt> and also associations * between a <tt>Database</tt> and the creating <tt>Thread</tt>. */ *************** *** 50,54 **** /** ! * Get the <tt>Database</tt> associated with the current thread (the most recent * database created by the current thread or the default database). */ --- 50,54 ---- /** ! * Get the <tt>Database</tt> associated with the current thread (the most recent * database created by the current thread or the default database). */ *************** *** 83,87 **** } /** ! * Instantiate an <tt>OQLQuery</tt> for the <tt>Database</tt> associated with * the current thread * @see org.odmg.Implementation#newOQLQuery() --- 83,87 ---- } /** ! * Instantiate an <tt>OQLQuery</tt> for the <tt>Database</tt> associated with * the current thread * @see org.odmg.Implementation#newOQLQuery() *************** *** 133,137 **** } /** ! * Get the <tt>Database</tt> associated with the current thread (the most recent * database created by the current thread or the default database). * @see org.odmg.Implementation#getDatabase(Object) --- 133,137 ---- } /** ! * Get the <tt>Database</tt> associated with the current thread (the most recent * database created by the current thread or the default database). * @see org.odmg.Implementation#getDatabase(Object) *************** *** 143,144 **** --- 143,147 ---- } + + + Index: Name.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/odmg/Name.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Name.java 1 Jan 2003 13:56:29 -0000 1.1.1.1 --- Name.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 1 **** ! //$Id$ package net.sf.hibernate.odmg; import java.io.Serializable; /** * An ODMG name that may be bound to a persistent object. */ public class Name { private String name; private Class persistentClass; private Serializable id; public Name(String name, Class persistentClass, Serializable id) { this.name = name; this.persistentClass = persistentClass; this.id = id; } public Name() {} /** * Returns the name. * @return String */ public String getName() { return name; } /** * Returns the persistentClass. * @return Class */ public Class getPersistentClass() { return persistentClass; } /** * Sets the name. * @param name The name to set */ public void setName(String name) { this.name = name; } /** * Sets the persistentClass. * @param persistentClass The persistentClass to set */ public void setPersistentClass(Class persistentClass) { this.persistentClass = persistentClass; } /** * Returns the id. * @return Serializable */ public Serializable getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(Serializable id) { this.id = id; } } \ No newline at end of file --- 1,3 ---- ! //$Id$ package net.sf.hibernate.odmg; import java.io.Serializable; /** * An ODMG name that may be bound to a persistent object. */ public class Name { private String name; private Class persistentClass; private Serializable id; public Name(String name, Class persistentClass, Serializable id) { this.name = name; this.persistentClass = persistentClass; this.id = id; } public Name() {} /** * Returns the name. * @return String */ public String getName() { return name; } /** * Returns the persistentClass. * @return Class */ public Class getPersistentClass() { return persistentClass; } /** * Sets the name. * @param name The name to set */ public void setName(String name) { this.name = name; } /** * Sets the persistentClass. * @param persistentClass The persistentClass to set */ public void setPersistentClass(Class persistentClass) { this.persistentClass = persistentClass; } /** * Returns the id. * @return Serializable */ public Serializable getId() { return id; } /** * Sets the id. * @param id The id to set */ public void setId(Serializable id) { this.id = id; } } ! ! Index: OQLQuery.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/odmg/OQLQuery.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** OQLQuery.java 1 Jan 2003 13:56:29 -0000 1.1.1.1 --- OQLQuery.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 1 **** ! //$Id$ package net.sf.hibernate.odmg; import java.sql.SQLException; import org.odmg.ODMGRuntimeException; import org.odmg.QueryException; import org.odmg.QueryInvalidException; import org.odmg.QueryParameterCountInvalidException; import org.odmg.QueryParameterTypeInvalidException; import net.sf.hibernate.HibernateException; import net.sf.hibernate.Query; /** Experimental implementation of the ODMG <tt>OQLQuery</tt> interface. The supported query language is actually the Hibernate query language and the <tt>execute()</tt> method returns results in the same format as <tt>Session.find()</tt>.<br> <br> Warning: this implementation will change significantly as ODMG support matures! */ public class OQLQuery implements org.odmg.OQLQuery { private Transaction tx; private Query query; private int param=0; /** * Instantiate an <tt>OQLQuery</tt> for the current transaction. */ public OQLQuery(Database db) { this.tx = db.currentTransaction(); } /** * Instantiate an <tt>OQLQuery</tt> for the given transaction. */ public OQLQuery(Transaction tx) { this.tx = tx; } /** * Instantiate an <tt>OQLQuery</tt> for the current transaction. */ public OQLQuery() { this.tx = (Transaction) Implementation.getInstance().currentTransaction(); } /** * Get the underlying Hibernate <tt>Query</tt>. */ public Query getQuery() { return query; } /** * Set the HIbernate query string. Scalar return values are not supported. * @see org.odmg.OQLQuery#create(String) */ public void create(String queryString) throws QueryInvalidException { //TODO: the right exception try { this.query = tx.getSession().createQuery(queryString); } catch (HibernateException he) { throw new ODMGRuntimeException( he.getMessage() ); } } /** * Bind a value to the next <tt>?</tt> style parameter. * @see org.odmg.OQLQuery#bind(Object) */ public void bind(Object parameter) throws QueryParameterCountInvalidException, QueryParameterTypeInvalidException { //TODO: the right exception try { query.setParameter(param++, parameter); } catch (HibernateException he) { throw new ODMGRuntimeException( he.getMessage() ); } } /** * Get the query results as a collection. * @see org.odmg.OQLQuery#execute() */ public Object execute() throws QueryException { //TODO: how are results meant to be returned in ODMG? try { return query.list(); } catch (SQLException sqle) { throw new QueryException( sqle.getMessage() ); } catch (HibernateException he) { throw new QueryException( he.getMessage() ); } } } \ No newline at end of file --- 1,3 ---- ! //$Id$ package net.sf.hibernate.odmg; import java.sql.SQLException; import org.odmg.ODMGRuntimeException; import org.odmg.QueryException; import org.odmg.QueryInvalidException; import org.odmg.QueryParameterCountInvalidException; import org.odmg.QueryParameterTypeInvalidException; import net.sf.hibernate.HibernateException; import net.sf.hibernate.Query; /** Experimental implementation of the ODMG <tt>OQLQuery</tt> interface. The supported query language is actually the Hibernate query language and the <tt>execute()</tt> method returns results in the same format as <tt>Session.find()</tt>.<br> <br> Warning: this implementation will change significantly as ODMG support matures! */ public class OQLQuery implements org.odmg.OQLQuery { private Transaction tx; private Query query; private int param=0; /** * Instantiate an <tt>OQLQuery</tt> for the current transaction. */ public OQLQuery(Database db) { this.tx = db.currentTransaction(); } /** * Instantiate an <tt>OQLQuery</tt> for the given transaction. */ public OQLQuery(Transaction tx) { this.tx = tx; } /** * Instantiate an <tt>OQLQuery</tt> for the current transaction. */ public OQLQuery() { this.tx = (Transaction) Implementation.getInstance().currentTransaction(); } /** * Get the underlying Hibernate <tt>Query</tt>. */ public Query getQuery() { return query; } /** * Set the HIbernate query string. Scalar return values are not supported. * @see org.odmg.OQLQuery#create(String) */ public void create(String queryString) throws QueryInvalidException { //TODO: the right exception try { this.query = tx.getSession().createQuery(queryString); } catch (HibernateException he) { throw new ODMGRuntimeException( he.getMessage() ); } } /** * Bind a value to the next <tt>?</tt> style parameter. * @see org.odmg.OQLQuery#bind(Object) */ public void bind(Object parameter) throws QueryParameterCountInvalidException, QueryParameterTypeInvalidException { //TODO: the right exception try { query.setParameter(param++, parameter); } catch (HibernateException he) { throw new ODMGRuntimeException( he.getMessage() ); } } /** * Get the query results as a collection. * @see org.odmg.OQLQuery#execute() */ public Object execute() throws QueryException { //TODO: how are results meant to be returned in ODMG? try { return query.list(); } catch (SQLException sqle) { throw new QueryException( sqle.getMessage() ); } catch (HibernateException he) { throw new QueryException( he.getMessage() ); } } } ! ! Index: Transaction.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/odmg/Transaction.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Transaction.java 1 Jan 2003 13:56:31 -0000 1.1.1.1 --- Transaction.java 4 Jan 2003 11:15:30 -0000 1.2 *************** *** 1 **** ! //$Id$ package net.sf.hibernate.odmg; import java.sql.SQLException; import org.odmg.LockNotGrantedException; import org.odmg.ODMGException; import org.odmg.ODMGRuntimeException; import net.sf.hibernate.HibernateException; import net.sf.hibernate.LockMode; import net.sf.hibernate.Session; /** * Implements the ODMG <tt>Transaction</tt> API. */ public class Transaction implements org.odmg.Transaction { private final Database database; private final Session session; private net.sf.hibernate.Transaction tx; /** * Instantiate a <tt>Transaction</tt> for the given <tt>Database</tt>. */ public Transaction(org.odmg.Database database) throws ODMGException { this.database = (Database) database; try { this.session = this.database.getSessionFactory().openSession(); } catch (SQLException sqle) { throw new ODMGException( sqle.getMessage() ); } this.database.associateThread(this); } /** * Instantiate a <tt>Transaction</tt> for a <tt>Database</tt> created * by the current thread. */ public Transaction() throws ODMGException { this( Implementation.getInstance().currentDatabase() ); } /** * Get the underlying Hibernate <tt>Session</tt>. (Very useful!) */ public Session getSession() { return session; } /** * Associate the current thread with this <tt>Transaction</tt> and * disassociate the thread from any other <tt>Transaction</tt>. * @see org.odmg.Transaction#join() */ public void join() { //database.disassociateThread(); database.associateThread(this); } /** * Disassociate the thread the <tt>Transaction</tt>. * @see org.odmg.Transaction#leave() */ public void leave() { database.disassociateThread(); } /** * Begin the transaction. * @see org.odmg.Transaction#begin() */ public void begin() { try { tx = session.beginTransaction(); } catch (HibernateException he) { throw new ODMGRuntimeException( he.getMessage() ); } } /** * Is the transaction open? Returns true if <tt>begin()</tt> was called but * neither <tt>commit()</tt> nor <tt>abort()</tt> was called. * @see org.odmg.Transaction#isOpen() */ public boolean isOpen() { return tx==null; } /** * Commit the transaction. * @see org.odmg.Transaction#commit() */ public void commit() { database.disassociateThread(); try { tx.commit(); } catch (HibernateException he) { throw new ODMGRuntimeException( he.getMessage() ); } catch (SQLException sqle) { throw new ODMGRuntimeException( sqle.getMessage() ); } finally { tx=null; try { session.close(); } catch (HibernateException he) { throw new ODMGRuntimeException( he.getMessage() ); } catch (SQLException sqle) { throw new ODMGRuntimeException( sqle.getMessage() ); } } } /** * Abort the transaction. * @see org.odmg.Transaction#abort() */ public void abort() { database.disassociateThread(); try { tx.rollback(); } catch (HibernateException he) { throw new ODMGRuntimeException( he.getMessage() ); } finally { tx=null; try { session.close(); } catch (HibernateException he) { throw new ODMGRuntimeException( he.getMessage() ); } catch (SQLException sqle) { throw new ODMGRuntimeException( sqle.getMessage() ); } } } /** * Commit the changes, but leave the transaction open. This implementation * does not have quite the same semantics os ODMG (locks are not retained). * So you should only use this with versioned data. * @see org.odmg.Transaction#checkpoint() */ public void checkpoint() { try { tx.commit(); tx = session.beginTransaction(); } catch (HibernateException he) { throw new ODMGRuntimeException( he.getMessage() ); } catch (SQLException sqle) { throw new ODMGRuntimeException( sqle.getMessage() ); } } /** * Obtain a lock upon the given object. In the present implementation, * <tt>READ</tt> lock mode is ignored while <tt>UPGRADE</tt> and * <tt>WRITE</tt> lock modes obtain an <tt>UPGRADE</tt> lock for databases * which support <tt>for update</tt>. We should improve this eventually.... * @see org.odmg.Transaction#lock(Object, int) */ public void lock(Object obj, int lockMode) throws LockNotGrantedException { //TODO: check the semantics of this... try { if ( lockMode==org.odmg.Transaction.READ ) { session.lock(obj, LockMode.READ); } else { session.lock(obj, LockMode.UPGRADE); } } catch (HibernateException he) { throw new ODMGRuntimeException( he.getMessage() ); } catch (SQLException sqle) { throw new ODMGRuntimeException( sqle.getMessage() ); } } /** * Not implemented. * @see org.odmg.Transaction#tryLock(Object, int) */ public boolean tryLock(Object obj, int lockMode) { throw new UnsupportedOperationException("try using lock()"); } } \ No newline at end of file --- 1,3 ---- ! //$Id$ package net.sf.hibernate.odmg; import java.sql.SQLException; import org.odmg.LockNotGrantedException; import org.odmg.ODMGException; import org.odmg.ODMGRuntimeException; import net.sf.hibernate.HibernateException; import net.sf.hibernate.LockMode; import net.sf.hibernate.Session; /** * Implements the ODMG <tt>Transaction</tt> API. */ public class Transaction implements org.odmg.Transaction { private final Database database; private final Session session; private net.sf.hibernate.Transaction tx; /** * Instantiate a <tt>Transaction</tt> for the given <tt>Database</tt>. */ public Transaction(org.odmg.Database database) throws ODMGException { this.database = (Database) database; try { this.session = this.database.getSessionFactory().openSession(); } catch (SQLException sqle) { throw new ODMGException( sqle.getMessage() ); } this.database.associateThread(this); } /** * Instantiate a <tt>Transaction</tt> for a <tt>Database</tt> created * by the current thread. */ public Transaction() throws ODMGException { this( Implementation.getInstance().currentDatabase() ); } /** * Get the underlying Hibernate <tt>Session</tt>. (Very useful!) */ public Session getSession() { return session; } /** * Associate the current thread with this <tt>Transaction</tt> and * disassociate the thread from any other <tt>Transaction</tt>. * @see org.odmg.Transaction#join() */ public void join() { //database.disassociateThread(); database.associateThread(this); } /** * Disassociate the thread the <tt>Transaction</tt>. * @see org.odmg.Transaction#leave() */ public void leave() { database.disassociateThread(); } /** * Begin the transaction. * @see org.odmg.Transaction#begin() */ public void begin() { try { tx = session.beginTransaction(); } catch (HibernateException he) { throw new ODMGRuntimeException( he.getMessage() ); } } /** * Is the transaction open? Returns true if <tt>begin()</tt> was called but * neither <tt>commit()</tt> nor <tt>abort()</tt> was called. * @see org.odmg.Transaction#isOpen() */ public boolean isOpen() { return tx==null; } /** * Commit the transaction. * @see org.odmg.Transaction#commit() */ public void commit() { database.disassociateThread(); try { tx.commit(); } catch (HibernateException he) { throw new ODMGRuntimeException( he.getMessage() ); } catch (SQLException sqle) { throw new ODMGRuntimeException( sqle.getMessage() ); } finally { tx=null; try { session.close(); } catch (HibernateException he) { throw new ODMGRuntimeException( he.getMessage() ); } catch (SQLException sqle) { throw new ODMGRuntimeException( sqle.getMessage() ); } } } /** * Abort the transaction. * @see org.odmg.Transaction#abort() */ public void abort() { database.disassociateThread(); try { tx.rollback(); } catch (HibernateException he) { throw new ODMGRuntimeException( he.getMessage() ); } finally { tx=null; try { session.close(); } catch (HibernateException he) { throw new ODMGRuntimeException( he.getMessage() ); } catch (SQLException sqle) { throw new ODMGRuntimeException( sqle.getMessage() ); } } } /** * Commit the changes, but leave the transaction open. This implementation * does not have quite the same semantics os ODMG (locks are not retained). * So you should only use this with versioned data. * @see org.odmg.Transaction#checkpoint() */ public void checkpoint() { try { tx.commit(); tx = session.beginTransaction(); } catch (HibernateException he) { throw new ODMGRuntimeException( he.getMessage() ); } catch (SQLException sqle) { throw new ODMGRuntimeException( sqle.getMessage() ); } } /** * Obtain a lock upon the given object. In the present implementation, * <tt>READ</tt> lock mode is ignored while <tt>UPGRADE</tt> and * <tt>WRITE</tt> lock modes obtain an <tt>UPGRADE</tt> lock for databases * which support <tt>for update</tt>. We should improve this eventually.... * @see org.odmg.Transaction#lock(Object, int) */ public void lock(Object obj, int lockMode) throws LockNotGrantedException { //TODO: check the semantics of this... try { if ( lockMode==org.odmg.Transaction.READ ) { session.lock(obj, LockMode.READ); } else { session.lock(obj, LockMode.UPGRADE); } } catch (HibernateException he) { throw new ODMGRuntimeException( he.getMessage() ); } catch (SQLException sqle) { throw new ODMGRuntimeException( sqle.getMessage() ); } } /** * Not implemented. * @see org.odmg.Transaction#tryLock(Object, int) */ public boolean tryLock(Object obj, int lockMode) { throw new UnsupportedOperationException("try using lock()"); } } ! ! |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl In directory sc8-pr-cvs1:/tmp/cvs-serv14211/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: reformatted code with beautiful, shiny, happy TABS! improved an exception Index: BatcherImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/BatcherImpl.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** BatcherImpl.java 1 Jan 2003 13:54:44 -0000 1.1.1.1 --- BatcherImpl.java 4 Jan 2003 11:15:28 -0000 1.2 *************** *** 26,35 **** protected final SessionImplementor session; protected final SessionFactoryImplementor factory; ! private PreparedStatement batchUpdate; private String batchUpdateSQL; ! private HashSet statementsToClose = new HashSet(); ! public BatcherImpl(SessionImplementor session) { this.session = session; --- 26,35 ---- protected final SessionImplementor session; protected final SessionFactoryImplementor factory; ! private PreparedStatement batchUpdate; private String batchUpdateSQL; ! private HashSet statementsToClose = new HashSet(); ! public BatcherImpl(SessionImplementor session) { this.session = session; *************** *** 40,44 **** return batchUpdate; } ! public PreparedStatement prepareStatement(String sql) throws SQLException, HibernateException { executeBatch(); --- 40,44 ---- return batchUpdate; } ! public PreparedStatement prepareStatement(String sql) throws SQLException, HibernateException { executeBatch(); *************** *** 49,57 **** logOpen(); PreparedStatement ps = factory.getPreparedStatement( session.connection(), sql, scrollable ); ! factory.setFetchSize(ps); statementsToClose.add(ps); return ps; } ! public void closeQueryStatement(PreparedStatement ps) throws SQLException { statementsToClose.remove(ps); --- 49,57 ---- logOpen(); PreparedStatement ps = factory.getPreparedStatement( session.connection(), sql, scrollable ); ! factory.setFetchSize(ps); statementsToClose.add(ps); return ps; } ! public void closeQueryStatement(PreparedStatement ps) throws SQLException { statementsToClose.remove(ps); *************** *** 59,68 **** factory.closePreparedStatement(ps); } ! public void closeStatement(PreparedStatement ps) throws SQLException { logClose(); factory.closePreparedStatement(ps); } ! public PreparedStatement prepareBatchStatement(String sql) throws SQLException, HibernateException { if ( !sql.equals(batchUpdateSQL) ) { --- 59,68 ---- factory.closePreparedStatement(ps); } ! public void closeStatement(PreparedStatement ps) throws SQLException { logClose(); factory.closePreparedStatement(ps); } ! public PreparedStatement prepareBatchStatement(String sql) throws SQLException, HibernateException { if ( !sql.equals(batchUpdateSQL) ) { *************** *** 72,76 **** return batchUpdate; } ! public void executeBatch() throws SQLException, HibernateException { if (batchUpdate!=null) { --- 72,76 ---- return batchUpdate; } ! public void executeBatch() throws SQLException, HibernateException { if (batchUpdate!=null) { *************** *** 86,90 **** } } ! public void closeStatements() { Iterator iter = statementsToClose.iterator(); --- 86,90 ---- } } ! public void closeStatements() { Iterator iter = statementsToClose.iterator(); *************** *** 101,105 **** statementsToClose.clear(); } ! protected abstract void doExecuteBatch(PreparedStatement ps) throws SQLException, HibernateException; --- 101,105 ---- statementsToClose.clear(); } ! protected abstract void doExecuteBatch(PreparedStatement ps) throws SQLException, HibernateException; *************** *** 112,117 **** private static void logClose() { ! if ( log.isTraceEnabled() ) ! open--; } } --- 112,120 ---- private static void logClose() { ! if ( log.isTraceEnabled() ) ! open--; } } + + + Index: BatchingBatcher.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/BatchingBatcher.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** BatchingBatcher.java 1 Jan 2003 13:54:44 -0000 1.1.1.1 --- BatchingBatcher.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 13,19 **** */ public class BatchingBatcher extends BatcherImpl { ! private int batchSize; ! public BatchingBatcher(SessionImplementor session) { super(session); --- 13,19 ---- */ public class BatchingBatcher extends BatcherImpl { ! private int batchSize; ! public BatchingBatcher(SessionImplementor session) { super(session); *************** *** 21,25 **** public void addToBatch(int expectedRowCount) throws SQLException, HibernateException { ! log.trace("Adding to batch"); PreparedStatement batchUpdate = getStatement(); --- 21,25 ---- public void addToBatch(int expectedRowCount) throws SQLException, HibernateException { ! log.trace("Adding to batch"); PreparedStatement batchUpdate = getStatement(); *************** *** 36,49 **** catch (HibernateException he) { closeStatement(batchUpdate); ! throw he; } } ! } protected void doExecuteBatch(PreparedStatement ps) throws SQLException, HibernateException { ! if ( log.isDebugEnabled() ) ! log.debug("Executing batch size: " + batchSize ); ! try { if (batchSize!=0) { --- 36,49 ---- catch (HibernateException he) { closeStatement(batchUpdate); ! throw he; } } ! } protected void doExecuteBatch(PreparedStatement ps) throws SQLException, HibernateException { ! if ( log.isDebugEnabled() ) ! log.debug("Executing batch size: " + batchSize ); ! try { if (batchSize!=0) { *************** *** 68,73 **** } } - } --- 68,76 ---- } } + + + + } Index: CacheEntry.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/CacheEntry.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** CacheEntry.java 1 Jan 2003 13:54:44 -0000 1.1.1.1 --- CacheEntry.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 27,32 **** } ! ! private Object[] disassemble(Object object, ClassPersister persister, SessionImplementor session) throws HibernateException { Object[] values = persister.getPropertyValues(object); Type[] propertyTypes = persister.getPropertyTypes(); --- 27,32 ---- } ! ! private Object[] disassemble(Object object, ClassPersister persister, SessionImplementor session) throws HibernateException { Object[] values = persister.getPropertyValues(object); Type[] propertyTypes = persister.getPropertyTypes(); *************** *** 35,50 **** } return values; ! } ! 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"); ! return assemble(state, instance, id, persister, session); ! } ! ! 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]; --- 35,50 ---- } return values; ! } ! 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"); ! return assemble(state, instance, id, persister, session); ! } ! ! 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]; *************** *** 60,65 **** return assembledProps; ! } - } --- 60,68 ---- return assembledProps; ! } ! } + + + Index: DatastoreImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/DatastoreImpl.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** DatastoreImpl.java 1 Jan 2003 13:55:45 -0000 1.1.1.1 --- DatastoreImpl.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 30,34 **** import net.sf.hibernate.dialect.Dialect; ! /** * NOT threadsafe */ --- 30,34 ---- import net.sf.hibernate.dialect.Dialect; ! /** * NOT threadsafe */ *************** *** 49,53 **** return ( (Collection) collections.get(role) ).getKey().getType(); } ! public Iterator getClassMaps() { return classes.values().iterator(); --- 49,53 ---- return ( (Collection) collections.get(role) ).getKey().getType(); } ! public Iterator getClassMaps() { return classes.values().iterator(); *************** *** 57,65 **** return collections.values().iterator(); } ! ! public Iterator getTableMaps() { ! return tables.values().iterator(); } ! public PersistentClass getPersistentClass(Class persistentClass) { return (PersistentClass) classes.get(persistentClass); --- 57,65 ---- return collections.values().iterator(); } ! ! public Iterator getTableMaps() { ! return tables.values().iterator(); } ! public PersistentClass getPersistentClass(Class persistentClass) { return (PersistentClass) classes.get(persistentClass); *************** *** 74,81 **** log.error("Could not configure datastore from file: " + xmlFile, e); throw new MappingException(e); ! } return this; } ! public Datastore storeXML(String xml) throws MappingException { if ( log.isDebugEnabled() ) log.debug("Mapping XML:\n" + xml); --- 74,81 ---- log.error("Could not configure datastore from file: " + xmlFile, e); throw new MappingException(e); ! } return this; } ! public Datastore storeXML(String xml) throws MappingException { if ( log.isDebugEnabled() ) log.debug("Mapping XML:\n" + xml); *************** *** 86,90 **** log.error("Could not configure datastore from XML", e); throw new MappingException(e); ! } return this; } --- 86,90 ---- log.error("Could not configure datastore from XML", e); throw new MappingException(e); ! } return this; } *************** *** 98,102 **** log.error("Could not configure datastore from XML document", e); throw new MappingException(e); ! } return this; } --- 98,102 ---- log.error("Could not configure datastore from XML document", e); throw new MappingException(e); ! } return this; } *************** *** 132,136 **** return storeInputStream(rsrc); } ! public Datastore storeClass(Class persistentClass) throws MappingException { String fileName = persistentClass.getName().replace('.','/') + ".hbm.xml"; --- 132,136 ---- return storeInputStream(rsrc); } ! public Datastore storeClass(Class persistentClass) throws MappingException { String fileName = persistentClass.getName().replace('.','/') + ".hbm.xml"; *************** *** 166,170 **** log.info( "Found mapping documents in jar: " + z.getName() ); try { ! storeInputStream( jarFile.getInputStream(z) ); } catch (MappingException me) { --- 166,170 ---- log.info( "Found mapping documents in jar: " + z.getName() ); try { ! storeInputStream( jarFile.getInputStream(z) ); } catch (MappingException me) { *************** *** 179,183 **** return this; ! } --- 179,183 ---- return this; ! } *************** *** 189,201 **** if ( dialect.dropConstraints() ) { ! Iterator iter = getTableMaps(); ! while ( iter.hasNext() ) { ! Table table = (Table)iter.next(); ! Iterator subIter = table.foreignKeyIterator(); ! while ( subIter.hasNext() ) { ! ForeignKey fk = (ForeignKey)subIter.next(); ! script.add(fk.sqlDropString(dialect)); ! } ! } } --- 189,201 ---- if ( dialect.dropConstraints() ) { ! Iterator iter = getTableMaps(); ! while ( iter.hasNext() ) { ! Table table = (Table)iter.next(); ! Iterator subIter = table.foreignKeyIterator(); ! while ( subIter.hasNext() ) { ! ForeignKey fk = (ForeignKey)subIter.next(); ! script.add(fk.sqlDropString(dialect)); ! } ! } } *************** *** 208,218 **** if (dropString!=null) script.add(dropString); } ! ! return ArrayHelper.toStringArray(script); } ! public String[] generateSchemaCreationScript(Dialect dialect) throws HibernateException { secondPassCompile(); ! ArrayList script = new ArrayList(50); --- 208,218 ---- if (dropString!=null) script.add(dropString); } ! ! return ArrayHelper.toStringArray(script); } ! public String[] generateSchemaCreationScript(Dialect dialect) throws HibernateException { secondPassCompile(); ! ArrayList script = new ArrayList(50); *************** *** 223,248 **** } ! iter = getTableMaps(); ! while ( iter.hasNext() ) { ! Table table = (Table) iter.next(); ! Iterator subIter; ! ! if ( dialect.hasAlterTable() ) { ! subIter = table.foreignKeyIterator(); ! while ( subIter.hasNext() ) { ! ForeignKey fk = (ForeignKey) subIter.next(); ! script.add( fk.sqlCreateString(dialect, this) ); ! } ! } ! ! subIter = table.indexIterator(); ! while ( subIter.hasNext() ) { ! Index index = (Index) subIter.next(); ! script.add( index.sqlCreateString(dialect, this) ); ! } ! } iter = generators.values().iterator(); ! while ( iter.hasNext() ) { String[] lines = ( (PersistentIdentifierGenerator) iter.next() ).sqlCreateStrings(dialect); --- 223,248 ---- } ! iter = getTableMaps(); ! while ( iter.hasNext() ) { ! Table table = (Table) iter.next(); ! Iterator subIter; ! ! if ( dialect.hasAlterTable() ) { ! subIter = table.foreignKeyIterator(); ! while ( subIter.hasNext() ) { ! ForeignKey fk = (ForeignKey) subIter.next(); ! script.add( fk.sqlCreateString(dialect, this) ); ! } ! } ! ! subIter = table.indexIterator(); ! while ( subIter.hasNext() ) { ! Index index = (Index) subIter.next(); ! script.add( index.sqlCreateString(dialect, this) ); ! } ! } iter = generators.values().iterator(); ! while ( iter.hasNext() ) { String[] lines = ( (PersistentIdentifierGenerator) iter.next() ).sqlCreateStrings(dialect); *************** *** 252,308 **** return ArrayHelper.toStringArray(script); } ! ! public String[] generateSchemaUpdateScript(Dialect dialect, JdbcDatabaseInfo databaseInfo) throws HibernateException { ! secondPassCompile(); ! ! ArrayList script = new ArrayList(50); ! ! Iterator iter = getTableMaps(); ! while ( iter.hasNext() ) { ! Table table = (Table) iter.next(); ! JdbcTableInfo tableInfo = databaseInfo.getTableInfo(table.getName()); ! if (tableInfo == null) { ! script.add( table.sqlCreateString(dialect, this) ); ! } ! else { ! final String sql = table.sqlAlterString(dialect, this, tableInfo); ! if (sql != null) script.add(sql); ! } ! } ! ! iter = getTableMaps(); ! while (iter.hasNext()) { ! Table table = (Table)iter.next(); ! JdbcTableInfo tableInfo = databaseInfo.getTableInfo(table.getName()); ! Iterator subIter; ! ! if (dialect.hasAlterTable()) { ! subIter = table.foreignKeyIterator(); ! while (subIter.hasNext()) { ! ForeignKey fk = (ForeignKey)subIter.next(); ! if (tableInfo == null || tableInfo.getForeignKeyInfo(fk.getName())==null) ! script.add(fk.sqlCreateString(dialect, this)); ! } ! } ! ! subIter = table.indexIterator(); ! while (subIter.hasNext()) { ! Index index = (Index)subIter.next(); ! if (tableInfo == null || tableInfo.getIndexInfo(index.getName())==null) ! script.add(index.sqlCreateString(dialect, this)); ! } ! } ! ! iter = generators.values().iterator(); ! while (iter.hasNext()) { ! PersistentIdentifierGenerator generator = (PersistentIdentifierGenerator)iter.next(); ! if (!databaseInfo.isSequence(generator.generatorKey())) { ! String[] lines = generator.sqlCreateStrings(dialect); ! for (int i = 0; i < lines.length; i++) script.add(lines[i]); ! } ! } ! ! return ArrayHelper.toStringArray(script); ! } // This method may be called many times!! private void secondPassCompile() throws MappingException { --- 252,308 ---- return ArrayHelper.toStringArray(script); } ! ! public String[] generateSchemaUpdateScript(Dialect dialect, JdbcDatabaseInfo databaseInfo) throws HibernateException { ! secondPassCompile(); ! ! ArrayList script = new ArrayList(50); ! ! Iterator iter = getTableMaps(); ! while ( iter.hasNext() ) { ! Table table = (Table) iter.next(); ! JdbcTableInfo tableInfo = databaseInfo.getTableInfo(table.getName()); ! if (tableInfo == null) { ! script.add( table.sqlCreateString(dialect, this) ); ! } ! else { ! final String sql = table.sqlAlterString(dialect, this, tableInfo); ! if (sql != null) script.add(sql); ! } ! } ! ! iter = getTableMaps(); ! while (iter.hasNext()) { ! Table table = (Table)iter.next(); ! JdbcTableInfo tableInfo = databaseInfo.getTableInfo(table.getName()); ! Iterator subIter; ! ! if (dialect.hasAlterTable()) { ! subIter = table.foreignKeyIterator(); ! while (subIter.hasNext()) { ! ForeignKey fk = (ForeignKey)subIter.next(); ! if (tableInfo == null || tableInfo.getForeignKeyInfo(fk.getName())==null) ! script.add(fk.sqlCreateString(dialect, this)); ! } ! } ! ! subIter = table.indexIterator(); ! while (subIter.hasNext()) { ! Index index = (Index)subIter.next(); ! if (tableInfo == null || tableInfo.getIndexInfo(index.getName())==null) ! script.add(index.sqlCreateString(dialect, this)); ! } ! } ! ! iter = generators.values().iterator(); ! while (iter.hasNext()) { ! PersistentIdentifierGenerator generator = (PersistentIdentifierGenerator)iter.next(); ! if (!databaseInfo.isSequence(generator.generatorKey())) { ! String[] lines = generator.sqlCreateStrings(dialect); ! for (int i = 0; i < lines.length; i++) script.add(lines[i]); ! } ! } ! ! return ArrayHelper.toStringArray(script); ! } // This method may be called many times!! private void secondPassCompile() throws MappingException { *************** *** 315,330 **** //TODO: Somehow add the newly created foreign keys to the internal collection ! iter = getTableMaps(); while ( iter.hasNext() ) { ! Table table = (Table)iter.next(); ! Iterator subIter = table.foreignKeyIterator(); ! while (subIter.hasNext()) { ! ForeignKey fk = (ForeignKey)subIter.next(); ! if (fk.getReferencedTable() == null) { ! PersistentClass referencedClass = (PersistentClass)classes.get(fk.getReferencedClass()); ! if (referencedClass == null) ! throw new MappingException("An association refers to an unmapped class: " + fk.getReferencedClass().getName()); ! fk.setReferencedTable(referencedClass.getTable()); ! } } } --- 315,330 ---- //TODO: Somehow add the newly created foreign keys to the internal collection ! iter = getTableMaps(); while ( iter.hasNext() ) { ! Table table = (Table)iter.next(); ! Iterator subIter = table.foreignKeyIterator(); ! while (subIter.hasNext()) { ! ForeignKey fk = (ForeignKey)subIter.next(); ! if (fk.getReferencedTable() == null) { ! PersistentClass referencedClass = (PersistentClass)classes.get(fk.getReferencedClass()); ! if (referencedClass == null) ! throw new MappingException("An association refers to an unmapped class: " + fk.getReferencedClass().getName()); ! fk.setReferencedTable(referencedClass.getTable()); ! } } } *************** *** 343,347 **** public void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) { } ! /** * @see net.sf.hibernate.Interceptor#onFlushDirty(Object, Object[], Object[], String[], Type[]) --- 343,347 ---- public void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) { } ! /** * @see net.sf.hibernate.Interceptor#onFlushDirty(Object, Object[], Object[], String[], Type[]) *************** *** 350,354 **** return false; } ! /** * @see net.sf.hibernate.Interceptor#onLoad(Object, Object[], String[], Type[]) --- 350,354 ---- return false; } ! /** * @see net.sf.hibernate.Interceptor#onLoad(Object, Object[], String[], Type[]) *************** *** 357,361 **** return false; } ! /** * @see net.sf.hibernate.Interceptor#onSave(Object, Object[], String[], Type[]) --- 357,361 ---- return false; } ! /** * @see net.sf.hibernate.Interceptor#onSave(Object, Object[], String[], Type[]) *************** *** 364,368 **** return false; } ! /** * @see net.sf.hibernate.Interceptor#onPostFlush(Object, Serializable, Object[], String[], Type[]) --- 364,368 ---- return false; } ! /** * @see net.sf.hibernate.Interceptor#onPostFlush(Object, Serializable, Object[], String[], Type[]) *************** *** 370,374 **** public void onPostFlush(Object entity, Serializable id, Object[] currentState, String[] propertyNames, Type[] types) { } ! /** * @see net.sf.hibernate.Interceptor#postFlush(Iterator) --- 370,374 ---- public void onPostFlush(Object entity, Serializable id, Object[] currentState, String[] propertyNames, Type[] types) { } ! /** * @see net.sf.hibernate.Interceptor#postFlush(Iterator) *************** *** 376,380 **** public void postFlush(Iterator entities) { } ! /** * @see net.sf.hibernate.Interceptor#preFlush(Iterator) --- 376,380 ---- public void postFlush(Iterator entities) { } ! /** * @see net.sf.hibernate.Interceptor#preFlush(Iterator) *************** *** 382,386 **** public void preFlush(Iterator entities) { } ! } --- 382,386 ---- public void preFlush(Iterator entities) { } ! } *************** *** 397,401 **** return new SessionFactoryImpl(this, Environment.getProperties(), interceptor); } ! public SessionFactory buildSessionFactory(Properties connectionProps, Interceptor interceptor) throws HibernateException { secondPassCompile(); --- 397,401 ---- return new SessionFactoryImpl(this, Environment.getProperties(), interceptor); } ! public SessionFactory buildSessionFactory(Properties connectionProps, Interceptor interceptor) throws HibernateException { secondPassCompile(); *************** *** 403,406 **** return new SessionFactoryImpl(this, connectionProps, interceptor); } ! } --- 403,409 ---- return new SessionFactoryImpl(this, connectionProps, interceptor); } ! } + + + Index: FilterImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/FilterImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FilterImpl.java 3 Jan 2003 13:36:01 -0000 1.2 --- FilterImpl.java 4 Jan 2003 11:15:29 -0000 1.3 *************** *** 16,20 **** private Object collection; ! public FilterImpl(String queryString, Object collection, SessionImplementor session) { super(queryString, session); --- 16,20 ---- private Object collection; ! public FilterImpl(String queryString, Object collection, SessionImplementor session) { super(queryString, session); *************** *** 22,26 **** } ! /** * @see net.sf.hibernate.Query#iterate() --- 22,26 ---- } ! /** * @see net.sf.hibernate.Query#iterate() *************** *** 31,35 **** return getSession().iterateFilter(collection, getQueryString(), getValues().toArray(), (Type[]) getTypes().toArray(NO_TYPES), getSelection(), getNamedParams() ); } ! /** * @see net.sf.hibernate.Query#list() --- 31,35 ---- return getSession().iterateFilter(collection, getQueryString(), getValues().toArray(), (Type[]) getTypes().toArray(NO_TYPES), getSelection(), getNamedParams() ); } ! /** * @see net.sf.hibernate.Query#list() *************** *** 40,44 **** return getSession().filter(collection, getQueryString(), getValues().toArray(), (Type[]) getTypes().toArray(NO_TYPES), getSelection(), getNamedParams() ); } ! /** * @see net.sf.hibernate.Query#scroll() --- 40,44 ---- return getSession().filter(collection, getQueryString(), getValues().toArray(), (Type[]) getTypes().toArray(NO_TYPES), getSelection(), getNamedParams() ); } ! /** * @see net.sf.hibernate.Query#scroll() *************** *** 47,50 **** throw new UnsupportedOperationException("Can't scroll filters"); } ! } --- 47,53 ---- throw new UnsupportedOperationException("Can't scroll filters"); } ! } + + + Index: IteratorImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/IteratorImpl.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** IteratorImpl.java 1 Jan 2003 13:55:45 -0000 1.1.1.1 --- IteratorImpl.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 16,22 **** public final class IteratorImpl implements Iterator { ! private static final Log log = LogFactory.getLog(IteratorImpl.class); ! private final ResultSet rs; private final SessionImplementor sess; --- 16,22 ---- public final class IteratorImpl implements Iterator { ! private static final Log log = LogFactory.getLog(IteratorImpl.class); ! private final ResultSet rs; private final SessionImplementor sess; *************** *** 28,34 **** private final String[][] names; ! public IteratorImpl(ResultSet rs, SessionImplementor sess, Type[] types, String[][] columnNames) ! throws HibernateException, SQLException { ! this.rs=rs; this.sess = sess; --- 28,34 ---- private final String[][] names; ! public IteratorImpl(ResultSet rs, SessionImplementor sess, Type[] types, String[][] columnNames) ! throws HibernateException, SQLException { ! this.rs=rs; this.sess = sess; *************** *** 36,40 **** this.names = columnNames; ! single = types.length==1; postNext( rs.next() ); --- 36,40 ---- this.names = columnNames; ! single = types.length==1; postNext( rs.next() ); *************** *** 54,62 **** } } ! public boolean hasNext() { return hasNext; } ! public Object next() { if ( nextResults==null ) throw new NoSuchElementException("No more results"); --- 54,62 ---- } } ! public boolean hasNext() { return hasNext; } ! public Object next() { if ( nextResults==null ) throw new NoSuchElementException("No more results"); *************** *** 76,80 **** } } ! public void remove() { if (!single) throw new UnsupportedOperationException("Not a single column hibernate query result set"); --- 76,80 ---- } } ! public void remove() { if (!single) throw new UnsupportedOperationException("Not a single column hibernate query result set"); *************** *** 86,92 **** log.error("could not remove", sqle); throw new LazyInitializationException(sqle); ! } } ! } --- 86,95 ---- log.error("could not remove", sqle); throw new LazyInitializationException(sqle); ! } } ! } + + + Index: NonBatchingBatcher.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/NonBatchingBatcher.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** NonBatchingBatcher.java 1 Jan 2003 13:55:45 -0000 1.1.1.1 --- NonBatchingBatcher.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 16,29 **** super(session); } ! public void addToBatch(int expectedRowCount) throws SQLException, HibernateException { int rowCount = getStatement().executeUpdate(); //negative expected row count means we don't know how many rows to expect ! if ( expectedRowCount>0 && expectedRowCount!=rowCount ) ! throw new HibernateException("SQL update or deletion failed (row not found)"); } protected void doExecuteBatch(PreparedStatement ps) throws SQLException, HibernateException { } ! } --- 16,32 ---- super(session); } ! public void addToBatch(int expectedRowCount) throws SQLException, HibernateException { int rowCount = getStatement().executeUpdate(); //negative expected row count means we don't know how many rows to expect ! if ( expectedRowCount>0 && expectedRowCount!=rowCount ) ! throw new HibernateException("SQL update or deletion failed (row not found)"); } protected void doExecuteBatch(PreparedStatement ps) throws SQLException, HibernateException { } ! } + + + Index: QueryImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/QueryImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** QueryImpl.java 3 Jan 2003 13:36:01 -0000 1.2 --- QueryImpl.java 4 Jan 2003 11:15:29 -0000 1.3 *************** *** 34,38 **** private final SessionImplementor session; private String queryString; ! private RowSelection selection; private ArrayList values = new ArrayList(4); --- 34,38 ---- private final SessionImplementor session; private String queryString; ! private RowSelection selection; private ArrayList values = new ArrayList(4); *************** *** 51,63 **** return session.iterate(queryString, values.toArray(), (Type[]) types.toArray(NO_TYPES), selection, namedParams); } ! public ScrollableResults scroll() throws SQLException, HibernateException { return session.scroll(queryString, values.toArray(), (Type[]) types.toArray(NO_TYPES), selection, namedParams); } ! public List list() throws SQLException, HibernateException { return session.find(queryString, values.toArray(), (Type[]) types.toArray(NO_TYPES), selection, namedParams); } ! public void setMaxResults(int maxResults) { selection.setMaxRows(new Integer(maxResults)); --- 51,63 ---- return session.iterate(queryString, values.toArray(), (Type[]) types.toArray(NO_TYPES), selection, namedParams); } ! public ScrollableResults scroll() throws SQLException, HibernateException { return session.scroll(queryString, values.toArray(), (Type[]) types.toArray(NO_TYPES), selection, namedParams); } ! public List list() throws SQLException, HibernateException { return session.find(queryString, values.toArray(), (Type[]) types.toArray(NO_TYPES), selection, namedParams); } ! public void setMaxResults(int maxResults) { selection.setMaxRows(new Integer(maxResults)); *************** *** 67,75 **** selection.setTimeout(new Integer(timeout)); } ! public void setFirstResult(int firstResult) { selection.setFirstRow(new Integer(firstResult)); } ! public void setParameter(int position, Object val, Type type) { int size = values.size(); --- 67,75 ---- selection.setTimeout(new Integer(timeout)); } ! public void setFirstResult(int firstResult) { selection.setFirstRow(new Integer(firstResult)); } ! public void setParameter(int position, Object val, Type type) { int size = values.size(); *************** *** 87,159 **** } } ! public void setString(int position, String val) { setParameter(position, val, Hibernate.STRING); } ! public void setCharacter(int position, char val) { setParameter(position, new Character(val), Hibernate.CHARACTER); } ! public void setBoolean(int position, boolean val) { setParameter(position, new Boolean(val), Hibernate.BOOLEAN); } ! public void setByte(int position, byte val) { setParameter(position, new Byte(val), Hibernate.BYTE); } ! public void setShort(int position, short val) { setParameter(position, new Short(val), Hibernate.SHORT); } ! public void setInteger(int position, int val) { setParameter(position, new Integer(val), Hibernate.INTEGER); } ! public void setLong(int position, long val) { setParameter(position, new Long(val), Hibernate.LONG); } ! public void setFloat(int position, float val) { setParameter(position, new Float(val), Hibernate.FLOAT); } ! public void setDouble(int position, double val) { setParameter(position, new Double(val), Hibernate.DOUBLE); } ! public void setBinary(int position, byte[] val) { setParameter(position, val, Hibernate.BINARY); } ! public void setSerializable(int position, Serializable val) { setParameter(position, val, Hibernate.SERIALIZABLE); } ! public void setDate(int position, Date date) { setParameter(position, date, Hibernate.DATE); } ! public void setTime(int position, Date date) { setParameter(position, date, Hibernate.TIME); } ! public void setTimestamp(int position, Date date) { setParameter(position, date, Hibernate.TIMESTAMP); } ! public void setEntity(int position, Object val) { setParameter( position, val, Hibernate.association( val.getClass() ) ); } ! public void setEnum(int position, Object val) throws MappingException { setParameter( position, val, Hibernate.enum( val.getClass() ) ); } ! public void setLocale(int position, Locale locale) { setParameter(position, locale, Hibernate.LOCALE); } ! public void setCalendar(int position, Calendar calendar) { setParameter(position, calendar, Hibernate.CALENDAR); --- 87,159 ---- } } ! public void setString(int position, String val) { setParameter(position, val, Hibernate.STRING); } ! public void setCharacter(int position, char val) { setParameter(position, new Character(val), Hibernate.CHARACTER); } ! public void setBoolean(int position, boolean val) { setParameter(position, new Boolean(val), Hibernate.BOOLEAN); } ! public void setByte(int position, byte val) { setParameter(position, new Byte(val), Hibernate.BYTE); } ! public void setShort(int position, short val) { setParameter(position, new Short(val), Hibernate.SHORT); } ! public void setInteger(int position, int val) { setParameter(position, new Integer(val), Hibernate.INTEGER); } ! public void setLong(int position, long val) { setParameter(position, new Long(val), Hibernate.LONG); } ! public void setFloat(int position, float val) { setParameter(position, new Float(val), Hibernate.FLOAT); } ! public void setDouble(int position, double val) { setParameter(position, new Double(val), Hibernate.DOUBLE); } ! public void setBinary(int position, byte[] val) { setParameter(position, val, Hibernate.BINARY); } ! public void setSerializable(int position, Serializable val) { setParameter(position, val, Hibernate.SERIALIZABLE); } ! public void setDate(int position, Date date) { setParameter(position, date, Hibernate.DATE); } ! public void setTime(int position, Date date) { setParameter(position, date, Hibernate.TIME); } ! public void setTimestamp(int position, Date date) { setParameter(position, date, Hibernate.TIMESTAMP); } ! public void setEntity(int position, Object val) { setParameter( position, val, Hibernate.association( val.getClass() ) ); } ! public void setEnum(int position, Object val) throws MappingException { setParameter( position, val, Hibernate.enum( val.getClass() ) ); } ! public void setLocale(int position, Locale locale) { setParameter(position, locale, Hibernate.LOCALE); } ! public void setCalendar(int position, Calendar calendar) { setParameter(position, calendar, Hibernate.CALENDAR); *************** *** 163,167 **** setParameter(position, calendar, Hibernate.CALENDAR_DATE); } ! public void setBinary(String name, byte[] val) { setParameter(name, val, Hibernate.BINARY); --- 163,167 ---- setParameter(position, calendar, Hibernate.CALENDAR_DATE); } ! public void setBinary(String name, byte[] val) { setParameter(name, val, Hibernate.BINARY); *************** *** 171,211 **** setParameter(name, new Boolean(val), Hibernate.BOOLEAN); } ! public void setByte(String name, byte val) { setParameter(name, new Byte(val), Hibernate.BYTE); } ! public void setCharacter(String name, char val) { setParameter(name, new Character(val), Hibernate.CHARACTER); } ! public void setDate(String name, Date date) { setParameter(name, date, Hibernate.DATE); } ! public void setDouble(String name, double val) { setParameter(name, new Double(val), Hibernate.DOUBLE); } ! public void setEntity(String name, Object val) { setParameter( name, val, Hibernate.association( val.getClass() ) ); } ! public void setEnum(String name, Object val) throws MappingException { setParameter( name, val, Hibernate.enum( val.getClass() ) ); } ! public void setFloat(String name, float val) { setParameter(name, new Float(val), Hibernate.FLOAT); } ! public void setInteger(String name, int val) { setParameter(name, new Integer(val), Hibernate.INTEGER); } ! public void setLocale(String name, Locale locale) { setParameter(name, locale, Hibernate.LOCALE); } ! public void setCalendar(String name, Calendar calendar) { setParameter(name, calendar, Hibernate.CALENDAR); --- 171,211 ---- setParameter(name, new Boolean(val), Hibernate.BOOLEAN); } ! public void setByte(String name, byte val) { setParameter(name, new Byte(val), Hibernate.BYTE); } ! public void setCharacter(String name, char val) { setParameter(name, new Character(val), Hibernate.CHARACTER); } ! public void setDate(String name, Date date) { setParameter(name, date, Hibernate.DATE); } ! public void setDouble(String name, double val) { setParameter(name, new Double(val), Hibernate.DOUBLE); } ! public void setEntity(String name, Object val) { setParameter( name, val, Hibernate.association( val.getClass() ) ); } ! public void setEnum(String name, Object val) throws MappingException { setParameter( name, val, Hibernate.enum( val.getClass() ) ); } ! public void setFloat(String name, float val) { setParameter(name, new Float(val), Hibernate.FLOAT); } ! public void setInteger(String name, int val) { setParameter(name, new Integer(val), Hibernate.INTEGER); } ! public void setLocale(String name, Locale locale) { setParameter(name, locale, Hibernate.LOCALE); } ! public void setCalendar(String name, Calendar calendar) { setParameter(name, calendar, Hibernate.CALENDAR); *************** *** 215,259 **** setParameter(name, calendar, Hibernate.CALENDAR_DATE); } ! public void setLong(String name, long val) { setParameter(name, new Long(val), Hibernate.LONG); } ! public void setParameter(String name, Object val, Type type) { namedParams.put(name, new TypedValue(type, val) ); } ! public void setSerializable(String name, Serializable val) { setParameter(name, val, Hibernate.SERIALIZABLE); } ! public void setShort(String name, short val) { setParameter(name, new Short(val), Hibernate.SHORT); } ! public void setString(String name, String val) { setParameter(name, val, Hibernate.STRING); } ! public void setTime(String name, Date date) { setParameter(name, date, Hibernate.TIME); } ! public void setTimestamp(String name, Date date) { setParameter(name, date, Hibernate.TIMESTAMP); } ! public void setBigDecimal(int position, BigDecimal number) { setParameter(position, number, Hibernate.BIG_DECIMAL); } ! public void setBigDecimal(String name, BigDecimal number) { setParameter(name, number, Hibernate.BIG_DECIMAL); } ! public void setParameter(int position, Object val) throws HibernateException { setParameter( position, val, guessType(val) ); } ! public void setParameter(String name, Object val) throws HibernateException { setParameter( name, val, guessType(val) ); --- 215,259 ---- setParameter(name, calendar, Hibernate.CALENDAR_DATE); } ! public void setLong(String name, long val) { setParameter(name, new Long(val), Hibernate.LONG); } ! public void setParameter(String name, Object val, Type type) { namedParams.put(name, new TypedValue(type, val) ); } ! public void setSerializable(String name, Serializable val) { setParameter(name, val, Hibernate.SERIALIZABLE); } ! public void setShort(String name, short val) { setParameter(name, new Short(val), Hibernate.SHORT); } ! public void setString(String name, String val) { setParameter(name, val, Hibernate.STRING); } ! public void setTime(String name, Date date) { setParameter(name, date, Hibernate.TIME); } ! public void setTimestamp(String name, Date date) { setParameter(name, date, Hibernate.TIMESTAMP); } ! public void setBigDecimal(int position, BigDecimal number) { setParameter(position, number, Hibernate.BIG_DECIMAL); } ! public void setBigDecimal(String name, BigDecimal number) { setParameter(name, number, Hibernate.BIG_DECIMAL); } ! public void setParameter(int position, Object val) throws HibernateException { setParameter( position, val, guessType(val) ); } ! public void setParameter(String name, Object val) throws HibernateException { setParameter( name, val, guessType(val) ); *************** *** 280,290 **** } ! public Type[] getReturnTypes() throws HibernateException { return session.getFactory().getReturnTypes(queryString); } ! public void setParameterList(String name, Collection vals, Type type) throws HibernateException { ! StringBuffer list = new StringBuffer(16); Iterator iter = vals.iterator(); --- 280,290 ---- } ! public Type[] getReturnTypes() throws HibernateException { return session.getFactory().getReturnTypes(queryString); } ! public void setParameterList(String name, Collection vals, Type type) throws HibernateException { ! StringBuffer list = new StringBuffer(16); Iterator iter = vals.iterator(); *************** *** 298,302 **** queryString = StringHelper.replaceOnce( queryString, ':' + name, list.toString() ); } ! public void setParameterList(String name, Collection vals) throws HibernateException { setParameterList(name, vals, guessType( vals.iterator().next() ) ); --- 298,302 ---- queryString = StringHelper.replaceOnce( queryString, ':' + name, list.toString() ); } ! public void setParameterList(String name, Collection vals) throws HibernateException { setParameterList(name, vals, guessType( vals.iterator().next() ) ); *************** *** 319,346 **** } } ! SessionImplementor getSession() { return session; } ! ArrayList getValues() { return values; } ! ArrayList getTypes() { return types; } ! RowSelection getSelection() { return selection; } ! String getQueryString() { return queryString; } ! Map getNamedParams() { return namedParams; } ! } --- 319,349 ---- } } ! SessionImplementor getSession() { return session; } ! ArrayList getValues() { return values; } ! ArrayList getTypes() { return types; } ! RowSelection getSelection() { return selection; } ! String getQueryString() { return queryString; } ! Map getNamedParams() { return namedParams; } ! } + + + Index: ScheduledCollectionAction.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScheduledCollectionAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ScheduledCollectionAction.java 3 Jan 2003 13:36:01 -0000 1.2 --- ScheduledCollectionAction.java 4 Jan 2003 11:15:29 -0000 1.3 *************** *** 37,40 **** return id.hashCode(); }*/ ! } --- 37,43 ---- return id.hashCode(); }*/ ! } + + + Index: ScheduledCollectionRecreate.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScheduledCollectionRecreate.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ScheduledCollectionRecreate.java 3 Jan 2003 13:36:01 -0000 1.2 --- ScheduledCollectionRecreate.java 4 Jan 2003 11:15:29 -0000 1.3 *************** *** 10,14 **** final class ScheduledCollectionRecreate extends ScheduledCollectionAction implements SessionImpl.Executable { ! private final PersistentCollection collection; --- 10,14 ---- final class ScheduledCollectionRecreate extends ScheduledCollectionAction implements SessionImpl.Executable { ! private final PersistentCollection collection; *************** *** 22,26 **** persister.recreate(collection, id, session); } ! } --- 22,29 ---- persister.recreate(collection, id, session); } ! } + + + Index: ScheduledCollectionRemove.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScheduledCollectionRemove.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ScheduledCollectionRemove.java 3 Jan 2003 13:36:01 -0000 1.2 --- ScheduledCollectionRemove.java 4 Jan 2003 11:15:29 -0000 1.3 *************** *** 18,23 **** persister.remove(id, session); } ! } --- 18,26 ---- persister.remove(id, session); } ! } + + + Index: ScheduledCollectionUpdate.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScheduledCollectionUpdate.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ScheduledCollectionUpdate.java 3 Jan 2003 13:36:01 -0000 1.2 --- ScheduledCollectionUpdate.java 4 Jan 2003 11:15:29 -0000 1.3 *************** *** 10,14 **** final class ScheduledCollectionUpdate extends ScheduledCollectionAction implements SessionImpl.Executable { ! private final PersistentCollection collection; --- 10,14 ---- final class ScheduledCollectionUpdate extends ScheduledCollectionAction implements SessionImpl.Executable { ! private final PersistentCollection collection; *************** *** 35,37 **** --- 35,40 ---- } + + + Index: ScheduledDeletion.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScheduledDeletion.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ScheduledDeletion.java 1 Jan 2003 13:55:49 -0000 1.1.1.1 --- ScheduledDeletion.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 23,31 **** session.postDelete(instance); } ! public void afterTransactionCompletion() throws CacheException { if ( persister.hasCache() ) persister.getCache().release(id); } ! } --- 23,34 ---- session.postDelete(instance); } ! public void afterTransactionCompletion() throws CacheException { if ( persister.hasCache() ) persister.getCache().release(id); } ! } + + + Index: ScheduledEntityAction.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScheduledEntityAction.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ScheduledEntityAction.java 1 Jan 2003 13:55:49 -0000 1.1.1.1 --- ScheduledEntityAction.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 10,14 **** public abstract class ScheduledEntityAction implements Executable { ! protected final SessionImplementor session; protected final Serializable id; --- 10,14 ---- public abstract class ScheduledEntityAction implements Executable { ! protected final SessionImplementor session; protected final Serializable id; *************** *** 24,28 **** this.instance = instance; } ! public final Serializable[] getPropertySpaces() { return persister.getPropertySpaces(instance); --- 24,28 ---- this.instance = instance; } ! public final Serializable[] getPropertySpaces() { return persister.getPropertySpaces(instance); *************** *** 37,40 **** return id.hashCode(); }*/ ! } --- 37,43 ---- return id.hashCode(); }*/ ! } + + + Index: ScheduledInsertion.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScheduledInsertion.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ScheduledInsertion.java 1 Jan 2003 13:55:49 -0000 1.1.1.1 --- ScheduledInsertion.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 11,30 **** final class ScheduledInsertion extends ScheduledEntityAction implements SessionImpl.Executable{ private final Object[] state; ! public ScheduledInsertion(Serializable id, Object[] state, Object instance, ClassPersister persister, SessionImplementor session) { super(session, id, instance, persister); this.state = state; } ! public void execute() throws HibernateException, SQLException { persister.insert(id, state, instance, session); session.postInsert(instance); } ! public void afterTransactionCompletion() { //do nothing } - } --- 11,33 ---- final class ScheduledInsertion extends ScheduledEntityAction implements SessionImpl.Executable{ private final Object[] state; ! public ScheduledInsertion(Serializable id, Object[] state, Object instance, ClassPersister persister, SessionImplementor session) { super(session, id, instance, persister); this.state = state; } ! public void execute() throws HibernateException, SQLException { persister.insert(id, state, instance, session); session.postInsert(instance); } ! public void afterTransactionCompletion() { //do nothing } + + + } + Index: ScheduledUpdate.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScheduledUpdate.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ScheduledUpdate.java 1 Jan 2003 13:55:49 -0000 1.1.1.1 --- ScheduledUpdate.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 11,19 **** final class ScheduledUpdate extends ScheduledEntityAction implements SessionImpl.Executable { ! private final Object[] fields; private final Object lastVersion; private final int[] dirtyFields; ! public ScheduledUpdate(Serializable id, Object[] fields, int[] dirtyProperties, Object lastVersion, Object instance, ClassPersister persister, SessionImplementor session) { super(session, id, instance, persister); --- 11,19 ---- final class ScheduledUpdate extends ScheduledEntityAction implements SessionImpl.Executable { ! private final Object[] fields; private final Object lastVersion; private final int[] dirtyFields; ! public ScheduledUpdate(Serializable id, Object[] fields, int[] dirtyProperties, Object lastVersion, Object instance, ClassPersister persister, SessionImplementor session) { super(session, id, instance, persister); *************** *** 27,31 **** persister.update(id, fields, dirtyFields, lastVersion, instance, session); } ! public void afterTransactionCompletion() throws CacheException { if ( persister.hasCache() ) persister.getCache().release(id); --- 27,31 ---- persister.update(id, fields, dirtyFields, lastVersion, instance, session); } ! public void afterTransactionCompletion() throws CacheException { if ( persister.hasCache() ) persister.getCache().release(id); *************** *** 33,35 **** --- 33,38 ---- } + + + Index: ScrollableResultsImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/impl/ScrollableResultsImpl.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ScrollableResultsImpl.java 1 Jan 2003 13:55:51 -0000 1.1.1.1 --- ScrollableResultsImpl.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 32,36 **** return rs.relative(i); } ! /** * @see net.sf.hibernate.ScrollableResults#first() --- 32,36 ---- return rs.relative(i); } ! /** * @see net.sf.hibernate.ScrollableResults#first() *************** *** 39,43 **** return rs.first(); } ! /** * @see net.sf.hibernate.ScrollableResults#last() --- 39,43 ---- return rs.first(); } ! /** * @see net.sf.hibernate.ScrollableResults#last() *************** *** 46,50 **** return rs.last(); } ! /** * @see net.sf.hibernate.ScrollableResults#advance() --- 46,50 ---- return rs.last(); } ! /** * @see net.sf.hibernate.ScrollableResults#advance() *************** *** 53,57 **** return rs.next(); } ! /** * @see net.sf.hibernate.ScrollableResults#retreat() --- 53,57 ---- return rs.next(); } ! /** * @see net.sf.hibernate.ScrollableResults#retreat() *************** *** 60,64 **** return rs.previous(); } ! /** * @see net.sf.hibernate.ScrollableResults#get() --- 60,64 ---- return rs.previous(); } ! /** * @see net.sf.hibernate.ScrollableResults#get() *************** *** 71,75 **** return row; } ! /** * @see net.sf.hibernate.ScrollableResults#get(int) --- 71,75 ---- return row; } ! /** * @see net.sf.hibernate.ScrollableResults#get(int) *************** *** 78,85 **** return types[col].nullSafeGet( rs, names[col], sess, null ); } ! ! public ScrollableResultsImpl(ResultSet rs, SessionImplementor sess, Type[] types) ! throws HibernateException, SQLException { ! this.rs=rs; this.sess = sess; --- 78,85 ---- return types[col].nullSafeGet( rs, names[col], sess, null ); } ! ! public ScrollableResultsImpl(ResultSet rs, SessionImplementor sess, Type[] types) ! throws HibernateException, SQLException { ! this.rs=rs; this.sess = sess; *************** *** 98,110 **** } ! /** * @see net.sf.hibernate.ScrollableResults#getBigDecimal(int) */ public BigDecimal getBigDecimal(int col) ! throws SQLException, HibernateException { return (BigDecimal) get(col); } ! /** * @see net.sf.hibernate.ScrollableResults#getBinary(int) --- 98,110 ---- } ! /** * @see net.sf.hibernate.ScrollableResults#getBigDecimal(int) */ public BigDecimal getBigDecimal(int col) ! throws SQLException, HibernateException { return (BigDecimal) get(col); } ! /** * @see net.sf.hibernate.ScrollableResults#getBinary(int) *************** *** 113,131 **** return (byte[]) get(col); } ! ! /** ! * @see net.sf.hibernate.ScrollableResults#getBlob(int) ! */ ! public Blob getBlob(int col) throws SQLException, HibernateException { ! return (Blob) get(col); ! } ! ! /** ! * @see net.sf.hibernate.ScrollableResults#getClob(int) ! */ ! public Clob getClob(int col) throws SQLException, HibernateException { ! return (Clob) get(col); ! } ! /** * @see net.sf.hibernate.ScrollableResults#getBoolean(int) --- 113,131 ---- return (byte[]) get(col); } ! ! /** ! * @see net.sf.hibernate.ScrollableResults#getBlob(int) ! */ ! public Blob getBlob(int col) throws SQLException, HibernateException { ! return (Blob) get(col); ! } ! ! /** ! * @see net.sf.hibernate.ScrollableResults#getClob(int) ! */ ! public Clob getClob(int col) throws SQLException, HibernateException { ! return (Clob) get(col); ! } ! /** * @see net.sf.hibernate.ScrollableResults#getBoolean(int) *************** *** 134,138 **** return (Boolean) get(col); } ! /** * @see net.sf.hibernate.ScrollableResults#getByte(int) --- 134,138 ---- return (Boolean) get(col); } ! /** * @see net.sf.hibernate.ScrollableResults#getByte(int) *************** *** 141,145 **** return (Byte) get(col); } ! /** * @see net.sf.hibernate.ScrollableResults#getCharacter(int) --- 141,145 ---- return (Byte) get(col); } ! /** * @see net.sf.hibernate.ScrollableResults#getCharacter(int) *************** *** 148,152 **** return (Character) get(col); } ! /** * @see net.sf.hibernate.ScrollableResults#getDate(int) --- 148,152 ---- return (Character) get(col); } ! /** * @see net.sf.hibernate.ScrollableResults#getDate(int) *************** *** 155,163 **** return (Date) get(col); } ! public Calendar getCalendar(int col) throws SQLException, HibernateException { return (Calendar) get(col); } ! /** * @see net.sf.hibernate.ScrollableResults#getDouble(int) --- 155,163 ---- return (Date) get(col); } ! public Calendar getCalendar(int col) throws SQLException, HibernateException { return (Calendar) get(col); } ! /** * @see net.sf.hibernate.ScrollableResults#getDouble(int) *************** *** 166,170 **** return (Double) get(col); } ! /** * @see net.sf.hibernate.ScrollableResults#getFloat(int) --- 166,170 ---- return (Double) get(col); } ! /** * @see net.sf.hibernate.ScrollableResults#getFloat(int) *************** *** 173,177 **** return (Float) get(col); } ! /** * @see net.sf.hibernate.ScrollableResults#getInteger(int) --- 173,177 ---- return (Float) get(col); } ! /** * @see net.sf.hibernate.ScrollableResults#get... [truncated message content] |
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader In directory sc8-pr-cvs1:/tmp/cvs-serv14211/src/net/sf/hibernate/loader Modified Files: AnsiOuterJoinGenerator.java CollectionInitializer.java CollectionLoader.java EntityLoader.java Loader.java OneToManyLoader.java OracleOuterJoinGenerator.java OuterJoinGenerator.java OuterJoinLoader.java SimpleEntityLoader.java UniqueEntityLoader.java Log Message: reformatted code with beautiful, shiny, happy TABS! improved an exception Index: AnsiOuterJoinGenerator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/AnsiOuterJoinGenerator.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** AnsiOuterJoinGenerator.java 1 Jan 2003 13:56:05 -0000 1.1.1.1 --- AnsiOuterJoinGenerator.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 9,39 **** */ public class AnsiOuterJoinGenerator extends OuterJoinGenerator { ! public final static String EMPTY_STRING = ""; ! public AnsiOuterJoinGenerator() { } ! public final String appendOuterJoinStringAfterFrom(StringBuffer buf, String tableName, String alias, String[] fkColumns, String[] pkColumns, boolean innerJoin) { ! buf.append( innerJoin ? " INNER JOIN " : " LEFT OUTER JOIN ") ! .append(tableName) ! .append(' ') ! .append(alias) ! .append(" ON "); //TODO: refactor onto Loadable .. this is repeated in two other places for ( int j=0; j<fkColumns.length; j++) { buf.append( fkColumns[j] ) ! .append('=') ! .append(alias) ! .append('.') ! .append( pkColumns[j] ); if ( j<fkColumns.length-1 ) buf.append(" and "); } return buf.toString(); } ! public final String appendOuterJoinStringAfterWhere(StringBuffer buf, String alias, String[] fkColumns, String[] pkColumns, boolean innerJoin) { return EMPTY_STRING; } } --- 9,42 ---- */ public class AnsiOuterJoinGenerator extends OuterJoinGenerator { ! public final static String EMPTY_STRING = ""; ! public AnsiOuterJoinGenerator() { } ! public final String appendOuterJoinStringAfterFrom(StringBuffer buf, String tableName, String alias, String[] fkColumns, String[] pkColumns, boolean innerJoin) { ! buf.append( innerJoin ? " INNER JOIN " : " LEFT OUTER JOIN ") ! .append(tableName) ! .append(' ') ! .append(alias) ! .append(" ON "); //TODO: refactor onto Loadable .. this is repeated in two other places for ( int j=0; j<fkColumns.length; j++) { buf.append( fkColumns[j] ) ! .append('=') ! .append(alias) ! .append('.') ! .append( pkColumns[j] ); if ( j<fkColumns.length-1 ) buf.append(" and "); } return buf.toString(); } ! public final String appendOuterJoinStringAfterWhere(StringBuffer buf, String alias, String[] fkColumns, String[] pkColumns, boolean innerJoin) { return EMPTY_STRING; } } + + + Index: CollectionInitializer.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/CollectionInitializer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CollectionInitializer.java 3 Jan 2003 13:36:01 -0000 1.2 --- CollectionInitializer.java 4 Jan 2003 11:15:29 -0000 1.3 *************** *** 20,21 **** --- 20,24 ---- public void initialize(Serializable id, PersistentCollection collection, Object owner, SessionImplementor session) throws SQLException, HibernateException; } + + + Index: CollectionLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/CollectionLoader.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CollectionLoader.java 3 Jan 2003 13:36:01 -0000 1.2 --- CollectionLoader.java 4 Jan 2003 11:15:29 -0000 1.3 *************** *** 23,37 **** private final Type idType; private final boolean allowTwoPhaseLoad; ! public CollectionLoader(CollectionPersister persister, SessionFactoryImplementor session) throws MappingException { ! super( session.getDialect() ); allowTwoPhaseLoad = !persister.isSet(); ! idType = persister.getKeyType(); String alias = alias( persister.getQualifiedTableName(), 0 ); ! List associations = walkTree(persister, alias, session); --- 23,37 ---- private final Type idType; private final boolean allowTwoPhaseLoad; ! public CollectionLoader(CollectionPersister persister, SessionFactoryImplementor session) throws MappingException { ! super( session.getDialect() ); allowTwoPhaseLoad = !persister.isSet(); ! idType = persister.getKeyType(); String alias = alias( persister.getQualifiedTableName(), 0 ); ! List associations = walkTree(persister, alias, session); *************** *** 54,59 **** // ORDER BY CLAUSE ( persister.hasOrdering() ) ? ! persister.getSQLOrderByString(alias) : ! null ); --- 54,59 ---- // ORDER BY CLAUSE ( persister.hasOrdering() ) ? ! persister.getSQLOrderByString(alias) : ! null ); *************** *** 68,72 **** public void initialize(Serializable id, PersistentCollection collection, Object owner, SessionImplementor session) throws SQLException, HibernateException { ! loadCollection(session, id, idType, owner, collection); } --- 68,72 ---- public void initialize(Serializable id, PersistentCollection collection, Object owner, SessionImplementor session) throws SQLException, HibernateException { ! loadCollection(session, id, idType, owner, collection); } *************** *** 74,77 **** return allowTwoPhaseLoad; } ! } --- 74,80 ---- return allowTwoPhaseLoad; } ! } + + + Index: EntityLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/EntityLoader.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EntityLoader.java 3 Jan 2003 13:36:01 -0000 1.2 --- EntityLoader.java 4 Jan 2003 11:15:29 -0000 1.3 *************** *** 24,41 **** public EntityLoader(Loadable persister, SessionFactoryImplementor factory) throws MappingException { ! super( factory.getDialect() ); ! idType = new Type[] { persister.getIdentifierType() }; this.persister = persister; String alias = alias( persister.getClassName(), 0 ); ! List associations = walkTree(persister, alias, factory); ! int joins=associations.size(); suffixes = new String[joins+1]; for ( int i=0; i<=joins; i++ ) suffixes[i] = (joins==0) ? "" : Integer.toString(i); ! sql = sqlSelect( //SELECT CLAUSE --- 24,41 ---- public EntityLoader(Loadable persister, SessionFactoryImplementor factory) throws MappingException { ! super( factory.getDialect() ); ! idType = new Type[] { persister.getIdentifierType() }; this.persister = persister; String alias = alias( persister.getClassName(), 0 ); ! List associations = walkTree(persister, alias, factory); ! int joins=associations.size(); suffixes = new String[joins+1]; for ( int i=0; i<=joins; i++ ) suffixes[i] = (joins==0) ? "" : Integer.toString(i); ! sql = sqlSelect( //SELECT CLAUSE *************** *** 52,61 **** persister.outerJoinsAfterWhere(alias, true) ); ! classPersisters = new Loadable[joins+1]; for ( int i=0; i<joins; i++ ) classPersisters[i] = ( (OuterJoinableAssociation) associations.get(i) ).subpersister; classPersisters[joins] = persister; } ! protected CollectionPersister getCollectionPersister() { return null; --- 52,61 ---- persister.outerJoinsAfterWhere(alias, true) ); ! classPersisters = new Loadable[joins+1]; for ( int i=0; i<joins; i++ ) classPersisters[i] = ( (OuterJoinableAssociation) associations.get(i) ).subpersister; classPersisters[joins] = persister; } ! protected CollectionPersister getCollectionPersister() { return null; *************** *** 75,78 **** } } ! } --- 75,81 ---- } } ! } + + + Index: Loader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/Loader.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Loader.java 3 Jan 2003 13:36:01 -0000 1.2 --- Loader.java 4 Jan 2003 11:15:29 -0000 1.3 *************** *** 29,33 **** /** * Abstract superclass of object loading (and querying) strategies. This class implements useful ! * common functionality that concrete loaders would delegate to. It is not intended that this * functionality would be directly accessed by client code. (Hence, all methods of this class * will eventually be declared <tt>protected</tt>.) --- 29,33 ---- /** * Abstract superclass of object loading (and querying) strategies. This class implements useful ! * common functionality that concrete loaders would delegate to. It is not intended that this * functionality would be directly accessed by client code. (Hence, all methods of this class * will eventually be declared <tt>protected</tt>.) *************** *** 64,68 **** } /** ! * Are we allowed to do two-phase loading? (we aren't for some special cases * like sets of entities ... actually only that one special case) */ --- 64,68 ---- } /** ! * Are we allowed to do two-phase loading? (we aren't for some special cases * like sets of entities ... actually only that one special case) */ *************** *** 91,103 **** /** * Execute an SQL query and attempt to instantiate instances of the class mapped by the given ! * persister from each row of the <tt>ResultSet</tt>. If an object is supplied, will attempt to * initialize that object. If a collection is supplied, attempt to initialize that collection. */ private final List doFind( final SessionImplementor session, ! final Object[] values, final Type[] types, ! final Object optionalObject, ! final Serializable optionalID, final PersistentCollection optionalCollection, final Object optionalCollectionOwner, --- 91,103 ---- /** * Execute an SQL query and attempt to instantiate instances of the class mapped by the given ! * persister from each row of the <tt>ResultSet</tt>. If an object is supplied, will attempt to * initialize that object. If a collection is supplied, attempt to initialize that collection. */ private final List doFind( final SessionImplementor session, ! final Object[] values, final Type[] types, ! final Object optionalObject, ! final Serializable optionalID, final PersistentCollection optionalCollection, final Object optionalCollectionOwner, *************** *** 106,115 **** final Map namedParams ) throws SQLException, HibernateException { ! returnProxies = returnProxies && Environment.jvmSupportsProxies(); ! ! int maxRows = (selection==null || selection.getMaxRows()==null) ? ! Integer.MAX_VALUE : ! selection.getMaxRows().intValue(); final Loadable[] persisters = getPersisters(); --- 106,115 ---- final Map namedParams ) throws SQLException, HibernateException { ! returnProxies = returnProxies && Environment.jvmSupportsProxies(); ! ! int maxRows = (selection==null || selection.getMaxRows()==null) ? ! Integer.MAX_VALUE : ! selection.getMaxRows().intValue(); final Loadable[] persisters = getPersisters(); *************** *** 118,127 **** final boolean twoPhaseLoad = allowTwoPhaseLoad() && cols > 0; final String[] suffixes = getSuffixes(); ! final ArrayList hydratedObjects = twoPhaseLoad ? new ArrayList() : null; final Key optionalObjectKey; //boolean success; ! if (optionalObject!=null) { optionalObjectKey = new Key( optionalID, session.getPersister(optionalObject) ); --- 118,127 ---- final boolean twoPhaseLoad = allowTwoPhaseLoad() && cols > 0; final String[] suffixes = getSuffixes(); ! final ArrayList hydratedObjects = twoPhaseLoad ? new ArrayList() : null; final Key optionalObjectKey; //boolean success; ! if (optionalObject!=null) { optionalObjectKey = new Key( optionalID, session.getPersister(optionalObject) ); *************** *** 137,151 **** final boolean scalars = hasScalarValues(); if (scalars) { ! returnTypes = getReturnTypes(); names = getScalarColumnNames(); } ! final List results = new ArrayList(); //new net.sf.hibernate.collections.List(this); final PreparedStatement st = prepareQueryStatement( getSQLString(), values, types, selection, false, session ); ! final ResultSet rs = getResultSet(st, namedParams, selection, session); try { ! final Key[] keys = new Key[cols]; //we can reuse it each time final boolean[] hydrate = new boolean[cols]; //we can reuse it each time --- 137,151 ---- final boolean scalars = hasScalarValues(); if (scalars) { ! returnTypes = getReturnTypes(); names = getScalarColumnNames(); } ! final List results = new ArrayList(); //new net.sf.hibernate.collections.List(this); final PreparedStatement st = prepareQueryStatement( getSQLString(), values, types, selection, false, session ); ! final ResultSet rs = getResultSet(st, namedParams, selection, session); try { ! final Key[] keys = new Key[cols]; //we can reuse it each time final boolean[] hydrate = new boolean[cols]; //we can reuse it each time *************** *** 163,167 **** 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 ); --- 163,167 ---- 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 ); *************** *** 173,177 **** else { //materialize associations (and initialize the object) *now* ! session.initializeEntity( row[i] ); } --- 173,177 ---- else { //materialize associations (and initialize the object) *now* ! session.initializeEntity( row[i] ); } *************** *** 193,204 **** Object[] queryRow = new Object[queryCols]; for ( int i=0; i<queryCols; i++ ) ! queryRow[i] = returnTypes[i].nullSafeGet( rs, names[i], session, null ); results.add(queryRow); } } ! if (collection) optionalCollection.readFrom( rs, getCollectionPersister(), optionalCollectionOwner ); } ! } catch (SQLException sqle) { --- 193,204 ---- Object[] queryRow = new Object[queryCols]; for ( int i=0; i<queryCols; i++ ) ! queryRow[i] = returnTypes[i].nullSafeGet( rs, names[i], session, null ); results.add(queryRow); } } ! if (collection) optionalCollection.readFrom( rs, getCollectionPersister(), optionalCollectionOwner ); } ! } catch (SQLException sqle) { *************** *** 221,225 **** return results; ! } --- 221,225 ---- return results; ! } *************** *** 228,233 **** * method is side-effecty. If an <tt>id</tt> is given, don't bother going to the <tt>ResultSet</tt>. */ ! private Key getKeyFromResultSet(Loadable persister, String suffix, Serializable id, ResultSet rs, SessionImplementor session) ! throws HibernateException, SQLException { --- 228,233 ---- * method is side-effecty. If an <tt>id</tt> is given, don't bother going to the <tt>ResultSet</tt>. */ ! private Key getKeyFromResultSet(Loadable persister, String suffix, Serializable id, ResultSet rs, SessionImplementor session) ! throws HibernateException, SQLException { *************** *** 236,240 **** String[] keyColNames = StringHelper.suffix( persister.getIdentifierColumnNames(), suffix ); StringHelper.unQuoteInPlace(keyColNames); ! id = (Serializable) persister.getIdentifierType().nullSafeGet(rs, keyColNames, session, null); } --- 236,240 ---- String[] keyColNames = StringHelper.suffix( persister.getIdentifierColumnNames(), suffix ); StringHelper.unQuoteInPlace(keyColNames); ! id = (Serializable) persister.getIdentifierType().nullSafeGet(rs, keyColNames, session, null); } *************** *** 251,257 **** private Object[] getRow( ResultSet rs, ! Loadable[] persisters, ! String[] suffixes, ! Key[] keys, boolean[] hydrate, //RETURNS VALUES BY SIDE-EFFECT!!!!!!!! Object optionalObject, --- 251,257 ---- private Object[] getRow( ResultSet rs, ! Loadable[] persisters, ! String[] suffixes, ! Key[] keys, boolean[] hydrate, //RETURNS VALUES BY SIDE-EFFECT!!!!!!!! Object optionalObject, *************** *** 263,297 **** Object[] rowResults = new Object[cols]; ! for ( int i=0; i<cols; i++ ) { ! Object object=null; Key key = keys[i]; ! if ( keys[i]==null ) { hydrate[i] = false; } else { ! //If the object is already loaded, return the loaded one 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; //success=true; ! } else { --- 263,297 ---- Object[] rowResults = new Object[cols]; ! for ( int i=0; i<cols; i++ ) { ! Object object=null; Key key = keys[i]; ! if ( keys[i]==null ) { hydrate[i] = false; } else { ! //If the object is already loaded, return the loaded one 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; //success=true; ! } else { *************** *** 299,312 **** object = session.getFactory().getPersister(instanceClass).instantiate( key.getIdentifier() ); } ! //need to hydrate it. hydrate[i] = true; ! // so that code is circular-reference safe: session.addUninitializedEntity( key, object, getLockMode() ); } ! } ! rowResults[i]=object; --- 299,312 ---- object = session.getFactory().getPersister(instanceClass).instantiate( key.getIdentifier() ); } ! //need to hydrate it. hydrate[i] = true; ! // so that code is circular-reference safe: session.addUninitializedEntity( key, object, getLockMode() ); } ! } ! rowResults[i]=object; *************** *** 314,326 **** return rowResults; ! } ! ! /** * 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); --- 314,326 ---- return rowResults; ! } ! ! /** * 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); *************** *** 338,344 **** */ private Class getInstanceClass(ResultSet rs, Loadable persister, String suffix, Serializable id, SessionImplementor session) throws HibernateException, SQLException { ! Class topClass = persister.getMappedClass(); ! if ( persister.hasSubclasses() ) { --- 338,344 ---- */ private Class getInstanceClass(ResultSet rs, Loadable persister, String suffix, Serializable id, SessionImplementor session) throws HibernateException, SQLException { ! Class topClass = persister.getMappedClass(); ! if ( persister.hasSubclasses() ) { *************** *** 349,360 **** // Code to handle subclasses of topClass Object discriminatorValue = persister.getDiscriminatorType().nullSafeGet(rs, col, session, null); ! Class result = persister.getSubclassForDiscriminatorValue(discriminatorValue); ! if (result==null) throw new WrongClassException("Discriminator: " + discriminatorValue, id, topClass); //woops we got an instance of another class heirarchy branch ! return result; ! } else { --- 349,360 ---- // Code to handle subclasses of topClass Object discriminatorValue = persister.getDiscriminatorType().nullSafeGet(rs, col, session, null); ! Class result = persister.getSubclassForDiscriminatorValue(discriminatorValue); ! if (result==null) throw new WrongClassException("Discriminator: " + discriminatorValue, id, topClass); //woops we got an instance of another class heirarchy branch ! return result; ! } else { *************** *** 363,367 **** } ! /** * Unmarshall the fields of a persistent instance from a result set */ --- 363,367 ---- } ! /** * Unmarshall the fields of a persistent instance from a result set */ *************** *** 382,386 **** return values; } ! /** * Advance the cursor to the first required row of the <tt>ResultSet</tt> --- 382,386 ---- return values; } ! /** * Advance the cursor to the first required row of the <tt>ResultSet</tt> *************** *** 405,409 **** } } ! /** * Obtain a <tt>PreparedStatement</tt> and bind JDBC-style <tt>?</tt> parameters --- 405,409 ---- } } ! /** * Obtain a <tt>PreparedStatement</tt> and bind JDBC-style <tt>?</tt> parameters *************** *** 412,424 **** boolean scrollable = selection!=null && ! ( ( selection.getFirstRow()!=null && selection.getFirstRow().intValue()!=0 ) || scroll ) && ! session.getFactory().useScrollableResultSets(); PreparedStatement st = session.getBatcher().prepareQueryStatement(sql, scrollable); try { ! if (selection!=null && selection.getTimeout()!=null) st.setQueryTimeout( selection.getTimeout().intValue() ); ! int col=1; for ( int i=0; i<values.length; i++) { --- 412,424 ---- boolean scrollable = selection!=null && ! ( ( selection.getFirstRow()!=null && selection.getFirstRow().intValue()!=0 ) || scroll ) && ! session.getFactory().useScrollableResultSets(); PreparedStatement st = session.getBatcher().prepareQueryStatement(sql, scrollable); try { ! if (selection!=null && selection.getTimeout()!=null) st.setQueryTimeout( selection.getTimeout().intValue() ); ! int col=1; for ( int i=0; i<values.length; i++) { *************** *** 437,441 **** throw he; } ! return st; } --- 437,441 ---- throw he; } ! return st; } *************** *** 445,450 **** */ protected final void setMaxRows(PreparedStatement st,RowSelection selection) throws SQLException { ! if ( selection!=null && selection.getMaxRows()!=null ) st.setMaxRows( ! selection.getMaxRows().intValue() + ( (selection.getFirstRow()==null) ? 0 : selection.getFirstRow().intValue() ) ); } --- 445,450 ---- */ protected final void setMaxRows(PreparedStatement st,RowSelection selection) throws SQLException { ! if ( selection!=null && selection.getMaxRows()!=null ) st.setMaxRows( ! selection.getMaxRows().intValue() + ( (selection.getFirstRow()==null) ? 0 : selection.getFirstRow().intValue() ) ); } *************** *** 477,481 **** */ protected void bindNamedParameters(PreparedStatement st, Map namedParams, SessionImplementor session) throws SQLException, HibernateException {} ! /** * Called by subclasses that load entities --- 477,481 ---- */ protected void bindNamedParameters(PreparedStatement st, Map namedParams, SessionImplementor session) throws SQLException, HibernateException {} ! /** * Called by subclasses that load entities *************** *** 483,490 **** protected final List loadEntity( final SessionImplementor session, ! final Object[] values, final Type[] types, ! final Object optionalObject, ! final Serializable optionalID, boolean returnProxies ) throws SQLException, HibernateException { --- 483,490 ---- protected final List loadEntity( final SessionImplementor session, ! final Object[] values, final Type[] types, ! final Object optionalObject, ! final Serializable optionalID, boolean returnProxies ) throws SQLException, HibernateException { *************** *** 497,501 **** protected final List loadCollection( final SessionImplementor session, ! final Serializable id, final Type type, final Object owner, --- 497,501 ---- protected final List loadCollection( final SessionImplementor session, ! final Serializable id, final Type type, final Object owner, *************** *** 504,509 **** return doFind(session, new Object[] {id}, new Type[] {type}, null, null, collection, owner, true, null, null); } ! ! /** * Called by subclasses that implement queries --- 504,509 ---- return doFind(session, new Object[] {id}, new Type[] {type}, null, null, collection, owner, true, null, null); } ! ! /** * Called by subclasses that implement queries *************** *** 511,515 **** public final List find( final SessionImplementor session, ! final Object[] values, final Type[] types, boolean returnProxies, --- 511,515 ---- public final List find( final SessionImplementor session, ! final Object[] values, final Type[] types, boolean returnProxies, *************** *** 519,523 **** return doFind(session, values, types, null, null, null, null, returnProxies, selection, namedParams); } ! /** * Construct an SQL <tt>SELECT</tt> statement from the given clauses --- 519,523 ---- return doFind(session, values, types, null, null, null, null, returnProxies, selection, namedParams); } ! /** * Construct an SQL <tt>SELECT</tt> statement from the given clauses *************** *** 531,542 **** */ protected static final String sqlSelect(String selectClause, String fromClause, String outerJoinsAfterFrom, String whereClause, String outerJoinsAfterWhere, String orderByClause) { ! StringBuffer buf = new StringBuffer( selectClause.length() + fromClause.length() + outerJoinsAfterFrom.length() + whereClause.length() + outerJoinsAfterWhere.length() + 20 ); buf.append("SELECT ").append(selectClause) ! .append(" FROM ").append(fromClause) ! .append(outerJoinsAfterFrom) ! .append(" WHERE ").append(whereClause) ! .append(outerJoinsAfterWhere); if (orderByClause!=null) buf.append(" ORDER BY ").append(orderByClause); return buf.toString(); --- 531,542 ---- */ protected static final String sqlSelect(String selectClause, String fromClause, String outerJoinsAfterFrom, String whereClause, String outerJoinsAfterWhere, String orderByClause) { ! StringBuffer buf = new StringBuffer( selectClause.length() + fromClause.length() + outerJoinsAfterFrom.length() + whereClause.length() + outerJoinsAfterWhere.length() + 20 ); buf.append("SELECT ").append(selectClause) ! .append(" FROM ").append(fromClause) ! .append(outerJoinsAfterFrom) ! .append(" WHERE ").append(whereClause) ! .append(outerJoinsAfterWhere); if (orderByClause!=null) buf.append(" ORDER BY ").append(orderByClause); return buf.toString(); *************** *** 544,545 **** --- 544,548 ---- } + + + Index: OneToManyLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/OneToManyLoader.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OneToManyLoader.java 3 Jan 2003 13:36:01 -0000 1.2 --- OneToManyLoader.java 4 Jan 2003 11:15:29 -0000 1.3 *************** *** 24,34 **** private final Type idType; private final boolean allowTwoPhaseLoad; ! public OneToManyLoader(CollectionPersister collPersister, SessionFactoryImplementor session) throws MappingException { ! super( session.getDialect() ); allowTwoPhaseLoad = !collPersister.isSet(); ! collectionPersister = collPersister; --- 24,34 ---- private final Type idType; private final boolean allowTwoPhaseLoad; ! public OneToManyLoader(CollectionPersister collPersister, SessionFactoryImplementor session) throws MappingException { ! super( session.getDialect() ); allowTwoPhaseLoad = !collPersister.isSet(); ! collectionPersister = collPersister; *************** *** 65,88 **** // ORDER BY CLAUSE collPersister.hasOrdering() ? ! collPersister.getSQLOrderByString(collAlias) : ! null ); ! classPersisters = new Loadable[joins+1]; for ( int i=0; i<joins; i++ ) classPersisters[i] = ( (OuterJoinableAssociation) associations.get(i) ).subpersister; classPersisters[joins] = persister; } ! protected CollectionPersister getCollectionPersister() { return collectionPersister; } ! public void initialize(Serializable id, PersistentCollection collection, Object owner, SessionImplementor session) throws SQLException, HibernateException { ! loadCollection(session, id, idType, owner, collection); } ! protected boolean allowTwoPhaseLoad() { return allowTwoPhaseLoad; } ! } --- 65,91 ---- // ORDER BY CLAUSE collPersister.hasOrdering() ? ! collPersister.getSQLOrderByString(collAlias) : ! null ); ! classPersisters = new Loadable[joins+1]; for ( int i=0; i<joins; i++ ) classPersisters[i] = ( (OuterJoinableAssociation) associations.get(i) ).subpersister; classPersisters[joins] = persister; } ! protected CollectionPersister getCollectionPersister() { return collectionPersister; } ! public void initialize(Serializable id, PersistentCollection collection, Object owner, SessionImplementor session) throws SQLException, HibernateException { ! loadCollection(session, id, idType, owner, collection); } ! protected boolean allowTwoPhaseLoad() { return allowTwoPhaseLoad; } ! } + + + Index: OracleOuterJoinGenerator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/OracleOuterJoinGenerator.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** OracleOuterJoinGenerator.java 1 Jan 2003 13:56:08 -0000 1.1.1.1 --- OracleOuterJoinGenerator.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 9,38 **** */ public class OracleOuterJoinGenerator extends OuterJoinGenerator { ! public OracleOuterJoinGenerator() { } ! public final String appendOuterJoinStringAfterFrom(StringBuffer buf, String tableName, String alias, String[] fkColumns, String[] pkColumns, boolean innerJoin) { ! buf.append(", ") ! .append(tableName) ! .append(' ') ! .append(alias); return buf.toString(); } ! public final String appendOuterJoinStringAfterWhere(StringBuffer buf, String alias, String[] fkColumns, String[] pkColumns, boolean innerJoin) { ! for ( int j=0; j<fkColumns.length; j++) { buf.append(" AND ") ! .append( fkColumns[j] ) ! .append('=') ! .append(alias) ! .append('.') ! .append( pkColumns[j] ); if (!innerJoin) buf.append("(+)"); } return buf.toString(); } ! } --- 9,41 ---- */ public class OracleOuterJoinGenerator extends OuterJoinGenerator { ! public OracleOuterJoinGenerator() { } ! public final String appendOuterJoinStringAfterFrom(StringBuffer buf, String tableName, String alias, String[] fkColumns, String[] pkColumns, boolean innerJoin) { ! buf.append(", ") ! .append(tableName) ! .append(' ') ! .append(alias); return buf.toString(); } ! public final String appendOuterJoinStringAfterWhere(StringBuffer buf, String alias, String[] fkColumns, String[] pkColumns, boolean innerJoin) { ! for ( int j=0; j<fkColumns.length; j++) { buf.append(" AND ") ! .append( fkColumns[j] ) ! .append('=') ! .append(alias) ! .append('.') ! .append( pkColumns[j] ); if (!innerJoin) buf.append("(+)"); } return buf.toString(); } ! } + + + Index: OuterJoinGenerator.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/OuterJoinGenerator.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** OuterJoinGenerator.java 1 Jan 2003 13:56:10 -0000 1.1.1.1 --- OuterJoinGenerator.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 11,18 **** public abstract class OuterJoinGenerator { ! /** * Generate a list of <tt>LEFT OUTER JOIN</tt> clauses for the given associations. ! * This is the first insertion point of outer join logic into the sql. */ public final String outerJoinStringAfterFrom(List associations) { --- 11,18 ---- public abstract class OuterJoinGenerator { ! /** * Generate a list of <tt>LEFT OUTER JOIN</tt> clauses for the given associations. ! * This is the first insertion point of outer join logic into the sql. */ public final String outerJoinStringAfterFrom(List associations) { *************** *** 23,27 **** appendOuterJoinStringAfterFrom( buf, ! oj.subpersister.getTableName(), oj.subalias, oj.foreignKeyColumns, --- 23,27 ---- appendOuterJoinStringAfterFrom( buf, ! oj.subpersister.getTableName(), oj.subalias, oj.foreignKeyColumns, *************** *** 33,40 **** return buf.toString(); } ! /** * Generate a list of <tt>LEFT OUTER JOIN</tt> clauses for the given associations. ! * This is the second insertion point of outer join logic into the sql. */ public final String outerJoinStringAfterWhere(List associations) { --- 33,40 ---- return buf.toString(); } ! /** * Generate a list of <tt>LEFT OUTER JOIN</tt> clauses for the given associations. ! * This is the second insertion point of outer join logic into the sql. */ public final String outerJoinStringAfterWhere(List associations) { *************** *** 44,50 **** OuterJoinLoader.OuterJoinableAssociation oj = (OuterJoinLoader.OuterJoinableAssociation) iter.next(); appendOuterJoinStringAfterWhere( ! buf, ! oj.subalias, ! oj.foreignKeyColumns, oj.subpersister.getIdentifierColumnNames(), false --- 44,50 ---- OuterJoinLoader.OuterJoinableAssociation oj = (OuterJoinLoader.OuterJoinableAssociation) iter.next(); appendOuterJoinStringAfterWhere( ! buf, ! oj.subalias, ! oj.foreignKeyColumns, oj.subpersister.getIdentifierColumnNames(), false *************** *** 54,58 **** return buf.toString(); } ! /** * Generate a <tt>LEFT OUTER JOIN</tt> clause to the table of the entity class. --- 54,58 ---- return buf.toString(); } ! /** * Generate a <tt>LEFT OUTER JOIN</tt> clause to the table of the entity class. *************** *** 60,69 **** */ public abstract String appendOuterJoinStringAfterFrom(StringBuffer buf, String tableName, String alias, String[] fkColumns, String[] pkColumns, boolean innerJoin); ! /** * Generate a <tt>ON</tt> clause to the table of the entity class * To be inserted after the FROM clause. */ ! public abstract String appendOuterJoinStringAfterWhere(StringBuffer buf, String alias, String[] fkColumns, String[] pkColumns, boolean innerJoin); ! } --- 60,72 ---- */ public abstract String appendOuterJoinStringAfterFrom(StringBuffer buf, String tableName, String alias, String[] fkColumns, String[] pkColumns, boolean innerJoin); ! /** * Generate a <tt>ON</tt> clause to the table of the entity class * To be inserted after the FROM clause. */ ! public abstract String appendOuterJoinStringAfterWhere(StringBuffer buf, String alias, String[] fkColumns, String[] pkColumns, boolean innerJoin); ! } + + + Index: OuterJoinLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/OuterJoinLoader.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OuterJoinLoader.java 3 Jan 2003 13:36:01 -0000 1.2 --- OuterJoinLoader.java 4 Jan 2003 11:15:29 -0000 1.3 *************** *** 27,31 **** public static final int AUTO = 0; public static final int LAZY = -1; ! protected static final Type[] NO_TYPES = new Type[0]; protected static final String[][] NO_STRINGARRAYS = new String[0][]; --- 27,31 ---- public static final int AUTO = 0; public static final int LAZY = -1; ! protected static final Type[] NO_TYPES = new Type[0]; protected static final String[][] NO_STRINGARRAYS = new String[0][]; *************** *** 36,45 **** protected String[] suffixes; protected final OuterJoinGenerator outerJoinGenerator; ! public OuterJoinLoader(Dialect dialect) { outerJoinGenerator = dialect.getOuterJoinGenerator(); } ! public static final class OuterJoinableAssociation { //Object persister; // a class or collection persister! --- 36,45 ---- protected String[] suffixes; protected final OuterJoinGenerator outerJoinGenerator; ! public OuterJoinLoader(Dialect dialect) { outerJoinGenerator = dialect.getOuterJoinGenerator(); } ! public static final class OuterJoinableAssociation { //Object persister; // a class or collection persister! *************** *** 66,70 **** if ( session.enableJoinedFetch() ) { //yick! ! Type type = persister.getElementType(); String[] columns = StringHelper.prefix( persister.getElementColumnNames(), alias + '.' ); --- 66,70 ---- if ( session.enableJoinedFetch() ) { //yick! ! Type type = persister.getElementType(); String[] columns = StringHelper.prefix( persister.getElementColumnNames(), alias + '.' ); *************** *** 126,131 **** */ private void walkTree(AbstractComponentType act, String[] cols, Object persister, String alias, List associations, Set classPersisters, SessionFactoryImplementor session) throws MappingException { ! if ( ! !session.enableJoinedFetch() || persister instanceof MultiTableEntityPersister //TODO: remove this + enable outerjoin fetching ) return; --- 126,131 ---- */ private void walkTree(AbstractComponentType act, String[] cols, Object persister, String alias, List associations, Set classPersisters, SessionFactoryImplementor session) throws MappingException { ! if ( ! !session.enableJoinedFetch() || persister instanceof MultiTableEntityPersister //TODO: remove this + enable outerjoin fetching ) return; *************** *** 138,143 **** if ( types[i].isEntityType() ) { EntityType etype = (EntityType) types[i]; ! if ( autoEager( act.enableJoinedFetch(i), etype, session ) ) ! walkTree(etype, range, persister, alias, associations, classPersisters, session); } else if ( types[i].isComponentType() ) { --- 138,143 ---- if ( types[i].isEntityType() ) { EntityType etype = (EntityType) types[i]; ! if ( autoEager( act.enableJoinedFetch(i), etype, session ) ) ! walkTree(etype, range, persister, alias, associations, classPersisters, session); } else if ( types[i].isComponentType() ) { *************** *** 154,158 **** return !persister.hasProxy() || ( type.isOneToOne() && ( (OneToOneType) type ).isNullable() ); } ! /** * Add on association (one-to-one or many-to-one) to a list of associations be fetched by outerjoin (if necessary) --- 154,158 ---- return !persister.hasProxy() || ( type.isOneToOne() && ( (OneToOneType) type ).isNullable() ); } ! /** * Add on association (one-to-one or many-to-one) to a list of associations be fetched by outerjoin (if necessary) *************** *** 166,170 **** if ( !classPersisters.contains(subpersister) ) { // to avoid navigating back up bidirectional associations (and circularities) ! OuterJoinableAssociation assoc = new OuterJoinableAssociation(); associations.add(assoc); --- 166,170 ---- if ( !classPersisters.contains(subpersister) ) { // to avoid navigating back up bidirectional associations (and circularities) ! OuterJoinableAssociation assoc = new OuterJoinableAssociation(); associations.add(assoc); *************** *** 219,232 **** for ( int j=0; j<keyCols.length; j++) { buf.append(alias) ! .append('.') ! .append( keyCols[j] ) ! .append(" AS ") ! .append( aliasColumn( keyCols[j], suffix ) ); if ( j != keyCols.length-1 ) buf.append(", "); } buf.append( persister.propertySelectClauseFragment(alias, suffix) ); ! } ! /** * Generate a list of column conditions of the form <tt>x.foo = ?, x.bar = ?</tt> --- 219,232 ---- for ( int j=0; j<keyCols.length; j++) { buf.append(alias) ! .append('.') ! .append( keyCols[j] ) ! .append(" AS ") ! .append( aliasColumn( keyCols[j], suffix ) ); if ( j != keyCols.length-1 ) buf.append(", "); } buf.append( persister.propertySelectClauseFragment(alias, suffix) ); ! } ! /** * Generate a list of column conditions of the form <tt>x.foo = ?, x.bar = ?</tt> *************** *** 236,242 **** for ( int i=0; i<columns.length; i++ ) { buf.append(alias) ! .append('.') ! .append( columns[i] ) ! .append( " = ?"); if (i<columns.length-1) buf.append(" and "); } --- 236,242 ---- for ( int i=0; i<columns.length; i++ ) { buf.append(alias) ! .append('.') ! .append( columns[i] ) ! .append( " = ?"); if (i<columns.length-1) buf.append(" and "); } *************** *** 252,257 **** for ( int i=0; i<selectCols.length; i++ ) { buf.append(alias) ! .append('.') ! .append( selectCols[i] ); if (i!=selectCols.length-1) buf.append(", "); } --- 252,257 ---- for ( int i=0; i<selectCols.length; i++ ) { buf.append(alias) ! .append('.') ! .append( selectCols[i] ); if (i!=selectCols.length-1) buf.append(", "); } *************** *** 260,266 **** for ( int i=0; i<indexCols.length; i++ ) { buf.append(", ") ! .append(alias) ! .append('.') ! .append( indexCols[i] ); } } --- 260,266 ---- for ( int i=0; i<indexCols.length; i++ ) { buf.append(", ") ! .append(alias) ! .append('.') ! .append( indexCols[i] ); } } *************** *** 271,308 **** return suffixes; } - - protected static String alias(String tableName, int n) { - - tableName = StringHelper.unqualify(tableName); ! return aliasCore(tableName.length() <=5 ? ! tableName : ! tableName.substring(0, 5), ! Integer.toString(n) ! ); ! } ! ! protected static String aliasColumn(String columnName, String suffix) { ! return aliasCore(columnName, suffix); ! } ! ! //TODO: refactor! this is a duplicate of a method in the Loader heirarchy ! private static String aliasCore(String name, String suffix) { ! char quote = name.charAt(0); ! boolean nameEscaped = Dialect.QUOTE.indexOf(quote) > -1; ! if (nameEscaped) name = name.substring(1, name.length()-1); - StringBuffer aliasBuilder = new StringBuffer(name.length()); - if (nameEscaped) aliasBuilder.append(quote); - aliasBuilder.append(name); - aliasBuilder.append(suffix); - if (nameEscaped) aliasBuilder.append(quote); - return aliasBuilder.toString(); - } - } --- 271,311 ---- return suffixes; } ! protected static String alias(String tableName, int n) { ! ! tableName = StringHelper.unqualify(tableName); ! ! return aliasCore(tableName.length() <=5 ? ! tableName : ! tableName.substring(0, 5), ! Integer.toString(n) ! ); ! } ! protected static String aliasColumn(String columnName, String suffix) { ! return aliasCore(columnName, suffix); ! } ! //TODO: refactor! this is a duplicate of a method in the Loader heirarchy ! private static String aliasCore(String name, String suffix) { ! ! char quote = name.charAt(0); ! boolean nameEscaped = Dialect.QUOTE.indexOf(quote) > -1; ! ! if (nameEscaped) name = name.substring(1, name.length()-1); ! ! StringBuffer aliasBuilder = new StringBuffer(name.length()); ! ! if (nameEscaped) aliasBuilder.append(quote); ! aliasBuilder.append(name); ! aliasBuilder.append(suffix); ! if (nameEscaped) aliasBuilder.append(quote); ! ! return aliasBuilder.toString(); ! } ! } Index: SimpleEntityLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/SimpleEntityLoader.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SimpleEntityLoader.java 3 Jan 2003 13:36:01 -0000 1.2 --- SimpleEntityLoader.java 4 Jan 2003 11:15:29 -0000 1.3 *************** *** 30,42 **** this.lockMode = lockMode; } ! public String getSQLString() { return sql; } ! public Loadable[] getPersisters() { return persister; } ! public CollectionPersister getCollectionPersister() { return null; --- 30,42 ---- this.lockMode = lockMode; } ! public String getSQLString() { return sql; } ! public Loadable[] getPersisters() { return persister; } ! public CollectionPersister getCollectionPersister() { return null; *************** *** 63,67 **** } } - } --- 63,70 ---- } } + + + } + Index: UniqueEntityLoader.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/UniqueEntityLoader.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** UniqueEntityLoader.java 1 Jan 2003 13:56:11 -0000 1.1.1.1 --- UniqueEntityLoader.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 15,16 **** --- 15,19 ---- public Object load(SessionImplementor session, Serializable id, Object optionalObject) throws HibernateException, SQLException; } + + + |
From: <one...@us...> - 2003-01-04 11:16:03
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/lob In directory sc8-pr-cvs1:/tmp/cvs-serv14211/src/net/sf/hibernate/lob Modified Files: BlobImpl.java ClobImpl.java Log Message: reformatted code with beautiful, shiny, happy TABS! improved an exception Index: BlobImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/lob/BlobImpl.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** BlobImpl.java 1 Jan 2003 13:56:12 -0000 1.1.1.1 --- BlobImpl.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 19,23 **** this.bytes = bytes; } ! /** * @see java.sql.Blob#length() --- 19,23 ---- this.bytes = bytes; } ! /** * @see java.sql.Blob#length() *************** *** 26,30 **** return bytes.length; } ! /** * @see java.sql.Blob#truncate(long) --- 26,30 ---- return bytes.length; } ! /** * @see java.sql.Blob#truncate(long) *************** *** 33,37 **** excep(); } ! /** * @see java.sql.Blob#getBytes(long, int) --- 33,37 ---- excep(); } ! /** * @see java.sql.Blob#getBytes(long, int) *************** *** 40,44 **** excep(); return null; } ! /** * @see java.sql.Blob#setBytes(long, byte[]) --- 40,44 ---- excep(); return null; } ! /** * @see java.sql.Blob#setBytes(long, byte[]) *************** *** 47,59 **** excep(); return 0; } ! /** * @see java.sql.Blob#setBytes(long, byte[], int, int) */ public int setBytes(long arg0, byte[] arg1, int arg2, int arg3) ! throws SQLException { excep(); return 0; } ! /** * @see java.sql.Blob#position(byte[], long) --- 47,59 ---- excep(); return 0; } ! /** * @see java.sql.Blob#setBytes(long, byte[], int, int) */ public int setBytes(long arg0, byte[] arg1, int arg2, int arg3) ! throws SQLException { excep(); return 0; } ! /** * @see java.sql.Blob#position(byte[], long) *************** *** 62,66 **** excep(); return 0; } ! /** * @see java.sql.Blob#getBinaryStream() --- 62,66 ---- excep(); return 0; } ! /** * @see java.sql.Blob#getBinaryStream() *************** *** 69,73 **** return new ByteArrayInputStream(bytes); } ! /** * @see java.sql.Blob#setBinaryStream(long) --- 69,73 ---- return new ByteArrayInputStream(bytes); } ! /** * @see java.sql.Blob#setBinaryStream(long) *************** *** 76,80 **** excep(); return null; } ! /** * @see java.sql.Blob#position(Blob, long) --- 76,80 ---- excep(); return null; } ! /** * @see java.sql.Blob#position(Blob, long) *************** *** 87,90 **** throw new UnsupportedOperationException("Blob may not be manipulated from creating session"); } ! } --- 87,93 ---- throw new UnsupportedOperationException("Blob may not be manipulated from creating session"); } ! } + + + Index: ClobImpl.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/lob/ClobImpl.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ClobImpl.java 1 Jan 2003 13:56:12 -0000 1.1.1.1 --- ClobImpl.java 4 Jan 2003 11:15:29 -0000 1.2 *************** *** 22,26 **** return new String(chars); } ! /** * @see java.sql.Clob#length() --- 22,26 ---- return new String(chars); } ! /** * @see java.sql.Clob#length() *************** *** 29,33 **** return chars.length; } ! /** * @see java.sql.Clob#truncate(long) --- 29,33 ---- return chars.length; } ! /** * @see java.sql.Clob#truncate(long) *************** *** 36,40 **** excep(); } ! /** * @see java.sql.Clob#getAsciiStream() --- 36,40 ---- excep(); } ! /** * @see java.sql.Clob#getAsciiStream() *************** *** 43,47 **** return new StringBufferInputStream( new String(chars) ); } ! /** * @see java.sql.Clob#setAsciiStream(long) --- 43,47 ---- return new StringBufferInputStream( new String(chars) ); } ! /** * @see java.sql.Clob#setAsciiStream(long) *************** *** 50,54 **** excep(); return null; } ! /** * @see java.sql.Clob#getCharacterStream() --- 50,54 ---- excep(); return null; } ! /** * @see java.sql.Clob#getCharacterStream() *************** *** 57,61 **** return new CharArrayReader(chars); } ! /** * @see java.sql.Clob#setCharacterStream(long) --- 57,61 ---- return new CharArrayReader(chars); } ! /** * @see java.sql.Clob#setCharacterStream(long) *************** *** 64,68 **** excep(); return null; } ! /** * @see java.sql.Clob#getSubString(long, int) --- 64,68 ---- excep(); return null; } ! /** * @see java.sql.Clob#getSubString(long, int) *************** *** 71,75 **** excep(); return null; } ! /** * @see java.sql.Clob#setString(long, String) --- 71,75 ---- excep(); return null; } ! /** * @see java.sql.Clob#setString(long, String) *************** *** 78,90 **** excep(); return 0; } ! /** * @see java.sql.Clob#setString(long, String, int, int) */ public int setString(long arg0, String arg1, int arg2, int arg3) ! throws SQLException { excep(); return 0; } ! /** * @see java.sql.Clob#position(String, long) --- 78,90 ---- excep(); return 0; } ! /** * @see java.sql.Clob#setString(long, String, int, int) */ public int setString(long arg0, String arg1, int arg2, int arg3) ! throws SQLException { excep(); return 0; } ! /** * @see java.sql.Clob#position(String, long) *************** *** 93,97 **** excep(); return 0; } ! /** * @see java.sql.Clob#position(Clob, long) --- 93,97 ---- excep(); return 0; } ! /** * @see java.sql.Clob#position(Clob, long) *************** *** 100,108 **** excep(); return 0; } ! private void excep() { throw new UnsupportedOperationException("Blob may not be manipulated from creating session"); } ! } --- 100,111 ---- excep(); return 0; } ! private void excep() { throw new UnsupportedOperationException("Blob may not be manipulated from creating session"); } ! } + + + |