You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
(387) |
May
(1066) |
Jun
(689) |
Jul
(504) |
Aug
(697) |
Sep
(660) |
Oct
(591) |
Nov
(393) |
Dec
(324) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(567) |
Feb
(448) |
Mar
(461) |
Apr
(368) |
May
(887) |
Jun
(243) |
Jul
(429) |
Aug
(670) |
Sep
(648) |
Oct
(684) |
Nov
(599) |
Dec
(317) |
2008 |
Jan
(388) |
Feb
(400) |
Mar
(323) |
Apr
(214) |
May
(228) |
Jun
(120) |
Jul
(168) |
Aug
(64) |
Sep
(78) |
Oct
(127) |
Nov
(28) |
Dec
|
2009 |
Jan
|
Feb
(1) |
Mar
(22) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Thomas R. <tri...@us...> - 2006-04-20 12:18:50
|
Update of /cvsroot/springframework/spring/src/org/springframework/jdbc/core/namedparam In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1367/src/org/springframework/jdbc/core/namedparam Added Files: NamedParameterJdbcDaoSupport.java Log Message: added NamedParameterJdbcDaoSupport class --- NEW FILE: NamedParameterJdbcDaoSupport.java --- /* * Copyright 2002-2005 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.jdbc.core.namedparam; import javax.sql.DataSource; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.support.JdbcDaoSupport; /** * Extension of JdbcDaoSupport to expose a NamedParameterJdbcTemplate. * * @author Thomas Risberg * @author Rod Johnson * @author Juergen Hoeller * @since 2.0 * @see NamedParameterJdbcTemplate */ public class NamedParameterJdbcDaoSupport extends JdbcDaoSupport { private NamedParameterJdbcTemplate namedParameterJdbcTemplate; /** * Overridden to not only create a JdbcTemplate but also a NamedParameterJdbcTemplate. */ protected JdbcTemplate createJdbcTemplate(DataSource dataSource) { JdbcTemplate jt = new JdbcTemplate(dataSource); this.namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(jt); return jt; } /** * Return a NamedParameterJdbcTemplate wrapping the current JdbcTemplate. */ public NamedParameterJdbcTemplate getNamedParameterJdbcTemplate() { return namedParameterJdbcTemplate; } } |
From: Rick E. <spr...@us...> - 2006-04-20 11:27:56
|
Update of /cvsroot/springframework/spring/docs/reference/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28438/docs/reference/src Modified Files: jmx.xml Log Message: [SPR-1935] Added clarification that the MBeanExporter must not be lazily initialized if the exporting is to occur. Index: jmx.xml =================================================================== RCS file: /cvsroot/springframework/spring/docs/reference/src/jmx.xml,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** jmx.xml 18 Apr 2006 11:10:53 -0000 1.20 --- jmx.xml 20 Apr 2006 11:27:42 -0000 1.21 *************** *** 139,142 **** --- 139,146 ---- <bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean"/> + ]]><lineannotation><!-- + this bean needs to be eagerly pre-instantiated in order for the exporting to occur; + this means that it must <emphasis role="bold">not</emphasis> be marked as lazily initialized + --></lineannotation><![CDATA[ <bean id="exporter" class="org.springframework.jmx.export.MBeanExporter"> <property name="beans"> |
From: Rick E. <spr...@us...> - 2006-04-20 11:07:21
|
Update of /cvsroot/springframework/spring/docs/reference/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12825/docs/reference/src Modified Files: new-in-2.0.xml Log Message: [SPR-1928] Added link from the 'Whats new in 2.0' chapter to the new TaskExecutor section. Index: new-in-2.0.xml =================================================================== RCS file: /cvsroot/springframework/spring/docs/reference/src/new-in-2.0.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** new-in-2.0.xml 19 Apr 2006 16:58:59 -0000 1.5 --- new-in-2.0.xml 20 Apr 2006 11:07:01 -0000 1.6 *************** *** 304,316 **** <itemizedlist> <listitem> ! <para><xref linkend="jmx-exporting-registration-behavior" /></para> </listitem> <listitem> ! <para><xref linkend="jmx-notifications" /></para> </listitem> </itemizedlist> </section> <section id="new-in-2-other-tooling-spi"> <title>Tooling SPI</title> --- 304,324 ---- <itemizedlist> <listitem> ! <xref linkend="jmx-exporting-registration-behavior" /> </listitem> <listitem> ! <xref linkend="jmx-notifications" /> </listitem> </itemizedlist> </section> + <section id="new-in-2-other-taskexecutor"> + <title>Task scheduling</title> + + <para>Spring 2.0 offers an abstraction around the scheduling of tasks... + for the interested developer, the section entitled + <xref linkend="taskexecutor"/> contains all of the details.</para> + </section> + <section id="new-in-2-other-tooling-spi"> <title>Tooling SPI</title> *************** *** 339,346 **** </listitem> <listitem> ! <para><xref linkend="aspectj-atconfigurable"/></para> </listitem> <listitem> ! <para><xref linkend="aspectj-ataspectj"/></para> </listitem> </itemizedlist> --- 347,354 ---- </listitem> <listitem> ! <xref linkend="aspectj-atconfigurable"/> </listitem> <listitem> ! <xref linkend="aspectj-ataspectj"/> </listitem> </itemizedlist> |
From: Juergen H. <jho...@us...> - 2006-04-20 10:33:37
|
Update of /cvsroot/springframework/spring/src/org/springframework/jdbc/support In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18806/src/org/springframework/jdbc/support Modified Files: GeneratedKeyHolder.java Log Message: polishing Index: GeneratedKeyHolder.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/jdbc/support/GeneratedKeyHolder.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** GeneratedKeyHolder.java 26 Mar 2005 20:14:16 -0000 1.5 --- GeneratedKeyHolder.java 20 Apr 2006 10:33:29 -0000 1.6 *************** *** 1,11 **** /* ! * Copyright 2002-2005 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, --- 1,11 ---- /* ! * Copyright 2002-2006 the original author or authors. ! * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ! * * http://www.apache.org/licenses/LICENSE-2.0 ! * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, *************** *** 41,44 **** --- 41,45 ---- private final List keyList; + /** * Create a new GeneratedKeyHolder with a default list. *************** *** 56,59 **** --- 57,61 ---- } + public Number getKey() throws InvalidDataAccessApiUsageException, DataRetrievalFailureException { if (this.keyList.size() == 0) { |
From: Juergen H. <jho...@us...> - 2006-04-20 10:32:57
|
Update of /cvsroot/springframework/spring/src/org/springframework/jdbc/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18032/src/org/springframework/jdbc/core Modified Files: JdbcOperations.java Log Message: refined javadoc Index: JdbcOperations.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/jdbc/core/JdbcOperations.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** JdbcOperations.java 8 Apr 2006 20:50:08 -0000 1.37 --- JdbcOperations.java 20 Apr 2006 10:32:49 -0000 1.38 *************** *** 325,332 **** --- 325,335 ---- * Query using a prepared statement, reading the ResultSet with a * ResultSetExtractor. + * <p>A PreparedStatementCreator can either be implemented directly or + * configured through a PreparedStatementCreatorFactory. * @param psc object that can create a PreparedStatement given a Connection * @param rse object that will extract results * @return an arbitrary result object, as returned by the ResultSetExtractor * @throws DataAccessException if there is any problem + * @see PreparedStatementCreatorFactory */ Object query(PreparedStatementCreator psc, ResultSetExtractor rse) throws DataAccessException; *************** *** 379,385 **** --- 382,391 ---- * Query using a prepared statement, reading the ResultSet on a per-row * basis with a RowCallbackHandler. + * <p>A PreparedStatementCreator can either be implemented directly or + * configured through a PreparedStatementCreatorFactory. * @param psc object that can create a PreparedStatement given a Connection * @param rch object that will extract results, one row at a time * @throws DataAccessException if there is any problem + * @see PreparedStatementCreatorFactory */ void query(PreparedStatementCreator psc, RowCallbackHandler rch) throws DataAccessException; *************** *** 431,438 **** --- 437,447 ---- * Query using a prepared statement, mapping each row to a Java object * via a RowMapper. + * <p>A PreparedStatementCreator can either be implemented directly or + * configured through a PreparedStatementCreatorFactory. * @param psc object that can create a PreparedStatement given a Connection * @param rowMapper object that will map one object per row * @return the result List, containing mapped objects * @throws DataAccessException if there is any problem + * @see PreparedStatementCreatorFactory */ List query(PreparedStatementCreator psc, RowMapper rowMapper) throws DataAccessException; *************** *** 782,788 **** --- 791,800 ---- * Issue an update using a PreparedStatementCreator to provide SQL and any * required parameters. + * <p>A PreparedStatementCreator can either be implemented directly or + * configured through a PreparedStatementCreatorFactory. * @param psc object that provides SQL and any necessary parameters * @return the number of rows affected * @throws DataAccessException if there is any problem issuing the update + * @see PreparedStatementCreatorFactory */ int update(PreparedStatementCreator psc) throws DataAccessException; *************** *** 790,798 **** /** * Issue an update using a PreparedStatementCreator to provide SQL and any ! * required parameters. Generetaed keys will to be returned by the List parameter. * @param psc object that provides SQL and any necessary parameters * @param generatedKeyHolder KeyHolder that will hold the generated keys * @return the number of rows affected * @throws DataAccessException if there is any problem issuing the update */ int update(PreparedStatementCreator psc, KeyHolder generatedKeyHolder) throws DataAccessException; --- 802,815 ---- /** * Issue an update using a PreparedStatementCreator to provide SQL and any ! * required parameters. Generated keys will be put into the given KeyHolder. ! * <p>Note that the given PreparedStatementCreator has to create a statement ! * with activated extraction of generated keys (a JDBC 3.0 feature). This can ! * either be done directly or through using a PreparedStatementCreatorFactory. * @param psc object that provides SQL and any necessary parameters * @param generatedKeyHolder KeyHolder that will hold the generated keys * @return the number of rows affected * @throws DataAccessException if there is any problem issuing the update + * @see PreparedStatementCreatorFactory + * @see org.springframework.jdbc.support.GeneratedKeyHolder */ int update(PreparedStatementCreator psc, KeyHolder generatedKeyHolder) throws DataAccessException; *************** *** 803,807 **** * method will create the PreparedStatement: The PreparedStatementSetter * just needs to set parameters. ! * @param sql SQL, containing bind parameters * @param pss helper that sets bind parameters. If this is <code>null</code> * we run an update with static SQL. --- 820,824 ---- * method will create the PreparedStatement: The PreparedStatementSetter * just needs to set parameters. ! * @param sql SQL containing bind parameters * @param pss helper that sets bind parameters. If this is <code>null</code> * we run an update with static SQL. *************** *** 813,817 **** /** * Issue an update via a prepared statement, binding the given arguments. ! * @param sql SQL, containing bind parameters * @param args arguments to bind to the query * @param argTypes SQL types of the arguments --- 830,834 ---- /** * Issue an update via a prepared statement, binding the given arguments. ! * @param sql SQL containing bind parameters * @param args arguments to bind to the query * @param argTypes SQL types of the arguments *************** *** 825,829 **** /** * Issue an update via a prepared statement, binding the given arguments. ! * @param sql SQL, containing bind parameters * @param args arguments to bind to the query * (leaving it to the PreparedStatement to guess the corresponding SQL type) --- 842,846 ---- /** * Issue an update via a prepared statement, binding the given arguments. ! * @param sql SQL containing bind parameters * @param args arguments to bind to the query * (leaving it to the PreparedStatement to guess the corresponding SQL type) |
From: Juergen H. <jho...@us...> - 2006-04-20 10:32:18
|
Update of /cvsroot/springframework/spring/src/org/springframework/jdbc/core/namedparam In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17652/src/org/springframework/jdbc/core/namedparam Modified Files: NamedParameterJdbcOperations.java NamedParameterJdbcTemplate.java Log Message: refined KeyHolder-based operations Index: NamedParameterJdbcOperations.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/jdbc/core/namedparam/NamedParameterJdbcOperations.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NamedParameterJdbcOperations.java 10 Apr 2006 14:40:12 -0000 1.2 --- NamedParameterJdbcOperations.java 20 Apr 2006 10:32:10 -0000 1.3 *************** *** 51,54 **** --- 51,58 ---- + //------------------------------------------------------------------------- + // Query operations + //------------------------------------------------------------------------- + /** * Query given SQL to create a prepared statement from SQL and a list of *************** *** 377,383 **** SqlRowSet queryForRowSet(String sql, Map paramMap) throws DataAccessException; /** * Issue an update via a prepared statement, binding the given arguments. ! * @param sql SQL, containing bind parameters * @param paramSource container of arguments and SQL types to bind to the query * @return the number of rows affected --- 381,392 ---- SqlRowSet queryForRowSet(String sql, Map paramMap) throws DataAccessException; + + //------------------------------------------------------------------------- + // Update operations + //------------------------------------------------------------------------- + /** * Issue an update via a prepared statement, binding the given arguments. ! * @param sql SQL containing named parameters * @param paramSource container of arguments and SQL types to bind to the query * @return the number of rows affected *************** *** 388,392 **** /** * Issue an update via a prepared statement, binding the given arguments. ! * @param sql SQL, containing bind parameters * @param paramMap map of parameters to bind to the query * (leaving it to the PreparedStatement to guess the corresponding SQL type) --- 397,401 ---- /** * Issue an update via a prepared statement, binding the given arguments. ! * @param sql SQL containing named parameters * @param paramMap map of parameters to bind to the query * (leaving it to the PreparedStatement to guess the corresponding SQL type) *************** *** 396,410 **** int update(String sql, Map paramMap) throws DataAccessException; ! /** ! * Issue an update via a prepared statement, binding the given arguments. ! * @param sql SQL, containing bind parameters ! * @param paramSource container of arguments and SQL types to bind to the query ! * @param generatedKeyHolder KeyHolder that will hold the generated keys ! * @param keyColumnNames names of the columns that will have keys generated for them ! * @return the number of rows affected ! * @throws org.springframework.dao.DataAccessException if there is any problem issuing the update ! */ ! int update(String sql, SqlParameterSource paramSource, KeyHolder generatedKeyHolder, String[] keyColumnNames) throws DataAccessException; } --- 405,437 ---- int update(String sql, Map paramMap) throws DataAccessException; ! /** ! * Issue an update via a prepared statement, binding the given arguments, ! * returning generated keys. ! * @param sql SQL containing named parameters ! * @param paramSource container of arguments and SQL types to bind to the query ! * @param generatedKeyHolder KeyHolder that will hold the generated keys ! * @return the number of rows affected ! * @throws org.springframework.dao.DataAccessException if there is any problem issuing the update ! * @see SimpleSqlParameterSource ! * @see org.springframework.jdbc.support.GeneratedKeyHolder ! */ ! int update(String sql, SqlParameterSource paramSource, KeyHolder generatedKeyHolder) ! throws DataAccessException; + /** + * Issue an update via a prepared statement, binding the given arguments, + * returning generated keys. + * @param sql SQL containing named parameters + * @param paramSource container of arguments and SQL types to bind to the query + * @param generatedKeyHolder KeyHolder that will hold the generated keys + * @param keyColumnNames names of the columns that will have keys generated for them + * @return the number of rows affected + * @throws org.springframework.dao.DataAccessException if there is any problem issuing the update + * @see SimpleSqlParameterSource + * @see org.springframework.jdbc.support.GeneratedKeyHolder + */ + int update( + String sql, SqlParameterSource paramSource, KeyHolder generatedKeyHolder, String[] keyColumnNames) + throws DataAccessException; } Index: NamedParameterJdbcTemplate.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/jdbc/core/namedparam/NamedParameterJdbcTemplate.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NamedParameterJdbcTemplate.java 18 Apr 2006 10:04:24 -0000 1.3 --- NamedParameterJdbcTemplate.java 20 Apr 2006 10:32:10 -0000 1.4 *************** *** 24,30 **** import org.springframework.dao.DataAccessException; import org.springframework.dao.support.DataAccessUtils; ! import org.springframework.jdbc.core.*; ! import org.springframework.jdbc.support.rowset.SqlRowSet; import org.springframework.jdbc.support.KeyHolder; import org.springframework.util.Assert; --- 24,38 ---- import org.springframework.dao.DataAccessException; import org.springframework.dao.support.DataAccessUtils; ! import org.springframework.jdbc.core.ColumnMapRowMapper; ! import org.springframework.jdbc.core.JdbcOperations; ! import org.springframework.jdbc.core.JdbcTemplate; ! import org.springframework.jdbc.core.PreparedStatementCreatorFactory; ! import org.springframework.jdbc.core.RowCallbackHandler; ! import org.springframework.jdbc.core.RowMapper; ! import org.springframework.jdbc.core.RowMapperResultSetExtractor; ! import org.springframework.jdbc.core.SingleColumnRowMapper; ! import org.springframework.jdbc.core.SqlRowSetResultSetExtractor; import org.springframework.jdbc.support.KeyHolder; + import org.springframework.jdbc.support.rowset.SqlRowSet; import org.springframework.util.Assert; *************** *** 50,217 **** public class NamedParameterJdbcTemplate implements NamedParameterJdbcOperations { ! /** The JdbcTemplate we are wrapping */ ! private final JdbcOperations classicJdbcTemplate; ! /** ! * Create a new NamedParameterJdbcTemplate for the given {@link DataSource}. ! * <p>Creates a classic Spring {@link org.springframework.jdbc.core.JdbcTemplate} and wraps it. ! * @param dataSource the JDBC {@link DataSource} to access * @throws IllegalArgumentException if the given {@link DataSource} is <code>null</code> ! */ ! public NamedParameterJdbcTemplate(DataSource dataSource) { ! Assert.notNull(dataSource, "The [dataSource] argument cannot be null."); ! this.classicJdbcTemplate = new JdbcTemplate(dataSource); ! } ! /** ! * Create a new SimpleJdbcTemplate for the given classic Spring {@link org.springframework.jdbc.core.JdbcTemplate}. ! * @param classicJdbcTemplate the classic Spring {@link org.springframework.jdbc.core.JdbcTemplate} to wrap * @throws IllegalArgumentException if the given {@link org.springframework.jdbc.core.JdbcTemplate} is <code>null</code> ! */ ! public NamedParameterJdbcTemplate(JdbcOperations classicJdbcTemplate) { ! Assert.notNull(classicJdbcTemplate, "The [classicJdbcTemplate] argument cannot be null."); ! this.classicJdbcTemplate = classicJdbcTemplate; ! } ! /** ! * Expose the classic Spring JdbcTemplate to allow invocation of ! * less commonly used methods. ! */ ! public JdbcOperations getJdbcOperations() { ! return this.classicJdbcTemplate; ! } ! public void query(String sql, SqlParameterSource paramSource, RowCallbackHandler rch) ! throws DataAccessException { ! ParsedSql parsedSql = NamedParameterUtils.parseSqlStatement(sql); ! Object[] args = NamedParameterUtils.buildValueArray(parsedSql, paramSource); ! int[] argTypes = NamedParameterUtils.buildSqlTypeArray(parsedSql, paramSource); ! String sqlToUse = NamedParameterUtils.substituteNamedParameters(sql, paramSource); ! getJdbcOperations().query(sqlToUse, args, argTypes, rch); ! } ! public void query(String sql, Map paramMap, RowCallbackHandler rch) throws DataAccessException { ! query(sql, new SimpleSqlParameterSource(paramMap), rch); ! } ! public List query(String sql, SqlParameterSource paramSource, RowMapper rowMapper) ! throws DataAccessException { ! ParsedSql parsedSql = NamedParameterUtils.parseSqlStatement(sql); ! Object[] args = NamedParameterUtils.buildValueArray(parsedSql, paramSource); ! int[] argTypes = NamedParameterUtils.buildSqlTypeArray(parsedSql, paramSource); ! String sqlToUse = NamedParameterUtils.substituteNamedParameters(sql, paramSource); ! return (List) getJdbcOperations().query( ! sqlToUse, args, argTypes, new RowMapperResultSetExtractor(rowMapper)); ! } ! public List query(String sql, Map paramMap, RowMapper rowMapper) throws DataAccessException { ! return query(sql, new SimpleSqlParameterSource(paramMap), rowMapper); ! } ! public Object queryForObject(String sql, SqlParameterSource paramSource, RowMapper rowMapper) ! throws DataAccessException { ! ParsedSql parsedSql = NamedParameterUtils.parseSqlStatement(sql); ! Object[] args = NamedParameterUtils.buildValueArray(parsedSql, paramSource); ! int[] argTypes = NamedParameterUtils.buildSqlTypeArray(parsedSql, paramSource); ! String sqlToUse = NamedParameterUtils.substituteNamedParameters(sql, paramSource); ! List results = (List) getJdbcOperations().query( ! sqlToUse, args, argTypes, new RowMapperResultSetExtractor(rowMapper, 1)); ! return DataAccessUtils.requiredUniqueResult(results); ! } ! public Object queryForObject(String sql, Map paramMap, RowMapper rowMapper) throws DataAccessException { ! return queryForObject(sql, new SimpleSqlParameterSource(paramMap), rowMapper); ! } ! public Object queryForObject(String sql, SqlParameterSource paramSource, Class requiredType) ! throws DataAccessException { ! return queryForObject(sql, paramSource, new SingleColumnRowMapper(requiredType)); ! } ! public Object queryForObject(String sql, Map paramMap, Class requiredType) throws DataAccessException { ! return queryForObject(sql, paramMap, new SingleColumnRowMapper(requiredType)); ! } ! public Map queryForMap(String sql, SqlParameterSource paramSource) throws DataAccessException { ! return (Map) queryForObject(sql, paramSource, new ColumnMapRowMapper()); ! } ! public Map queryForMap(String sql, Map paramMap) throws DataAccessException { ! return (Map) queryForObject(sql, paramMap, new ColumnMapRowMapper()); ! } ! public long queryForLong(String sql, SqlParameterSource paramSource) throws DataAccessException { ! Number number = (Number) queryForObject(sql, paramSource, Number.class); ! return (number != null ? number.longValue() : 0); ! } ! public long queryForLong(String sql, Map paramMap) throws DataAccessException { ! return queryForLong(sql, new SimpleSqlParameterSource(paramMap)); ! } ! public int queryForInt(String sql, SqlParameterSource paramSource) throws DataAccessException { ! Number number = (Number) queryForObject(sql, paramSource, Number.class); ! return (number != null ? number.intValue() : 0); ! } ! public int queryForInt(String sql, Map paramMap) throws DataAccessException { ! return queryForInt(sql, new SimpleSqlParameterSource(paramMap)); ! } ! public List queryForList(String sql, SqlParameterSource paramSource, Class elementType) ! throws DataAccessException { ! return query(sql, paramSource, new SingleColumnRowMapper(elementType)); ! } ! public List queryForList(String sql, Map paramMap, Class elementType) throws DataAccessException { ! return queryForList(sql, new SimpleSqlParameterSource(paramMap), elementType); ! } ! public List queryForList(String sql, SqlParameterSource paramSource) throws DataAccessException { ! return query(sql, paramSource, new ColumnMapRowMapper()); ! } ! public List queryForList(String sql, Map paramMap) throws DataAccessException { ! return queryForList(sql, new SimpleSqlParameterSource(paramMap)); ! } ! public SqlRowSet queryForRowSet(String sql, SqlParameterSource paramSource) throws DataAccessException { ! ParsedSql parsedSql = NamedParameterUtils.parseSqlStatement(sql); ! Object[] args = NamedParameterUtils.buildValueArray(parsedSql, paramSource); ! int[] argTypes = NamedParameterUtils.buildSqlTypeArray(parsedSql, paramSource); ! String sqlToUse = NamedParameterUtils.substituteNamedParameters(sql, paramSource); ! return (SqlRowSet) getJdbcOperations().query(sqlToUse, args, argTypes, new SqlRowSetResultSetExtractor()); ! } ! public SqlRowSet queryForRowSet(String sql, Map paramMap) throws DataAccessException { ! return queryForRowSet(sql, new SimpleSqlParameterSource(paramMap)); ! } ! public int update(String sql, SqlParameterSource paramSource) throws DataAccessException { ! ParsedSql parsedSql = NamedParameterUtils.parseSqlStatement(sql); ! Object[] args = NamedParameterUtils.buildValueArray(parsedSql, paramSource); ! int[] argTypes = NamedParameterUtils.buildSqlTypeArray(parsedSql, paramSource); ! String sqlToUse = NamedParameterUtils.substituteNamedParameters(sql, paramSource); ! return getJdbcOperations().update(sqlToUse, args, argTypes); ! } ! public int update(String sql, Map paramMap) throws DataAccessException { ! return update(sql, new SimpleSqlParameterSource(paramMap)); ! } ! public int update(String sql, SqlParameterSource paramSource, KeyHolder keyHolder, String[] keyColumnNames) { ! ParsedSql parsedSql = NamedParameterUtils.parseSqlStatement(sql); ! Object[] args = NamedParameterUtils.buildValueArray(parsedSql, paramSource); ! int[] argTypes = NamedParameterUtils.buildSqlTypeArray(parsedSql, paramSource); ! String sqlToUse = NamedParameterUtils.substituteNamedParameters(sql, paramSource); ! PreparedStatementCreatorFactory pscf = new PreparedStatementCreatorFactory(sqlToUse, argTypes); ! pscf.setReturnGeneratedKeys(true); ! if (keyColumnNames != null) { ! pscf.setGeneratedKeysColumnNames(keyColumnNames); ! } ! return getJdbcOperations().update(pscf.newPreparedStatementCreator(args), keyHolder); ! } } --- 58,250 ---- public class NamedParameterJdbcTemplate implements NamedParameterJdbcOperations { ! /** ! * The JdbcTemplate we are wrapping ! */ ! private final JdbcOperations classicJdbcTemplate; ! /** ! * Create a new NamedParameterJdbcTemplate for the given {@link DataSource}. ! * <p>Creates a classic Spring {@link org.springframework.jdbc.core.JdbcTemplate} and wraps it. ! * @param dataSource the JDBC {@link DataSource} to access * @throws IllegalArgumentException if the given {@link DataSource} is <code>null</code> ! */ ! public NamedParameterJdbcTemplate(DataSource dataSource) { ! Assert.notNull(dataSource, "The [dataSource] argument cannot be null."); ! this.classicJdbcTemplate = new JdbcTemplate(dataSource); ! } ! /** ! * Create a new SimpleJdbcTemplate for the given classic Spring {@link org.springframework.jdbc.core.JdbcTemplate}. ! * @param classicJdbcTemplate the classic Spring {@link org.springframework.jdbc.core.JdbcTemplate} to wrap * @throws IllegalArgumentException if the given {@link org.springframework.jdbc.core.JdbcTemplate} is <code>null</code> ! */ ! public NamedParameterJdbcTemplate(JdbcOperations classicJdbcTemplate) { ! Assert.notNull(classicJdbcTemplate, "The [classicJdbcTemplate] argument cannot be null."); ! this.classicJdbcTemplate = classicJdbcTemplate; ! } ! /** ! * Expose the classic Spring JdbcTemplate to allow invocation of ! * less commonly used methods. ! */ ! public JdbcOperations getJdbcOperations() { ! return this.classicJdbcTemplate; ! } ! //------------------------------------------------------------------------- ! // Query operations ! //------------------------------------------------------------------------- ! public void query(String sql, SqlParameterSource paramSource, RowCallbackHandler rch) ! throws DataAccessException { ! ParsedSql parsedSql = NamedParameterUtils.parseSqlStatement(sql); ! Object[] args = NamedParameterUtils.buildValueArray(parsedSql, paramSource); ! int[] argTypes = NamedParameterUtils.buildSqlTypeArray(parsedSql, paramSource); ! String sqlToUse = NamedParameterUtils.substituteNamedParameters(sql, paramSource); ! getJdbcOperations().query(sqlToUse, args, argTypes, rch); ! } ! public void query(String sql, Map paramMap, RowCallbackHandler rch) throws DataAccessException { ! query(sql, new SimpleSqlParameterSource(paramMap), rch); ! } ! public List query(String sql, SqlParameterSource paramSource, RowMapper rowMapper) ! throws DataAccessException { ! ParsedSql parsedSql = NamedParameterUtils.parseSqlStatement(sql); ! Object[] args = NamedParameterUtils.buildValueArray(parsedSql, paramSource); ! int[] argTypes = NamedParameterUtils.buildSqlTypeArray(parsedSql, paramSource); ! String sqlToUse = NamedParameterUtils.substituteNamedParameters(sql, paramSource); ! return (List) getJdbcOperations().query( ! sqlToUse, args, argTypes, new RowMapperResultSetExtractor(rowMapper)); ! } ! public List query(String sql, Map paramMap, RowMapper rowMapper) throws DataAccessException { ! return query(sql, new SimpleSqlParameterSource(paramMap), rowMapper); ! } ! public Object queryForObject(String sql, SqlParameterSource paramSource, RowMapper rowMapper) ! throws DataAccessException { ! ParsedSql parsedSql = NamedParameterUtils.parseSqlStatement(sql); ! Object[] args = NamedParameterUtils.buildValueArray(parsedSql, paramSource); ! int[] argTypes = NamedParameterUtils.buildSqlTypeArray(parsedSql, paramSource); ! String sqlToUse = NamedParameterUtils.substituteNamedParameters(sql, paramSource); ! List results = (List) getJdbcOperations().query( ! sqlToUse, args, argTypes, new RowMapperResultSetExtractor(rowMapper, 1)); ! return DataAccessUtils.requiredUniqueResult(results); ! } ! public Object queryForObject(String sql, Map paramMap, RowMapper rowMapper) throws DataAccessException { ! return queryForObject(sql, new SimpleSqlParameterSource(paramMap), rowMapper); ! } ! public Object queryForObject(String sql, SqlParameterSource paramSource, Class requiredType) ! throws DataAccessException { ! return queryForObject(sql, paramSource, new SingleColumnRowMapper(requiredType)); ! } ! public Object queryForObject(String sql, Map paramMap, Class requiredType) throws DataAccessException { ! return queryForObject(sql, paramMap, new SingleColumnRowMapper(requiredType)); ! } ! public Map queryForMap(String sql, SqlParameterSource paramSource) throws DataAccessException { ! return (Map) queryForObject(sql, paramSource, new ColumnMapRowMapper()); ! } ! public Map queryForMap(String sql, Map paramMap) throws DataAccessException { ! return (Map) queryForObject(sql, paramMap, new ColumnMapRowMapper()); ! } ! public long queryForLong(String sql, SqlParameterSource paramSource) throws DataAccessException { ! Number number = (Number) queryForObject(sql, paramSource, Number.class); ! return (number != null ? number.longValue() : 0); ! } ! public long queryForLong(String sql, Map paramMap) throws DataAccessException { ! return queryForLong(sql, new SimpleSqlParameterSource(paramMap)); ! } ! public int queryForInt(String sql, SqlParameterSource paramSource) throws DataAccessException { ! Number number = (Number) queryForObject(sql, paramSource, Number.class); ! return (number != null ? number.intValue() : 0); ! } ! public int queryForInt(String sql, Map paramMap) throws DataAccessException { ! return queryForInt(sql, new SimpleSqlParameterSource(paramMap)); ! } ! public List queryForList(String sql, SqlParameterSource paramSource, Class elementType) ! throws DataAccessException { ! return query(sql, paramSource, new SingleColumnRowMapper(elementType)); ! } ! public List queryForList(String sql, Map paramMap, Class elementType) throws DataAccessException { ! return queryForList(sql, new SimpleSqlParameterSource(paramMap), elementType); ! } ! public List queryForList(String sql, SqlParameterSource paramSource) throws DataAccessException { ! return query(sql, paramSource, new ColumnMapRowMapper()); ! } ! public List queryForList(String sql, Map paramMap) throws DataAccessException { ! return queryForList(sql, new SimpleSqlParameterSource(paramMap)); ! } ! public SqlRowSet queryForRowSet(String sql, SqlParameterSource paramSource) throws DataAccessException { ! ParsedSql parsedSql = NamedParameterUtils.parseSqlStatement(sql); ! Object[] args = NamedParameterUtils.buildValueArray(parsedSql, paramSource); ! int[] argTypes = NamedParameterUtils.buildSqlTypeArray(parsedSql, paramSource); ! String sqlToUse = NamedParameterUtils.substituteNamedParameters(sql, paramSource); ! return (SqlRowSet) getJdbcOperations().query(sqlToUse, args, argTypes, new SqlRowSetResultSetExtractor()); ! } ! ! public SqlRowSet queryForRowSet(String sql, Map paramMap) throws DataAccessException { ! return queryForRowSet(sql, new SimpleSqlParameterSource(paramMap)); ! } ! ! ! //------------------------------------------------------------------------- ! // Update operations ! //------------------------------------------------------------------------- ! ! public int update(String sql, SqlParameterSource paramSource) throws DataAccessException { ! ParsedSql parsedSql = NamedParameterUtils.parseSqlStatement(sql); ! Object[] args = NamedParameterUtils.buildValueArray(parsedSql, paramSource); ! int[] argTypes = NamedParameterUtils.buildSqlTypeArray(parsedSql, paramSource); ! String sqlToUse = NamedParameterUtils.substituteNamedParameters(sql, paramSource); ! return getJdbcOperations().update(sqlToUse, args, argTypes); ! } ! ! public int update(String sql, Map paramMap) throws DataAccessException { ! return update(sql, new SimpleSqlParameterSource(paramMap)); ! } ! ! public int update(String sql, SqlParameterSource paramSource, KeyHolder generatedKeyHolder) ! throws DataAccessException { ! ! return update(sql, paramSource, generatedKeyHolder, null); ! } ! ! public int update( ! String sql, SqlParameterSource paramSource, KeyHolder generatedKeyHolder, String[] keyColumnNames) ! throws DataAccessException { ! ! ParsedSql parsedSql = NamedParameterUtils.parseSqlStatement(sql); ! Object[] args = NamedParameterUtils.buildValueArray(parsedSql, paramSource); ! int[] argTypes = NamedParameterUtils.buildSqlTypeArray(parsedSql, paramSource); ! String sqlToUse = NamedParameterUtils.substituteNamedParameters(sql, paramSource); ! PreparedStatementCreatorFactory pscf = new PreparedStatementCreatorFactory(sqlToUse, argTypes); ! if (keyColumnNames != null) { ! pscf.setGeneratedKeysColumnNames(keyColumnNames); ! } ! else { ! pscf.setReturnGeneratedKeys(true); ! } ! return getJdbcOperations().update(pscf.newPreparedStatementCreator(args), generatedKeyHolder); ! } } |
From: Juergen H. <jho...@us...> - 2006-04-20 10:12:19
|
Update of /cvsroot/springframework/spring/src/org/springframework/jdbc/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1828/src/org/springframework/jdbc/core Modified Files: JdbcTemplate.java Added Files: ArgPreparedStatementSetter.java ArgTypePreparedStatementSetter.java Log Message: logging of ignored SQLWarnings, including SQL state and error code in the log output; factored out PreparedStatementSetter impls to package-protected classes --- NEW FILE: ArgTypePreparedStatementSetter.java --- /* * Copyright 2002-2006 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.jdbc.core; import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Types; import java.util.Collection; import java.util.Iterator; import org.springframework.dao.InvalidDataAccessApiUsageException; /** * Simple adapter for PreparedStatementSetter that applies * given arrays of arguments and JDBC argument types. * * @author Juergen Hoeller */ class ArgTypePreparedStatementSetter implements PreparedStatementSetter, ParameterDisposer { private final Object[] args; private final int[] argTypes; /** * Create a new ArgTypePreparedStatementSetter for the given arguments. * @param args * @param argTypes */ public ArgTypePreparedStatementSetter(Object[] args, int[] argTypes) { if ((args != null && argTypes == null) || (args == null && argTypes != null) || (args != null && args.length != argTypes.length)) { throw new InvalidDataAccessApiUsageException("args and argTypes parameters must match"); } this.args = args; this.argTypes = argTypes; } public void setValues(PreparedStatement ps) throws SQLException { int argIndx = 1; if (this.args != null) { for (int i = 0; i < this.args.length; i++) { Object arg = this.args[i]; if (arg instanceof Collection && this.argTypes[i] != Types.ARRAY) { Collection entries = (Collection) arg; for (Iterator it = entries.iterator(); it.hasNext();) { Object entry = it.next(); StatementCreatorUtils.setParameterValue(ps, argIndx++, this.argTypes[i], null, entry); } } else { StatementCreatorUtils.setParameterValue(ps, argIndx++, this.argTypes[i], null, arg); } } } } public void cleanupParameters() { StatementCreatorUtils.cleanupParameters(this.args); } } --- NEW FILE: ArgPreparedStatementSetter.java --- /* * Copyright 2002-2006 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.jdbc.core; import java.sql.PreparedStatement; import java.sql.SQLException; /** * Simple adapter for PreparedStatementSetter that applies * a given array of arguments. * * @author Juergen Hoeller */ class ArgPreparedStatementSetter implements PreparedStatementSetter, ParameterDisposer { private final Object[] args; public ArgPreparedStatementSetter(Object[] args) { this.args = args; } public void setValues(PreparedStatement ps) throws SQLException { if (this.args != null) { for (int i = 0; i < this.args.length; i++) { StatementCreatorUtils.setParameterValue(ps, i + 1, SqlTypeValue.TYPE_UNKNOWN, null, this.args[i]); } } } public void cleanupParameters() { StatementCreatorUtils.cleanupParameters(this.args); } } Index: JdbcTemplate.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/jdbc/core/JdbcTemplate.java,v retrieving revision 1.117 retrieving revision 1.118 diff -C2 -d -r1.117 -r1.118 *** JdbcTemplate.java 10 Apr 2006 04:57:05 -0000 1.117 --- JdbcTemplate.java 20 Apr 2006 10:12:09 -0000 1.118 *************** *** 21,26 **** import java.lang.reflect.Method; import java.lang.reflect.Proxy; ! import java.sql.*; ! import java.util.*; import javax.sql.DataSource; --- 21,34 ---- import java.lang.reflect.Method; import java.lang.reflect.Proxy; ! import java.sql.CallableStatement; ! import java.sql.Connection; ! import java.sql.PreparedStatement; ! import java.sql.ResultSet; ! import java.sql.SQLException; ! import java.sql.SQLWarning; ! import java.sql.Statement; ! import java.util.HashMap; ! import java.util.List; ! import java.util.Map; import javax.sql.DataSource; *************** *** 37,40 **** --- 45,49 ---- import org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor; import org.springframework.jdbc.support.rowset.SqlRowSet; + import org.springframework.util.Assert; /** *************** *** 309,315 **** public Object query(final String sql, final ResultSetExtractor rse) throws DataAccessException { ! if (sql == null) { ! throw new InvalidDataAccessApiUsageException("SQL must not be null"); ! } if (logger.isDebugEnabled()) { logger.debug("Executing SQL query [" + sql + "]"); --- 318,322 ---- public Object query(final String sql, final ResultSetExtractor rse) throws DataAccessException { ! Assert.notNull(sql, "SQL must not be null"); if (logger.isDebugEnabled()) { logger.debug("Executing SQL query [" + sql + "]"); *************** *** 381,387 **** public int update(final String sql) throws DataAccessException { ! if (sql == null) { ! throw new InvalidDataAccessApiUsageException("SQL must not be null"); ! } if (logger.isDebugEnabled()) { logger.debug("Executing SQL update [" + sql + "]"); --- 388,392 ---- public int update(final String sql) throws DataAccessException { ! Assert.notNull(sql, "SQL must not be null"); if (logger.isDebugEnabled()) { logger.debug("Executing SQL update [" + sql + "]"); *************** *** 403,409 **** public int[] batchUpdate(final String[] sql) throws DataAccessException { ! if (sql == null) { ! throw new InvalidDataAccessApiUsageException("SQL must not be null"); ! } if (logger.isDebugEnabled()) { logger.debug("Executing SQL batch update of " + sql.length + " statements"); --- 408,412 ---- public int[] batchUpdate(final String[] sql) throws DataAccessException { ! Assert.notNull(sql, "SQL must not be null"); if (logger.isDebugEnabled()) { logger.debug("Executing SQL batch update of " + sql.length + " statements"); *************** *** 542,555 **** } ! public Object query(String sql, PreparedStatementSetter pss, final ResultSetExtractor rse) ! throws DataAccessException { ! if (sql == null) { ! throw new InvalidDataAccessApiUsageException("SQL may not be null"); ! } return query(new SimplePreparedStatementCreator(sql), pss, rse); } ! public Object query(String sql, Object[] args, int[] argTypes, ResultSetExtractor rse) ! throws DataAccessException { return query(sql, new ArgTypePreparedStatementSetter(args, argTypes), rse); } --- 545,553 ---- } ! public Object query(String sql, PreparedStatementSetter pss, ResultSetExtractor rse) throws DataAccessException { return query(new SimplePreparedStatementCreator(sql), pss, rse); } ! public Object query(String sql, Object[] args, int[] argTypes, ResultSetExtractor rse) throws DataAccessException { return query(sql, new ArgTypePreparedStatementSetter(args, argTypes), rse); } *************** *** 563,598 **** } ! public void query(String sql, PreparedStatementSetter pss, final RowCallbackHandler rch) ! throws DataAccessException { query(sql, pss, new RowCallbackHandlerResultSetExtractor(rch)); } ! public void query(String sql, Object[] args, int[] argTypes, RowCallbackHandler rch) ! throws DataAccessException { query(sql, new ArgTypePreparedStatementSetter(args, argTypes), rch); } ! public void query(String sql, Object[] args, RowCallbackHandler rch) ! throws DataAccessException { query(sql, new ArgPreparedStatementSetter(args), rch); } ! public List query(PreparedStatementCreator psc, RowMapper rowMapper) ! throws DataAccessException { return (List) query(psc, new RowMapperResultSetExtractor(rowMapper)); } ! public List query(String sql, PreparedStatementSetter pss, RowMapper rowMapper) ! throws DataAccessException { return (List) query(sql, pss, new RowMapperResultSetExtractor(rowMapper)); } ! public List query(String sql, Object[] args, int[] argTypes, RowMapper rowMapper) ! throws DataAccessException { return (List) query(sql, args, argTypes, new RowMapperResultSetExtractor(rowMapper)); } ! public List query(String sql, Object[] args, RowMapper rowMapper) ! throws DataAccessException { return (List) query(sql, args, new RowMapperResultSetExtractor(rowMapper)); } --- 561,589 ---- } ! public void query(String sql, PreparedStatementSetter pss, RowCallbackHandler rch) throws DataAccessException { query(sql, pss, new RowCallbackHandlerResultSetExtractor(rch)); } ! public void query(String sql, Object[] args, int[] argTypes, RowCallbackHandler rch) throws DataAccessException { query(sql, new ArgTypePreparedStatementSetter(args, argTypes), rch); } ! public void query(String sql, Object[] args, RowCallbackHandler rch) throws DataAccessException { query(sql, new ArgPreparedStatementSetter(args), rch); } ! public List query(PreparedStatementCreator psc, RowMapper rowMapper) throws DataAccessException { return (List) query(psc, new RowMapperResultSetExtractor(rowMapper)); } ! public List query(String sql, PreparedStatementSetter pss, RowMapper rowMapper) throws DataAccessException { return (List) query(sql, pss, new RowMapperResultSetExtractor(rowMapper)); } ! public List query(String sql, Object[] args, int[] argTypes, RowMapper rowMapper) throws DataAccessException { return (List) query(sql, args, argTypes, new RowMapperResultSetExtractor(rowMapper)); } ! public List query(String sql, Object[] args, RowMapper rowMapper) throws DataAccessException { return (List) query(sql, args, new RowMapperResultSetExtractor(rowMapper)); } *************** *** 600,603 **** --- 591,595 ---- public Object queryForObject(String sql, Object[] args, int[] argTypes, RowMapper rowMapper) throws DataAccessException { + List results = (List) query(sql, args, argTypes, new RowMapperResultSetExtractor(rowMapper, 1)); return DataAccessUtils.requiredUniqueResult(results); *************** *** 611,614 **** --- 603,607 ---- public Object queryForObject(String sql, Object[] args, int[] argTypes, Class requiredType) throws DataAccessException { + return queryForObject(sql, args, argTypes, getSingleColumnRowMapper(requiredType)); } *************** *** 646,655 **** } ! public List queryForList(String sql, Object[] args, int[] argTypes, Class elementType) ! throws DataAccessException { return query(sql, args, argTypes, getSingleColumnRowMapper(elementType)); } ! public List queryForList(String sql, final Object[] args, Class elementType) throws DataAccessException { return query(sql, args, getSingleColumnRowMapper(elementType)); } --- 639,647 ---- } ! public List queryForList(String sql, Object[] args, int[] argTypes, Class elementType) throws DataAccessException { return query(sql, args, argTypes, getSingleColumnRowMapper(elementType)); } ! public List queryForList(String sql, Object[] args, Class elementType) throws DataAccessException { return query(sql, args, getSingleColumnRowMapper(elementType)); } *************** *** 659,671 **** } ! public List queryForList(String sql, final Object[] args) throws DataAccessException { return query(sql, args, getColumnMapRowMapper()); } ! public SqlRowSet queryForRowSet(String sql, final Object[] args, int[] argTypes) throws DataAccessException { return (SqlRowSet) query(sql, args, argTypes, new SqlRowSetResultSetExtractor()); } ! public SqlRowSet queryForRowSet(String sql, final Object[] args) throws DataAccessException { return (SqlRowSet) query(sql, args, new SqlRowSetResultSetExtractor()); } --- 651,663 ---- } ! public List queryForList(String sql, Object[] args) throws DataAccessException { return query(sql, args, getColumnMapRowMapper()); } ! public SqlRowSet queryForRowSet(String sql, Object[] args, int[] argTypes) throws DataAccessException { return (SqlRowSet) query(sql, args, argTypes, new SqlRowSetResultSetExtractor()); } ! public SqlRowSet queryForRowSet(String sql, Object[] args) throws DataAccessException { return (SqlRowSet) query(sql, args, new SqlRowSetResultSetExtractor()); } *************** *** 736,748 **** } ! public int update(String sql, final PreparedStatementSetter pss) throws DataAccessException { return update(new SimplePreparedStatementCreator(sql), pss); } ! public int update(String sql, final Object[] args, final int[] argTypes) throws DataAccessException { return update(sql, new ArgTypePreparedStatementSetter(args, argTypes)); } ! public int update(String sql, final Object[] args) throws DataAccessException { return update(sql, new ArgPreparedStatementSetter(args)); } --- 728,740 ---- } ! public int update(String sql, PreparedStatementSetter pss) throws DataAccessException { return update(new SimplePreparedStatementCreator(sql), pss); } ! public int update(String sql, Object[] args, int[] argTypes) throws DataAccessException { return update(sql, new ArgTypePreparedStatementSetter(args, argTypes)); } ! public int update(String sql, Object[] args) throws DataAccessException { return update(sql, new ArgPreparedStatementSetter(args)); } *************** *** 834,838 **** } ! public Object execute(final String callString, CallableStatementCallback action) throws DataAccessException { return execute(new SimpleCallableStatementCreator(callString), action); } --- 826,830 ---- } ! public Object execute(String callString, CallableStatementCallback action) throws DataAccessException { return execute(new SimpleCallableStatementCreator(callString), action); } *************** *** 1023,1027 **** if (isIgnoreWarnings()) { if (logger.isWarnEnabled()) { ! logger.warn("SQLWarning ignored: " + warning); } } --- 1015,1020 ---- if (isIgnoreWarnings()) { if (logger.isWarnEnabled()) { ! logger.warn("SQLWarning ignored: SQL state '" + warning.getSQLState() + "', error code '" + ! warning.getErrorCode() + "', message [" + warning.getMessage() + "]"); } } *************** *** 1104,1113 **** * Simple adapter for PreparedStatementCreator, allowing to use a plain SQL statement. */ ! private static class SimplePreparedStatementCreator ! implements PreparedStatementCreator, SqlProvider { private final String sql; public SimplePreparedStatementCreator(String sql) { this.sql = sql; } --- 1097,1106 ---- * Simple adapter for PreparedStatementCreator, allowing to use a plain SQL statement. */ ! private static class SimplePreparedStatementCreator implements PreparedStatementCreator, SqlProvider { private final String sql; public SimplePreparedStatementCreator(String sql) { + Assert.notNull(sql, "SQL must not be null"); this.sql = sql; } *************** *** 1126,1135 **** * Simple adapter for CallableStatementCreator, allowing to use a plain SQL statement. */ ! private static class SimpleCallableStatementCreator ! implements CallableStatementCreator, SqlProvider { private final String callString; public SimpleCallableStatementCreator(String callString) { this.callString = callString; } --- 1119,1128 ---- * Simple adapter for CallableStatementCreator, allowing to use a plain SQL statement. */ ! private static class SimpleCallableStatementCreator implements CallableStatementCreator, SqlProvider { private final String callString; public SimpleCallableStatementCreator(String callString) { + Assert.notNull(callString, "Call string must not be null"); this.callString = callString; } *************** *** 1147,1220 **** /** - * Simple adapter for PreparedStatementSetter that applies - * a given array of arguments. - */ - private static class ArgPreparedStatementSetter implements PreparedStatementSetter, ParameterDisposer { - - private final Object[] args; - - public ArgPreparedStatementSetter(Object[] args) { - this.args = args; - } - - public void setValues(PreparedStatement ps) throws SQLException { - if (this.args != null) { - for (int i = 0; i < this.args.length; i++) { - StatementCreatorUtils.setParameterValue(ps, i + 1, SqlTypeValue.TYPE_UNKNOWN, null, this.args[i]); - } - } - } - - public void cleanupParameters() { - StatementCreatorUtils.cleanupParameters(this.args); - } - } - - - /** - * Simple adapter for PreparedStatementSetter that applies - * given arrays of arguments and JDBC argument types. - */ - private static class ArgTypePreparedStatementSetter implements PreparedStatementSetter, ParameterDisposer { - - private final Object[] args; - - private final int[] argTypes; - - public ArgTypePreparedStatementSetter(Object[] args, int[] argTypes) { - if ((args != null && argTypes == null) || (args == null && argTypes != null) || - (args != null && args.length != argTypes.length)) { - throw new InvalidDataAccessApiUsageException("args and argTypes parameters must match"); - } - this.args = args; - this.argTypes = argTypes; - } - - public void setValues(PreparedStatement ps) throws SQLException { - int argIndx = 1; - if (this.args != null) { - for (int i = 0; i < this.args.length; i++) { - Object arg = this.args[i]; - if (arg instanceof Collection && this.argTypes[i] != Types.ARRAY) { - Collection entries = (Collection) arg; - for (Iterator it = entries.iterator(); it.hasNext();) { - Object entry = it.next(); - StatementCreatorUtils.setParameterValue(ps, argIndx++, this.argTypes[i], null, entry); - } - } - else { - StatementCreatorUtils.setParameterValue(ps, argIndx++, this.argTypes[i], null, arg); - } - } - } - } - - public void cleanupParameters() { - StatementCreatorUtils.cleanupParameters(this.args); - } - } - - - /** * Adapter to enable use of a RowCallbackHandler inside a ResultSetExtractor. * <p>Uses a regular ResultSet, so we have to be careful when using it: --- 1140,1143 ---- |
From: Juergen H. <jho...@us...> - 2006-04-20 09:54:47
|
Update of /cvsroot/springframework/spring/src/org/springframework/jdbc/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21313/src/org/springframework/jdbc/core Modified Files: PreparedStatementCreatorFactory.java Log Message: generatedKeyColumnNames is sufficient (no returnGeneratedKeys necessary), only expand Collection for SQL type other than ARRAY Index: PreparedStatementCreatorFactory.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/jdbc/core/PreparedStatementCreatorFactory.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** PreparedStatementCreatorFactory.java 8 Apr 2006 20:53:16 -0000 1.28 --- PreparedStatementCreatorFactory.java 20 Apr 2006 09:54:45 -0000 1.29 *************** *** 21,24 **** --- 21,25 ---- import java.sql.ResultSet; import java.sql.SQLException; + import java.sql.Types; import java.util.Arrays; import java.util.Collection; *************** *** 157,161 **** */ public PreparedStatementCreator newPreparedStatementCreator(Object[] params) { ! return new PreparedStatementCreatorImpl((params != null) ? Arrays.asList(params) : Collections.EMPTY_LIST); } --- 158,162 ---- */ public PreparedStatementCreator newPreparedStatementCreator(Object[] params) { ! return new PreparedStatementCreatorImpl(params != null ? Arrays.asList(params) : Collections.EMPTY_LIST); } *************** *** 210,220 **** sqlToUse = sql; } ! if (returnGeneratedKeys) { try { ! if (generatedKeysColumnNames == null) { ! ps = con.prepareStatement(sqlToUse, PreparedStatement.RETURN_GENERATED_KEYS); } else { ! ps = con.prepareStatement(sqlToUse, generatedKeysColumnNames); } } --- 211,221 ---- sqlToUse = sql; } ! if (generatedKeysColumnNames != null || returnGeneratedKeys) { try { ! if (generatedKeysColumnNames != null) { ! ps = con.prepareStatement(sqlToUse, generatedKeysColumnNames); } else { ! ps = con.prepareStatement(sqlToUse, PreparedStatement.RETURN_GENERATED_KEYS); } } *************** *** 249,253 **** SqlParameter declaredParameter = (SqlParameter) declaredParameters.get(i); Object in = this.parameters.get(i); ! if (in instanceof Collection) { Collection entries = (Collection) in; for (Iterator it = entries.iterator(); it.hasNext();) { --- 250,254 ---- SqlParameter declaredParameter = (SqlParameter) declaredParameters.get(i); Object in = this.parameters.get(i); ! if (in instanceof Collection && declaredParameter.getSqlType() != Types.ARRAY) { Collection entries = (Collection) in; for (Iterator it = entries.iterator(); it.hasNext();) { |
From: Juergen H. <jho...@us...> - 2006-04-20 09:52:23
|
Update of /cvsroot/springframework/spring/src/org/springframework/jdbc/support In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18815/src/org/springframework/jdbc/support Modified Files: SQLErrorCodeSQLExceptionTranslator.java Log Message: refined log message Index: SQLErrorCodeSQLExceptionTranslator.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/jdbc/support/SQLErrorCodeSQLExceptionTranslator.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** SQLErrorCodeSQLExceptionTranslator.java 5 Apr 2006 08:07:51 -0000 1.24 --- SQLErrorCodeSQLExceptionTranslator.java 20 Apr 2006 09:52:04 -0000 1.25 *************** *** 384,389 **** if (logger.isDebugEnabled()) { String intro = custom ? "Custom translation of" : "Translating"; ! logger.debug(intro + " SQLException with SQLState '" + sqlEx.getSQLState() + ! "' and errorCode '" + sqlEx.getErrorCode() + "' and message [" + sqlEx.getMessage() + "]; SQL was [" + sql + "] for task [" + task + "]"); } --- 384,389 ---- if (logger.isDebugEnabled()) { String intro = custom ? "Custom translation of" : "Translating"; ! logger.debug(intro + " SQLException with SQL state '" + sqlEx.getSQLState() + ! "', error code '" + sqlEx.getErrorCode() + "', message [" + sqlEx.getMessage() + "]; SQL was [" + sql + "] for task [" + task + "]"); } |
From: Juergen H. <jho...@us...> - 2006-04-20 09:50:25
|
Update of /cvsroot/springframework/spring/test/org/springframework/jdbc/core/namedparam In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17651/test/org/springframework/jdbc/core/namedparam Modified Files: NamedParameterUtilsTests.java Log Message: use char array instead of byte array, throw exception if SQL to parse is null Index: NamedParameterUtilsTests.java =================================================================== RCS file: /cvsroot/springframework/spring/test/org/springframework/jdbc/core/namedparam/NamedParameterUtilsTests.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NamedParameterUtilsTests.java 18 Apr 2006 09:52:13 -0000 1.2 --- NamedParameterUtilsTests.java 20 Apr 2006 09:50:16 -0000 1.3 *************** *** 26,31 **** /** - * Unit tests for the {@link NamedParameterUtils} class. - * * @author Thomas Risberg * @author Juergen Hoeller --- 26,29 ---- *************** *** 110,151 **** } ! public void testBuildValueArrayWithMissingParameterValue() throws Exception { ! new AssertThrows(InvalidDataAccessApiUsageException.class) { ! public void test() throws Exception { ! String sql = "select count(0) from foo where id = :id"; ! NamedParameterUtils.buildValueArray(sql, new HashMap()); ! } ! }.runTest(); ! } ! ! public void testCountParameterPlaceholdersWithNullSqlString() throws Exception { ! assertEquals(0, NamedParameterUtils.countParameterPlaceholders(null)); ! } ! ! public void testParseSqlStatementWithNullSqlString() throws Exception { ! ParsedSql parsedSql = NamedParameterUtils.parseSqlStatement(null); ! assertNotNull(parsedSql); ! assertNull(parsedSql.getSql()); ! assertEquals("", parsedSql.getNewSql()); ! } ! public void testSubstituteNamedParametersWithNullString() throws Exception { ! String sql = NamedParameterUtils.substituteNamedParameters(null, new SimpleSqlParameterSource()); ! assertEquals("", sql); ! } ! public void testSubstituteNamedParametersWithStringContainingQuotes() throws Exception { ! String expectedSql = "select 'first name' from artists where id = ? and quote = 'exsqueeze me?'"; ! String sql = "select 'first name' from artists where id = :id and quote = 'exsqueeze me?'"; ! String newSql = NamedParameterUtils.substituteNamedParameters(sql, new SimpleSqlParameterSource()); ! assertEquals(expectedSql, newSql); ! } ! public void testParseSqlStatementWithStringContainingQuotes() throws Exception { ! String expectedSql = "select 'first name' from artists where id = ? and quote = 'exsqueeze me?'"; ! String sql = "select 'first name' from artists where id = :id and quote = 'exsqueeze me?'"; ! ParsedSql parsedSql = NamedParameterUtils.parseSqlStatement(sql); ! assertEquals(expectedSql, parsedSql.getNewSql()); ! } } --- 108,137 ---- } ! public void testBuildValueArrayWithMissingParameterValue() throws Exception { ! new AssertThrows(InvalidDataAccessApiUsageException.class) { ! public void test() throws Exception { ! String sql = "select count(0) from foo where id = :id"; ! NamedParameterUtils.buildValueArray(sql, new HashMap()); ! } ! }.runTest(); ! } ! public void testCountParameterPlaceholdersWithNullSqlString() throws Exception { ! assertEquals(0, NamedParameterUtils.countParameterPlaceholders(null)); ! } ! public void testSubstituteNamedParametersWithStringContainingQuotes() throws Exception { ! String expectedSql = "select 'first name' from artists where id = ? and quote = 'exsqueeze me?'"; ! String sql = "select 'first name' from artists where id = :id and quote = 'exsqueeze me?'"; ! String newSql = NamedParameterUtils.substituteNamedParameters(sql, new SimpleSqlParameterSource()); ! assertEquals(expectedSql, newSql); ! } ! public void testParseSqlStatementWithStringContainingQuotes() throws Exception { ! String expectedSql = "select 'first name' from artists where id = ? and quote = 'exsqueeze me?'"; ! String sql = "select 'first name' from artists where id = :id and quote = 'exsqueeze me?'"; ! ParsedSql parsedSql = NamedParameterUtils.parseSqlStatement(sql); ! assertEquals(expectedSql, parsedSql.getNewSql()); ! } } |
From: Juergen H. <jho...@us...> - 2006-04-20 09:50:25
|
Update of /cvsroot/springframework/spring/src/org/springframework/jdbc/core/namedparam In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17651/src/org/springframework/jdbc/core/namedparam Modified Files: NamedParameterUtils.java Log Message: use char array instead of byte array, throw exception if SQL to parse is null Index: NamedParameterUtils.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/jdbc/core/namedparam/NamedParameterUtils.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NamedParameterUtils.java 18 Apr 2006 09:56:14 -0000 1.2 --- NamedParameterUtils.java 20 Apr 2006 09:50:15 -0000 1.3 *************** *** 24,27 **** --- 24,28 ---- import org.springframework.dao.InvalidDataAccessApiUsageException; + import org.springframework.util.Assert; /** *************** *** 35,49 **** public abstract class NamedParameterUtils { - /** * Count the occurrences of the character <code>placeholder</code> in an SQL string ! * <code>sql</code>. The character <code>placeholder</code> is not counted if it ! * appears within a literal -- surrounded by single or double quotes. This method will * count traditional placeholders in the form of a question mark ('?') as well as * named parameters indicated with a leading ':' or '&'. ! * @param sql string to search in. Returns 0 if this is <code>null</code> */ public static int countParameterPlaceholders(String sql) { ! byte[] statement = getBytesNullSafe(sql); boolean withinQuotes = false; Map namedParameters = new HashMap(); --- 36,53 ---- public abstract class NamedParameterUtils { /** * Count the occurrences of the character <code>placeholder</code> in an SQL string ! * <code>sql</code>. The character <code>placeholder</code> is not counted if it appears ! * within a literal, that is, surrounded by single or double quotes. This method will * count traditional placeholders in the form of a question mark ('?') as well as * named parameters indicated with a leading ':' or '&'. ! * @param sql String to search in. Returns 0 if the given String is <code>null</code>. */ public static int countParameterPlaceholders(String sql) { ! if (sql == null) { ! return 0; ! } ! ! char[] statement = sql.toCharArray(); boolean withinQuotes = false; Map namedParameters = new HashMap(); *************** *** 104,114 **** * Named parameters are substituted for a JDBC placeholder. * @param sql the SQL statement */ static ParsedSql parseSqlStatement(String sql) { List parameters = new ArrayList(); Map namedParameters = new HashMap(); ParsedSql parsedSql = new ParsedSql(sql); ! byte[] statement = getBytesNullSafe(sql); StringBuffer newSql = new StringBuffer(); boolean withinQuotes = false; --- 108,121 ---- * Named parameters are substituted for a JDBC placeholder. * @param sql the SQL statement + * @return the parsed statement, represented as ParsedSql instance */ static ParsedSql parseSqlStatement(String sql) { + Assert.notNull(sql, "SQL must not be null"); + List parameters = new ArrayList(); Map namedParameters = new HashMap(); ParsedSql parsedSql = new ParsedSql(sql); ! char[] statement = sql.toCharArray(); StringBuffer newSql = new StringBuffer(); boolean withinQuotes = false; *************** *** 170,243 **** } ! /** ! * Parse the SQL statement and locate any placeholders or named parameters. ! * Named parameters are substituted for a JDBC placeholder and any select list ! * is expanded to the required number of placeholders. ! * <p>The parameter values passed in are used to determine the number of ! * placeholder to be used for a select list. Select lists should be limited ! * to 100 or fewer elements. A larger number of elements is not guaramteed to ! * be supported by the database and is strictly vendor-dependent. ! * @param sql the SQL statement ! * @param paramSource the source for named parameters ! */ ! public static String substituteNamedParameters(String sql, SqlParameterSource paramSource) { ! byte[] statement = getBytesNullSafe(sql); ! StringBuffer newSql = new StringBuffer(); ! boolean withinQuotes = false; ! char currentQuote = '-'; ! int i = 0; ! while (i < statement.length) { ! if (withinQuotes) { ! if (statement[i] == currentQuote) { ! withinQuotes = false; ! currentQuote = '-'; ! } ! newSql.append((char) statement[i]); ! } ! else { ! if (statement[i] == '"' || statement[i] == '\'') { ! withinQuotes = true; ! currentQuote = (char) statement[i]; ! newSql.append((char) statement[i]); ! } ! else { ! if (statement[i] == ':' || statement[i] == '&') { ! int j = i + 1; ! while (j < statement.length && parameterNameContinues(statement, j)) { ! j++; ! } ! if (j - i > 1) { ! String paramName = sql.substring(i + 1, j); ! if (paramSource != null && paramSource.hasValue(paramName)) { ! Object value = paramSource.getValue(paramName); ! if (value instanceof Collection) { ! Collection entries = (Collection) value; ! for (int k = 0; k < entries.size(); k++) { ! if (k > 0) { ! newSql.append(", "); ! } ! newSql.append("?"); ! } ! } ! else { ! newSql.append("?"); ! } ! } ! else { ! newSql.append("?"); ! } ! } ! i = j - 1; ! } ! else { ! newSql.append((char) statement[i]); ! } ! } ! } ! i++; ! } ! return newSql.toString(); ! } /** --- 177,253 ---- } ! /** ! * Parse the SQL statement and locate any placeholders or named parameters. ! * Named parameters are substituted for a JDBC placeholder and any select list ! * is expanded to the required number of placeholders. ! * <p>The parameter values passed in are used to determine the number of ! * placeholder to be used for a select list. Select lists should be limited ! * to 100 or fewer elements. A larger number of elements is not guaramteed to ! * be supported by the database and is strictly vendor-dependent. ! * @param sql the SQL statement ! * @param paramSource the source for named parameters ! * @return the SQL statement with substituted parameters ! */ ! public static String substituteNamedParameters(String sql, SqlParameterSource paramSource) { ! Assert.notNull(sql, "SQL must not be null"); ! char[] statement = sql.toCharArray(); ! StringBuffer newSql = new StringBuffer(); ! boolean withinQuotes = false; ! char currentQuote = '-'; ! ! int i = 0; ! while (i < statement.length) { ! if (withinQuotes) { ! if (statement[i] == currentQuote) { ! withinQuotes = false; ! currentQuote = '-'; ! } ! newSql.append((char) statement[i]); ! } ! else { ! if (statement[i] == '"' || statement[i] == '\'') { ! withinQuotes = true; ! currentQuote = (char) statement[i]; ! newSql.append((char) statement[i]); ! } ! else { ! if (statement[i] == ':' || statement[i] == '&') { ! int j = i + 1; ! while (j < statement.length && parameterNameContinues(statement, j)) { ! j++; ! } ! if (j - i > 1) { ! String paramName = sql.substring(i + 1, j); ! if (paramSource != null && paramSource.hasValue(paramName)) { ! Object value = paramSource.getValue(paramName); ! if (value instanceof Collection) { ! Collection entries = (Collection) value; ! for (int k = 0; k < entries.size(); k++) { ! if (k > 0) { ! newSql.append(", "); ! } ! newSql.append("?"); ! } ! } ! else { ! newSql.append("?"); ! } ! } ! else { ! newSql.append("?"); ! } ! } ! i = j - 1; ! } ! else { ! newSql.append((char) statement[i]); ! } ! } ! } ! i++; ! } ! return newSql.toString(); ! } /** *************** *** 264,272 **** Object[] paramArray = new Object[parsedSql.getTotalParameterCount()]; if (parsedSql.getNamedParameterCount() > 0 && parsedSql.getUnnamedParameterCount() > 0) { ! throw new InvalidDataAccessApiUsageException( ! "You can't mix named and traditional ? placeholders. You have " + ! parsedSql.getNamedParameterCount() + " named parameter(s) and " + ! parsedSql.getUnnamedParameterCount() + " traditonal placeholder(s) in [" + ! parsedSql.getSql() + "]"); } String[] paramNames = parsedSql.getParameterNames(); --- 274,282 ---- Object[] paramArray = new Object[parsedSql.getTotalParameterCount()]; if (parsedSql.getNamedParameterCount() > 0 && parsedSql.getUnnamedParameterCount() > 0) { ! throw new InvalidDataAccessApiUsageException( ! "You can't mix named and traditional ? placeholders. You have " + ! parsedSql.getNamedParameterCount() + " named parameter(s) and " + ! parsedSql.getUnnamedParameterCount() + " traditonal placeholder(s) in [" + ! parsedSql.getSql() + "]"); } String[] paramNames = parsedSql.getParameterNames(); *************** *** 300,308 **** return sqlTypes; } - - - private static byte[] getBytesNullSafe(String sql) { - return (sql == null) ? new byte[0] : sql.getBytes(); - } /** --- 310,313 ---- *************** *** 310,319 **** * that is, does not end delimited by any whitespace character yet. * @param statement the SQL statement ! * @param j the position within the statement */ ! private static boolean parameterNameContinues(byte[] statement, int j) { ! return (statement[j] != ' ' && statement[j] != ',' && statement[j] != ')' && ! statement[j] != '"' && statement[j] != '\'' && statement[j] != '|' && ! statement[j] != ';' && statement[j] != '\n' && statement[j] != '\r'); } --- 315,324 ---- * that is, does not end delimited by any whitespace character yet. * @param statement the SQL statement ! * @param pos the position within the statement */ ! private static boolean parameterNameContinues(char[] statement, int pos) { ! return (statement[pos] != ' ' && statement[pos] != ',' && statement[pos] != ')' && ! statement[pos] != '"' && statement[pos] != '\'' && statement[pos] != '|' && ! statement[pos] != ';' && statement[pos] != '\n' && statement[pos] != '\r'); } |
From: Keith D. <kd...@us...> - 2006-04-20 05:29:59
|
Update of /cvsroot/springframework/spring-projects/spring-webflow/docs/reference/src/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6853/docs/reference/src/images Removed Files: i21-banner-stamped.jpg Log Message: removed --- i21-banner-stamped.jpg DELETED --- |
From: Keith D. <kd...@us...> - 2006-04-20 05:21:42
|
Update of /cvsroot/springframework/spring-projects/spring-webflow/src/java/org/springframework/webflow/execution In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv483/src/java/org/springframework/webflow/execution Modified Files: FlowExecution.java Log Message: polish Index: FlowExecution.java =================================================================== RCS file: /cvsroot/springframework/spring-projects/spring-webflow/src/java/org/springframework/webflow/execution/FlowExecution.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** FlowExecution.java 16 Apr 2006 13:49:25 -0000 1.40 --- FlowExecution.java 20 Apr 2006 05:21:39 -0000 1.41 *************** *** 35,39 **** * creates an instance of an object implementing this interface, initializing it * with the requested Flow definition which becomes the execution's "root", or ! * top-level flow. After creation, the {@link #start(ExternalContext)} operation * is called, which causes the execution to activate a new session for its root * flow definition. That session is then pushed onto a stack and its definition --- 35,39 ---- * creates an instance of an object implementing this interface, initializing it * with the requested Flow definition which becomes the execution's "root", or ! * top-level flow. After creation, the {@link #start(AttributeMap, ExternalContext)} operation * is called, which causes the execution to activate a new session for its root * flow definition. That session is then pushed onto a stack and its definition *************** *** 55,59 **** * Subsequent requests from the client to manipuate this flow execution trigger * restoration and rehydration of this object, followed by an invocation of the ! * {@link #signalEvent(String, ExternalContext)} operation. The signalEvent * operation tells this state machine what action the user took from within the * context of the current state; for example, the user may have pressed pressed --- 55,59 ---- * Subsequent requests from the client to manipuate this flow execution trigger * restoration and rehydration of this object, followed by an invocation of the ! * {@link #signalEvent(EventId, ExternalContext)} operation. The signalEvent * operation tells this state machine what action the user took from within the * context of the current state; for example, the user may have pressed pressed |
From: Keith D. <kd...@us...> - 2006-04-20 05:20:43
|
Update of /cvsroot/springframework/spring-projects/spring-webflow/src/java/org/springframework/webflow/execution/repository In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32198/src/java/org/springframework/webflow/execution/repository Modified Files: FlowExecutionRepository.java Log Message: Index: FlowExecutionRepository.java =================================================================== RCS file: /cvsroot/springframework/spring-projects/spring-webflow/src/java/org/springframework/webflow/execution/repository/FlowExecutionRepository.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** FlowExecutionRepository.java 16 Apr 2006 17:16:08 -0000 1.20 --- FlowExecutionRepository.java 20 Apr 2006 05:20:40 -0000 1.21 *************** *** 18,22 **** import java.io.Serializable; - import org.springframework.webflow.ViewSelection; import org.springframework.webflow.execution.FlowExecution; --- 18,21 ---- |
From: Ben H. <ne...@us...> - 2006-04-20 01:45:38
|
Update of /cvsroot/springframework/spring/docs/reference/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30172/docs/reference/src Modified Files: index.xml Added Files: taskexecutor.xml Log Message: Added a TaskExecutor section and updated the TOC to include it. Index: index.xml =================================================================== RCS file: /cvsroot/springframework/spring/docs/reference/src/index.xml,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** index.xml 19 Apr 2006 11:50:20 -0000 1.70 --- index.xml 20 Apr 2006 01:45:34 -0000 1.71 *************** *** 26,29 **** --- 26,30 ---- <!ENTITY mail SYSTEM "mail.xml"> <!ENTITY scheduling SYSTEM "scheduling.xml"> + <!ENTITY taskexecutor SYSTEM "taskexecutor.xml"> <!ENTITY testing SYSTEM "testing.xml"> <!ENTITY scripting SYSTEM "scripting.xml"> *************** *** 35,39 **** ]> <book> ! <bookinfo> <title>The Spring Framework - Reference Documentation</title> <releaseinfo>Version 2.0 M4</releaseinfo> --- 36,40 ---- ]> <book> ! <bookinfo> <title>The Spring Framework - Reference Documentation</title> <releaseinfo>Version 2.0 M4</releaseinfo> *************** *** 91,103 **** <surname>Evans</surname> </author> </authorgroup> <legalnotice> ! Copies of this document may be made for your own use and for distribution to others, provided that ! you do not charge any fee for such copies and further provided that each copy contains this ! Copyright Notice, whether distributed in print or electronically. </legalnotice> </bookinfo> <!-- front matter --> ! <toc /> &overview; &background; --- 92,110 ---- <surname>Evans</surname> </author> + <author> + <firstname>Ben</firstname> + <surname>Hale</surname> + </author> </authorgroup> <legalnotice> ! Copies of this document may be made for your own use and for ! distribution to others, provided that you do not charge any ! fee for such copies and further provided that each copy ! contains this Copyright Notice, whether distributed in print ! or electronically. </legalnotice> </bookinfo> <!-- front matter --> ! <toc /> &overview; &background; *************** *** 107,128 **** <partintro> <para> ! This initial part of the reference documentation covers all of those ! technologies that are absolutely integral to the Spring Framework. </para> <para> ! Foremost amongst these is the Spring Framework's Inversion of Control (IoC) ! container. </para> <para> ! A thorough treatment of the Spring Framework's IoC container is closely ! followed by comprehensive coverage of Spring's Aspect-Oriented Programming (AOP) ! technologies. The Spring Framework has its own AOP framework, which is ! conceptually easy to understand, and which (successfully) addresses the 80% ! sweet spot of AOP requirements in Java enterprise programming. </para> <para> ! Coverage of Spring's integration with AspectJ (currently the richest - in ! terms of features - and certainly most mature AOP implementation in the ! Java enterprise space) is also provided. </para> <itemizedlist> --- 114,139 ---- <partintro> <para> ! This initial part of the reference documentation covers ! all of those technologies that are absolutely integral ! to the Spring Framework. </para> <para> ! Foremost amongst these is the Spring Framework's ! Inversion of Control (IoC) container. </para> <para> ! A thorough treatment of the Spring Framework's IoC ! container is closely followed by comprehensive coverage ! of Spring's Aspect-Oriented Programming (AOP) ! technologies. The Spring Framework has its own AOP ! framework, which is conceptually easy to understand, and ! which (successfully) addresses the 80% sweet spot of AOP ! requirements in Java enterprise programming. </para> <para> ! Coverage of Spring's integration with AspectJ (currently ! the richest - in terms of features - and certainly most ! mature AOP implementation in the Java enterprise space) ! is also provided. </para> <itemizedlist> *************** *** 154,164 **** <partintro> <para> ! This part of the reference documentation is concerned with the middle tier, ! and specifically the data access responsibilities of said tier. </para> <para> ! Spring's comprehensive transaction management support is covered in some detail, ! followed by thorough coverage of the various middle tier data access frameworks ! and technologies that the Spring Framework integrates with. </para> <itemizedlist> --- 165,177 ---- <partintro> <para> ! This part of the reference documentation is concerned ! with the middle tier, and specifically the data access ! responsibilities of said tier. </para> <para> ! Spring's comprehensive transaction management support is ! covered in some detail, followed by thorough coverage of ! the various middle tier data access frameworks and ! technologies that the Spring Framework integrates with. </para> <itemizedlist> *************** *** 181,204 **** &jdbc; &orm; ! </part> <part> <title>The Web</title> <partintro> <para> ! This part of the reference documentation covers the Spring Framework's ! support for the presentation tier (and specifically web-based presentation ! tiers). </para> <para> ! The Spring Framework's own web framework, <link linkend="mvc">Spring MVC</link>, ! is coevered in the first couple of chapters. A number of the remaining chapters in ! this part of the reference documentation are concerned with the Spring Framework's ! integration with other web technologies, including as other web frameworks such as ! <link linkend="struts">Struts</link> and <link linkend="jsf">JSF</link> (to name ! but a few). </para> <para> This section concludes with coverage of Spring's ! <link linkend="portlet">portlet framework</link>. </para> <itemizedlist> --- 194,223 ---- &jdbc; &orm; ! </part> <part> <title>The Web</title> <partintro> <para> ! This part of the reference documentation covers the ! Spring Framework's support for the presentation tier ! (and specifically web-based presentation tiers). </para> <para> ! The Spring Framework's own web framework, ! <link linkend="mvc">Spring MVC</link> ! , is coevered in the first couple of chapters. A number ! of the remaining chapters in this part of the reference ! documentation are concerned with the Spring Framework's ! integration with other web technologies, including as ! other web frameworks such as ! <link linkend="struts">Struts</link> ! and ! <link linkend="jsf">JSF</link> ! (to name but a few). </para> <para> This section concludes with coverage of Spring's ! <link linkend="portlet">portlet framework</link> ! . </para> <itemizedlist> *************** *** 226,231 **** <partintro> <para> ! This final part of the reference documentation covers the Spring Framework's ! integration with a number of J2EE (and related) technologies. </para> <itemizedlist> --- 245,251 ---- <partintro> <para> ! This final part of the reference documentation covers ! the Spring Framework's integration with a number of J2EE ! (and related) technologies. </para> <itemizedlist> *************** *** 252,255 **** --- 272,278 ---- </listitem> <listitem> + <xref linkend="taskexecutor" /> + </listitem> + <listitem> <xref linkend="dynamic-language" /> </listitem> *************** *** 269,272 **** --- 292,296 ---- &mail; &scheduling; + &taskexecutor; &dynamic-languages; &testing; --- NEW FILE: taskexecutor.xml --- <?xml version="1.0" encoding="UTF-8"?> <chapter id="taskexecutor"> <title><classname>TaskExecutor</classname></title> <section> <title>Introduction</title> <para>Spring 2.0 introduces a new abstraction for dealing with Executors. Executors are the Java 5 name for the concept of thread pools. The odd naming is due to the fact that there is no guarentee that the underlying implementation of is actually a pool. In fact in many cases the executor is single threaded. Spring's abstraction helps bring thread pooling to Java 1.3 and 1.4 environments as well as hiding implementations details between 1.3, 1.4, 5, and JEE environments.</para> </section> <section> <title>The <classname>TaskExecutor</classname> Interface</title> <para>Spring's <classname>TaskExecutor</classname> interface is identical to the <classname>java.util.concurrent.Executor</classname> interface. In fact it's primary reason for existence is to abstract away the need for Java 5 when using thread pools. The interface has a single method <classname>execute(Runnable task)</classname> which accepts a task for execution based on the semantics and configuration of the thread pool.</para> </section> <section> <title>Where to use a <classname>TaskExecutor</classname></title> <para>The <classname>TaskExecutor</classname> was originally created to give other Spring components an abstraction for thread pooling where needed. Components such as the <classname>ApplicationEventMulticaster</classname>, JMS's <classname>AbstractMessageListenerContainer</classname>, and Quartz integration use the <classname>TaskExecutor</classname> abstraction to pool threads. However, if your beans need thread pooling behavior, it is possible to reuse this abstraction for your own needs.</para> </section> <section> <title>Types of <classname>TaskExecutor</classname>s</title> <para>There are a number of pre-built implementations of <classname>TaskExecutor</classname> included with the Spring distribution. In all likelihood, you shouldn't ever need to implement your own.</para> <section> <title><classname>SimpleAsyncTaskExecutor</classname></title> <para>This implementation does not reuse any threads, rather it starts up a new thread for each invocation. However, it does support a concurrency limit which will block any invocations that are over the limit until a slot has been freed up. If you're looking for true pooling, keep looking further down the page.</para> </section> <section id="syncTaskExecutor"> <title><classname>SyncTaskExecutor</classname></title> <para>This implementation doesn't even execution invocations asynchronously. Instead each invocation takes place in the calling thread. It is primarily used in situations where mutlithreading isn't necessary such as simple test cases.</para> </section> <section id="concurrentTaskExecutor"> <title><classname>ConcurrentTaskExecutor</classname></title> <para>This implementation is a wrapper for a Java 5 <classname>java.util.concurrent.Executor</classname>. There is an alternative, <classname>ThreadPoolTaskExecutor</classname>, that exposes the <classname>Executor</classname> configuration parameters as bean properties. It is rare to use the <classname>ConcurrentTaskExecutor</classname> but if the <classname>ThreadPoolTaskExecutor</classname> isn't robust enough for your needs, the <classname>ConcurrentTaskExecutor</classname> is there.</para> <itemizedlist> <listitem> <para><xref linkend="threadPoolTaskExecutor" /></para> </listitem> </itemizedlist> </section> <section> <title id="simpleThreadPoolTaskExecutor"><classname>SimpleThreadPoolTaskExecutor</classname></title> <para>This implementation is actually a subclass of Quartz's <classname>SimpleThreadPool</classname> which listens to Spring's lifecycle callbacks. This is typically used when you have a threadpool that may need to be shared by both Quartz and non-Quartz components.</para> </section> <section id="threadPoolTaskExecutor"> <title><classname>ThreadPoolTaskExecutor</classname></title> <sidebar> <para>It is not possible to use any backport or alternate version of the <classname>java.util.concurrent</classname> package with this implementation. Both Doug Lea's and Dawid Kurzyniec's implementations use different package structures which will prevent them from working correctly.</para> </sidebar> <para>This implementation can only be used in a Java 5 environment but is the most typically used there. It exposes bean properties for configuring a <classname>java.util.concurrent.ThreadPoolExecutor</classname> and wraps it in a <classname>TaskExecutor</classname>. If you need something advanced such as a <classname>ScheduledThreadPoolExecutor</classname>, it is recommended that you use a <classname>ConcurrentTaskExecutor</classname> instead.</para> <itemizedlist> <listitem> <para><xref linkend="concurrentTaskExecutor" /></para> </listitem> </itemizedlist> </section> <section> <title><classname>TimeTaskExecutor</classname></title> <para>This implementation uses a single <classname>TimerTask</classname> as it's backing implementation. It's different from the <classname>SyncTaskExecutor</classname> in that the method invocations are executed in a separate thread, although they are synchronous in that thread.</para> <itemizedlist> <listitem> <para><xref linkend="syncTaskExecutor" /></para> </listitem> </itemizedlist> </section> <section> <title><classname>WorkManagerTaskExecutor</classname></title> <sidebar> <para>CommonJ is a set of specifications jointly developed between BEA and IBM. These specifications are not JEE standards, but are standard across BEA's and IBM's Application Server implementations.</para> </sidebar> <para>This implementation uses the CommonJ WorkManager as its backing implementation and is the central convience class for setting up a CommonJ WorkManager reference in a Spring context. Similarly to the <classname>SimpleThreadPoolTaskExecutor</classname>, this class implements the WorkManager interface and therefore can be used directly as a WorkManager as well.</para> <itemizedlist> <listitem> <para><xref linkend="simpleThreadPoolTaskExecutor" /></para> </listitem> </itemizedlist> </section> </section> </chapter> |
From: Juergen H. <jho...@us...> - 2006-04-19 21:43:20
|
Update of /cvsroot/springframework/spring/samples/jpetstore/war/WEB-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13647/samples/jpetstore/war/WEB-INF Modified Files: applicationContext.xml Log Message: polishing Index: applicationContext.xml =================================================================== RCS file: /cvsroot/springframework/spring/samples/jpetstore/war/WEB-INF/applicationContext.xml,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** applicationContext.xml 22 Dec 2005 16:33:19 -0000 1.18 --- applicationContext.xml 19 Apr 2006 21:43:17 -0000 1.19 *************** *** 27,31 **** </property> </bean> ! <!-- MailSender used by EmailAdvice --> <!-- --- 27,31 ---- </property> </bean> ! <!-- MailSender used by EmailAdvice --> <!-- |
From: Juergen H. <jho...@us...> - 2006-04-19 21:42:14
|
Update of /cvsroot/springframework/spring/samples/jpetstore/war/WEB-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12827/samples/jpetstore/war/WEB-INF Modified Files: dataAccessContext-jta.xml Log Message: use new "jndi-name" syntax Index: dataAccessContext-jta.xml =================================================================== RCS file: /cvsroot/springframework/spring/samples/jpetstore/war/WEB-INF/dataAccessContext-jta.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** dataAccessContext-jta.xml 12 Dec 2005 05:33:07 -0000 1.8 --- dataAccessContext-jta.xml 19 Apr 2006 21:42:10 -0000 1.9 *************** *** 1,4 **** <?xml version="1.0" encoding="UTF-8"?> - <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <!-- --- 1,3 ---- *************** *** 11,15 **** - JTA support in the container, and on pre-configured container DataSources. - ! - This version also uses the jndi:xxx namespace introduced in Spring 2.0 - to configured JNDI referenced objects. --> --- 10,14 ---- - JTA support in the container, and on pre-configured container DataSources. - ! - This version also uses the "jndi:" namespace introduced in Spring 2.0 - to configured JNDI referenced objects. --> *************** *** 25,34 **** <!-- Refers to the main database, containing product and account data --> <!-- (see dataAccessContext-local.xml for an alternative) --> ! <jndi:lookup id="dataSource" jndiName="java:comp/env/jdbc/jpetstore"/> <!-- Additional JNDI DataSource for J2EE environments --> <!-- Refers to the order database, containing order data --> <!-- (see dataAccessContext-local.xml for an alternative) --> ! <jndi:lookup id="dataSource" jndiName="java:comp/env/jdbc/jpetstore-order"/> <!-- Transaction manager that delegates to JTA (for a transactional JNDI DataSource) --> --- 24,33 ---- <!-- Refers to the main database, containing product and account data --> <!-- (see dataAccessContext-local.xml for an alternative) --> ! <jndi:lookup id="dataSource" jndi-name="java:comp/env/jdbc/jpetstore"/> <!-- Additional JNDI DataSource for J2EE environments --> <!-- Refers to the order database, containing order data --> <!-- (see dataAccessContext-local.xml for an alternative) --> ! <jndi:lookup id="orderDataSource" jndi-name="java:comp/env/jdbc/jpetstore-order"/> <!-- Transaction manager that delegates to JTA (for a transactional JNDI DataSource) --> |
From: Juergen H. <jho...@us...> - 2006-04-19 21:38:50
|
Update of /cvsroot/springframework/spring/src/org/springframework/orm/jdo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10138/src/org/springframework/orm/jdo Modified Files: JdoTransactionManager.java TransactionAwarePersistenceManagerFactoryProxy.java Log Message: polished javadoc Index: JdoTransactionManager.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/orm/jdo/JdoTransactionManager.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** JdoTransactionManager.java 15 Mar 2006 21:04:39 -0000 1.45 --- JdoTransactionManager.java 19 Apr 2006 21:38:43 -0000 1.46 *************** *** 50,55 **** * transactional data access. JTA (usually through JtaTransactionManager) is necessary for * accessing multiple transactional resources. Note that you need to configure your JDO ! * provider accordingly to make it participate in JTA transactions. In contrast to Hibernate, ! * this cannot be transparently provided by the Spring transaction manager implementation. * * <p>With a JdoDialect specified, this implementation also supports direct DataSource --- 50,54 ---- * transactional data access. JTA (usually through JtaTransactionManager) is necessary for * accessing multiple transactional resources. Note that you need to configure your JDO ! * provider accordingly to make it participate in JTA transactions. * * <p>With a JdoDialect specified, this implementation also supports direct DataSource *************** *** 378,382 **** } catch (JDOException ex) { ! // assumably failed to flush changes to database throw convertJdoAccessException(ex); } --- 377,381 ---- } catch (JDOException ex) { ! // Assumably failed to flush changes to database. throw convertJdoAccessException(ex); } Index: TransactionAwarePersistenceManagerFactoryProxy.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/orm/jdo/TransactionAwarePersistenceManagerFactoryProxy.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TransactionAwarePersistenceManagerFactoryProxy.java 12 Sep 2005 20:35:32 -0000 1.3 --- TransactionAwarePersistenceManagerFactoryProxy.java 19 Apr 2006 21:38:43 -0000 1.4 *************** *** 1,4 **** /* ! * Copyright 2002-2005 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2006 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 112,116 **** } ! public boolean isAllowCreate() { return allowCreate; } --- 112,121 ---- } ! /** ! * Return whether the PersistenceManagerFactory proxy is allowed to create ! * a non-transactional PersistenceManager when no transactional ! * PersistenceManager can be found for the current thread. ! */ ! protected boolean isAllowCreate() { return allowCreate; } |
From: Juergen H. <jho...@us...> - 2006-04-19 21:35:36
|
Update of /cvsroot/springframework/spring/src/org/springframework/scripting/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7834/src/org/springframework/scripting/config Modified Files: ScriptBeanDefinitionParser.java Log Message: renamed Assert's "isAssignableFrom" to "isAssignable" Index: ScriptBeanDefinitionParser.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/scripting/config/ScriptBeanDefinitionParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ScriptBeanDefinitionParser.java 18 Apr 2006 21:16:23 -0000 1.1 --- ScriptBeanDefinitionParser.java 19 Apr 2006 21:35:21 -0000 1.2 *************** *** 81,85 **** */ public ScriptBeanDefinitionParser(Class scriptFactoryClass) { ! Assert.isAssignableFrom(ScriptFactory.class, scriptFactoryClass); this.scriptFactoryClass = scriptFactoryClass; } --- 81,85 ---- */ public ScriptBeanDefinitionParser(Class scriptFactoryClass) { ! Assert.isAssignable(ScriptFactory.class, scriptFactoryClass); this.scriptFactoryClass = scriptFactoryClass; } |
From: Juergen H. <jho...@us...> - 2006-04-19 21:35:26
|
Update of /cvsroot/springframework/spring/src/org/springframework/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7834/src/org/springframework/util Modified Files: Assert.java Log Message: renamed Assert's "isAssignableFrom" to "isAssignable" Index: Assert.java =================================================================== RCS file: /cvsroot/springframework/spring/src/org/springframework/util/Assert.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Assert.java 18 Apr 2006 21:08:36 -0000 1.22 --- Assert.java 19 Apr 2006 21:35:21 -0000 1.23 *************** *** 328,346 **** /** ! * Assert that the <code>superType.isAssignableFrom(subType)</code> is <code>true</code>. * <pre> ! * Assert.isAssignableFrom(Number.class, myClass);</pre> * @param superType the super type to check * @param subType the sub type to check * @throws IllegalArgumentException if the classes are not assignable */ ! public static void isAssignableFrom(Class superType, Class subType) { ! isAssignableFrom(superType, subType, ""); } /** ! * Assert that the <code>superType.isAssignableFrom(subType)</code> is <code>true</code>. * <pre> ! * Assert.isAssignableFrom(Number.class, myClass);</pre> * @param superType the super type to check * @param subType the sub type to check --- 328,346 ---- /** ! * Assert that <code>superType.isAssignableFrom(subType)</code> is <code>true</code>. * <pre> ! * Assert.isAssignable(Number.class, myClass);</pre> * @param superType the super type to check * @param subType the sub type to check * @throws IllegalArgumentException if the classes are not assignable */ ! public static void isAssignable(Class superType, Class subType) { ! isAssignable(superType, subType, ""); } /** ! * Assert that <code>superType.isAssignableFrom(subType)</code> is <code>true</code>. * <pre> ! * Assert.isAssignable(Number.class, myClass);</pre> * @param superType the super type to check * @param subType the sub type to check *************** *** 351,355 **** * @throws IllegalArgumentException if the classes are not assignable */ ! public static void isAssignableFrom(Class superType, Class subType, String message) { Assert.notNull(superType, "superType cannot be null"); Assert.notNull(subType, "subType cannot be null"); --- 351,355 ---- * @throws IllegalArgumentException if the classes are not assignable */ ! public static void isAssignable(Class superType, Class subType, String message) { Assert.notNull(superType, "superType cannot be null"); Assert.notNull(subType, "subType cannot be null"); |
From: Juergen H. <jho...@us...> - 2006-04-19 21:35:26
|
Update of /cvsroot/springframework/spring/tiger/src/org/springframework/orm/jpa/support In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7834/tiger/src/org/springframework/orm/jpa/support Modified Files: SharedEntityManagerAdapter.java Log Message: renamed Assert's "isAssignableFrom" to "isAssignable" Index: SharedEntityManagerAdapter.java =================================================================== RCS file: /cvsroot/springframework/spring/tiger/src/org/springframework/orm/jpa/support/SharedEntityManagerAdapter.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SharedEntityManagerAdapter.java 19 Apr 2006 21:23:21 -0000 1.6 --- SharedEntityManagerAdapter.java 19 Apr 2006 21:35:21 -0000 1.7 *************** *** 90,94 **** public void setEntityManagerInterface(Class entityManagerInterface) { Assert.notNull(entityManagerInterface, "entityManagerInterface must not be null"); ! Assert.isAssignableFrom(EntityManager.class, entityManagerInterface); this.entityManagerInterface = entityManagerInterface; } --- 90,94 ---- public void setEntityManagerInterface(Class entityManagerInterface) { Assert.notNull(entityManagerInterface, "entityManagerInterface must not be null"); ! Assert.isAssignable(EntityManager.class, entityManagerInterface); this.entityManagerInterface = entityManagerInterface; } |
From: Juergen H. <jho...@us...> - 2006-04-19 21:23:25
|
Update of /cvsroot/springframework/spring/tiger/src/org/springframework/orm/jpa/support In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31443/tiger/src/org/springframework/orm/jpa/support Modified Files: SharedEntityManagerAdapter.java Log Message: added "entityManagerInterface" property, for exposing a vendor-extended interface Index: SharedEntityManagerAdapter.java =================================================================== RCS file: /cvsroot/springframework/spring/tiger/src/org/springframework/orm/jpa/support/SharedEntityManagerAdapter.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SharedEntityManagerAdapter.java 10 Apr 2006 13:17:52 -0000 1.5 --- SharedEntityManagerAdapter.java 19 Apr 2006 21:23:21 -0000 1.6 *************** *** 29,33 **** --- 29,35 ---- import org.springframework.beans.factory.FactoryBean; + import org.springframework.beans.factory.InitializingBean; import org.springframework.orm.jpa.EntityManagerFactoryUtils; + import org.springframework.util.Assert; /** *************** *** 37,45 **** * JndiObjectFactoryBean definition for a Java EE 5 server's EntityManager. * ! * <p>The shared EntityManager will behave just like an EntityManager ! * fetched from an application server's JNDI environment, as defined ! * by the JPA specification. It will delegate all calls to the current ! * transactional EntityManager, if any; else, it will fall back to ! * a newly created EntityManager per operation. * * <p>Can be passed to DAOs that expect a shared EntityManager reference --- 39,47 ---- * JndiObjectFactoryBean definition for a Java EE 5 server's EntityManager. * ! * <p>The shared EntityManager will behave just like an EntityManager fetched ! * from an application server's JNDI environment, as defined by the JPA ! * specification. It will delegate all calls to the current transactional ! * EntityManager, if any; else, it will fall back to a newly created ! * EntityManager per operation. * * <p>Can be passed to DAOs that expect a shared EntityManager reference *************** *** 48,59 **** * to be able to create new transactional EntityManager instances. * * @author Juergen Hoeller * @since 2.0 * @see org.springframework.orm.jpa.LocalEntityManagerFactoryBean * @see org.springframework.orm.jpa.JpaTransactionManager */ ! public class SharedEntityManagerAdapter implements FactoryBean { ! private EntityManager entityManager; --- 50,72 ---- * to be able to create new transactional EntityManager instances. * + * <p>This adapter is also able to expose a vendor-extended EntityManager + * interface: Simply specify the extended interface as "entityManagerInterface". + * By default, only the standard <code>javax.persistence.EntityManager</code> + * interface will be exposed. + * * @author Juergen Hoeller * @since 2.0 + * @see #setEntityManagerFactory + * @see #setEntityManagerInterface * @see org.springframework.orm.jpa.LocalEntityManagerFactoryBean * @see org.springframework.orm.jpa.JpaTransactionManager */ ! public class SharedEntityManagerAdapter implements FactoryBean, InitializingBean { ! private EntityManagerFactory target; ! ! private Class entityManagerInterface = EntityManager.class; ! ! private EntityManager shared; *************** *** 64,77 **** * @see org.springframework.orm.jpa.JpaTransactionManager */ ! public void setEntityManagerFactory(EntityManagerFactory emf) { ! this.entityManager = (EntityManager) Proxy.newProxyInstance( getClass().getClassLoader(), ! new Class[] {EntityManager.class}, ! new SharedEntityManagerInvocationHandler(emf)); } public Object getObject() { ! return this.entityManager; } --- 77,111 ---- * @see org.springframework.orm.jpa.JpaTransactionManager */ ! public void setEntityManagerFactory(EntityManagerFactory target) { ! this.target = target; ! } ! ! /** ! * Specify the EntityManager interface to expose. ! * <p>Default is the standard <code>javax.persistence.EntityManager</code> ! * interface. This can be overridden to make the proxy expose a ! * vendor-extended EntityManager interface. ! * @see javax.persistence.EntityManager ! */ ! public void setEntityManagerInterface(Class entityManagerInterface) { ! Assert.notNull(entityManagerInterface, "entityManagerInterface must not be null"); ! Assert.isAssignableFrom(EntityManager.class, entityManagerInterface); ! this.entityManagerInterface = entityManagerInterface; ! } ! ! ! public void afterPropertiesSet() { ! if (this.target == null) { ! throw new IllegalArgumentException("entityManagerFactory is required"); ! } ! this.shared = (EntityManager) Proxy.newProxyInstance( getClass().getClassLoader(), ! new Class[] {this.entityManagerInterface}, ! new SharedEntityManagerInvocationHandler(this.target)); } public Object getObject() { ! return this.shared; } |
From: Juergen H. <jho...@us...> - 2006-04-19 21:16:12
|
Update of /cvsroot/springframework/spring/tiger/src/org/springframework/orm/jpa In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25461/tiger/src/org/springframework/orm/jpa Modified Files: JpaTransactionManager.java Log Message: only attempt to roll back if transaction is still active Index: JpaTransactionManager.java =================================================================== RCS file: /cvsroot/springframework/spring/tiger/src/org/springframework/orm/jpa/JpaTransactionManager.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** JpaTransactionManager.java 15 Mar 2006 21:05:48 -0000 1.5 --- JpaTransactionManager.java 19 Apr 2006 21:16:03 -0000 1.6 *************** *** 19,22 **** --- 19,23 ---- import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; + import javax.persistence.EntityTransaction; import javax.persistence.PersistenceException; import javax.sql.DataSource; *************** *** 330,337 **** } try { ! txObject.getEntityManagerHolder().getEntityManager().getTransaction().commit(); } catch (PersistenceException ex) { ! // assumably failed to flush changes to database throw convertJpaAccessException(ex); } --- 331,339 ---- } try { ! EntityTransaction tx = txObject.getEntityManagerHolder().getEntityManager().getTransaction(); ! tx.commit(); } catch (PersistenceException ex) { ! // Assumably failed to flush changes to database. throw convertJpaAccessException(ex); } *************** *** 345,349 **** } try { ! txObject.getEntityManagerHolder().getEntityManager().getTransaction().rollback(); } catch (PersistenceException ex) { --- 347,354 ---- } try { ! EntityTransaction tx = txObject.getEntityManagerHolder().getEntityManager().getTransaction(); ! if (tx.isActive()) { ! tx.rollback(); ! } } catch (PersistenceException ex) { |
From: Ben H. <ne...@us...> - 2006-04-19 20:09:07
|
Update of /cvsroot/springframework/spring-projects/spring-webflow/docs/reference/src/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7864/docs/reference/src/images Added Files: i21-banner-stamped.jpg xdev-spring_logo.jpg Log Message: Updated the doc style to match the Spring doc style --- NEW FILE: i21-banner-stamped.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: xdev-spring_logo.jpg --- (This appears to be a binary file; contents omitted.) |
From: Ben H. <ne...@us...> - 2006-04-19 20:09:05
|
Update of /cvsroot/springframework/spring-projects/spring-webflow/docs/reference/styles In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7864/docs/reference/styles Modified Files: html.xsl fopdf.xsl html_chunk.xsl html.css Log Message: Updated the doc style to match the Spring doc style Index: html_chunk.xsl =================================================================== RCS file: /cvsroot/springframework/spring-projects/spring-webflow/docs/reference/styles/html_chunk.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** html_chunk.xsl 24 Sep 2005 07:55:49 -0000 1.1 --- html_chunk.xsl 19 Apr 2006 20:08:57 -0000 1.2 *************** *** 1,17 **** ! <?xml version="1.0"?> ! <!-- ! ! This is the XSL HTML configuration file for the Hibernate ! Reference Documentation. ! ! It took me days to figure out this stuff and fix most of ! the obvious bugs in the DocBook XSL distribution, so if you ! use this stylesheet, give some credit back to the Hibernate ! project. ! ! chr...@bl... --> - <!DOCTYPE xsl:stylesheet [ <!ENTITY db_xsl_path "../lib/docbook-xsl/"> --- 1,7 ---- ! <?xml version="1.0" ?> <!-- ! This is the XSL HTML configuration file for the Spring ! Reference Documentation. --> <!DOCTYPE xsl:stylesheet [ <!ENTITY db_xsl_path "../lib/docbook-xsl/"> *************** *** 19,90 **** <!ENTITY admon_gfx_path "../images/admons/"> ]> ! ! <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ! version="1.0" ! xmlns="http://www.w3.org/TR/xhtml1/transitional" ! exclude-result-prefixes="#default"> ! ! <xsl:import href="&db_xsl_path;/html/chunk.xsl"/> ! ! <!--################################################### HTML Settings ! ################################################### --> ! ! <xsl:param name="chunk.section.depth">'5'</xsl:param> ! <xsl:param name="use.id.as.filename">'1'</xsl:param> ! <xsl:param name="html.stylesheet">../styles/html.css</xsl:param> ! ! <!-- These extensions are required for table printing and other stuff --> ! <xsl:param name="use.extensions">1</xsl:param> ! <xsl:param name="tablecolumns.extension">0</xsl:param> ! <xsl:param name="callout.extensions">1</xsl:param> ! <xsl:param name="graphicsize.extension">0</xsl:param> ! ! <!--################################################### Table Of Contents ! ################################################### --> ! ! <!-- Generate the TOCs for named components only --> ! <xsl:param name="generate.toc"> book toc </xsl:param> ! ! <!-- Show only Sections up to level 3 in the TOCs --> ! <xsl:param name="toc.section.depth">3</xsl:param> ! ! <!--################################################### Labels ! ################################################### --> ! ! <!-- Label Chapters and Sections (numbering) --> ! <xsl:param name="chapter.autolabel">1</xsl:param> ! <xsl:param name="section.autolabel" select="1"/> ! <xsl:param name="section.label.includes.component.label" select="1"/> ! ! <!--################################################### Callouts ! ################################################### --> ! ! <!-- Use images for callouts instead of (1) (2) (3) --> ! <xsl:param name="callout.graphics">1</xsl:param> ! <xsl:param name="callout.graphics.path">&callout_gfx_path;</xsl:param> ! ! <!-- Place callout marks at this column in annotated areas --> ! <xsl:param name="callout.defaultcolumn">90</xsl:param> ! ! <!--################################################### Admonitions ! ################################################### --> ! ! <!-- Use nice graphics for admonitions --> ! <xsl:param name="admon.graphics">'1'</xsl:param> ! <xsl:param name="admon.graphics.path">&admon_gfx_path;</xsl:param> ! ! <!--################################################### Misc ! ################################################### --> ! ! <!-- Placement of titles --> ! <xsl:param name="formal.title.placement"> figure after example before --- 9,61 ---- <!ENTITY admon_gfx_path "../images/admons/"> ]> ! <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns="http://www.w3.org/TR/xhtml1/transitional" ! exclude-result-prefixes="#default"> ! <xsl:import href="&db_xsl_path;/html/chunk.xsl" /> ! <!--################################################### HTML Settings ! ################################################### --> ! <xsl:param name="chunk.section.depth">'5'</xsl:param> ! <xsl:param name="use.id.as.filename">'1'</xsl:param> ! <xsl:param name="html.stylesheet">../styles/html.css</xsl:param> ! <!-- These extensions are required for table printing and other stuff --> ! <xsl:param name="use.extensions">1</xsl:param> ! <xsl:param name="tablecolumns.extension">0</xsl:param> ! <xsl:param name="callout.extensions">1</xsl:param> ! <xsl:param name="graphicsize.extension">0</xsl:param> ! <!--################################################### Table Of Contents ! ################################################### --> ! <!-- Generate the TOCs for named components only --> ! <xsl:param name="generate.toc"> book toc </xsl:param> ! <!-- Show only Sections up to level 3 in the TOCs --> ! <xsl:param name="toc.section.depth">3</xsl:param> ! <!--################################################### Labels ! ################################################### --> ! <!-- Label Chapters and Sections (numbering) --> ! <xsl:param name="chapter.autolabel">1</xsl:param> ! <xsl:param name="section.autolabel" select="1" /> ! <xsl:param name="section.label.includes.component.label" select="1" /> ! <!--################################################### Callouts ! ################################################### --> ! <!-- Use images for callouts instead of (1) (2) (3) --> ! <xsl:param name="callout.graphics">1</xsl:param> ! <xsl:param name="callout.graphics.path">&callout_gfx_path;</xsl:param> ! <!-- Place callout marks at this column in annotated areas --> ! <xsl:param name="callout.defaultcolumn">90</xsl:param> ! <!--################################################### Admonitions ! ################################################### --> ! <!-- Use nice graphics for admonitions --> ! <xsl:param name="admon.graphics">'1'</xsl:param> ! <xsl:param name="admon.graphics.path">&admon_gfx_path;</xsl:param> ! <!--################################################### Misc ! ################################################### --> ! <!-- Placement of titles --> ! <xsl:param name="formal.title.placement"> figure after example before *************** *** 92,96 **** table before procedure before ! </xsl:param> </xsl:stylesheet> --- 63,103 ---- table before procedure before ! </xsl:param> ! <xsl:template match="author" mode="titlepage.mode"> ! <xsl:if test="name(preceding-sibling::*[1]) = 'author'"> ! <xsl:text>, </xsl:text> ! </xsl:if> ! <span class="{name(.)}"> ! <xsl:call-template name="person.name" /> ! <xsl:apply-templates mode="titlepage.mode" select="./contrib" /> ! <xsl:apply-templates mode="titlepage.mode" select="./affiliation" /> ! </span> ! </xsl:template> ! <xsl:template match="authorgroup" mode="titlepage.mode"> ! <div class="{name(.)}"> ! <h2>Authors</h2> ! <p/> ! <xsl:apply-templates mode="titlepage.mode" /> ! </div> ! </xsl:template> ! <!--################################################### ! Headers and Footers ! ################################################### --> + <!-- lets have a Spring and I21 banner across the top of each page --> + <xsl:template name="user.header.navigation"> + <div style="background-color:#86AEA5;border:none;height:73px;border:1px solid black;"> + <a style="border:none;background: url();" href="http://www.springframework.org/" title="The Spring Framework"> + <img style="border:none;" src="images/xdev-spring_logo.jpg"/> + </a> + <a style="border:none;background: url();" href="http://www.interface21.com/" title="Interface21 - Spring from the Source"> + <img style="border:none;position:absolute;padding-top:7px;right:32px;" src="images/i21-banner-stamped.jpg"/> + </a> + </div> + </xsl:template> + + <!-- no header navigation --> + <xsl:template name="header.navigation"/> + <xsl:param name="navig.showtitles">1</xsl:param> + </xsl:stylesheet> Index: html.css =================================================================== RCS file: /cvsroot/springframework/spring-projects/spring-webflow/docs/reference/styles/html.css,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** html.css 24 Sep 2005 07:55:49 -0000 1.1 --- html.css 19 Apr 2006 20:08:57 -0000 1.2 *************** *** 1,4 **** A { ! color: #003399; } --- 1,36 ---- + BODY { + text-align: justify; + margin-right: 2em; + margin-left: 2em; + } + + A[accesskey^="p"] { + font-family: Verdana, Arial, helvetica, sans-serif; + font-size: 12px; + color: #003399; + } + + A[accesskey^="u"] { + font-family: Verdana, Arial, helvetica, sans-serif; + font-size: 12px; + color: #003399; + } + + A[accesskey^="h"] { + font-family: Verdana, Arial, helvetica, sans-serif; + font-size: 12px; + color: #003399; + } + + A[accesskey^="n"] { + font-family: Verdana, Arial, helvetica, sans-serif; + font-size: 12px; + color: #003399; + } + A { ! color: #003399; ! font-family: Verdana, Arial, helvetica, sans-serif; ! font-size: 12px; } *************** *** 11,14 **** --- 43,55 ---- } + P { + font-family: Verdana, Arial; + } + + DT { + font-family: Verdana, Arial; + font-size: 12px; + } + P, DL, DT, DD, BLOCKQUOTE { color: #000000; *************** *** 16,20 **** margin-top: 3px; padding-top: 0px; - /*border: 1px solid black;*/ } --- 57,60 ---- *************** *** 29,34 **** P.releaseinfo { ! font-size: 120%; font-weight: bold; ! font-family: Arial, helvetica, sans-serif; padding-top: 10px; } --- 69,75 ---- P.releaseinfo { ! font-size: 100%; ! font-weight: bold; ! font-family: Verdana, Arial, helvetica, sans-serif; padding-top: 10px; } *************** *** 36,40 **** P.pubdate { font-size: 120%; font-weight: bold; ! font-family: Arial, helvetica, sans-serif; } --- 77,81 ---- P.pubdate { font-size: 120%; font-weight: bold; ! font-family: Verdana, Arial, helvetica, sans-serif; } *************** *** 43,51 **** } - TD, TH, SPAN { color: #000000; } BLOCKQUOTE { margin-right: 0px; --- 84,101 ---- } TD, TH, SPAN { color: #000000; } + TD[width^="40%"] { + font-family: Verdana, Arial, helvetica, sans-serif; + font-size: 12px; + color: #003399; + } + + TABLE[summary^="Navigation header"] tbody tr th[colspan^="3"] { + font-family: Verdana, Arial, helvetica, sans-serif; + } + BLOCKQUOTE { margin-right: 0px; *************** *** 57,61 **** margin-top:0px; padding-top:14px; ! font-family: Arial, helvetica, sans-serif; margin-bottom: 0px; } --- 107,111 ---- margin-top:0px; padding-top:14px; ! font-family: Verdana, Arial, helvetica, sans-serif; margin-bottom: 0px; } *************** *** 71,81 **** } ! H3.author { ! color: #000000; ! font-weight:500; ! margin-top:0px; ! padding-top:0px; ! font-family: Arial, helvetica, sans-serif; ! margin-bottom: 0px; } --- 121,127 ---- } ! .firstname, .surname { ! font-size: 12px; ! font-family: Verdana, Arial, helvetica, sans-serif; } *************** *** 85,92 **** --- 131,173 ---- border: 1px thin black; empty-cells: hide; + margin: 10px 0px 30px 50px; + width: 90%; + } + + div.table { + margin: 30px 0 30 0; + border: 1px dashed gray; + padding: 10px; + } + + div.table > p.title { + padding-left: 10px; + } + + table[summary^="Navigation footer"] { + border-collapse: collapse; + border-spacing:0; + border: 1px thin black; + empty-cells: hide; + margin: 0px; + width: 100%; + } + + table[summary^="Note"], table[summary^="Warning"] { + border-collapse: collapse; + border-spacing:0; + border: 1px thin black; + empty-cells: hide; + margin: 10px 0 10 -20; + width: 100%; } TD { padding: 4pt; + font-family: Verdana, Arial, helvetica, sans-serif; + } + + div.warning TD { + text-align: justify; } *************** *** 111,115 **** TT { ! font-size: 90%; font-family: "Courier New", Courier, monospace; color: #000000; --- 192,196 ---- TT { ! font-size: 110%; font-family: "Courier New", Courier, monospace; color: #000000; *************** *** 121,125 **** PRE { ! font-size: 90%; padding: 5px; border-style: solid; --- 202,206 ---- PRE { ! font-size: 110%; padding: 5px; border-style: solid; *************** *** 148,157 **** } - /*(.itemizedlist, UL { - padding-top: 0; - padding-bottom:0; - margin:0; - }*/ - .term { font-weight:bold; --- 229,232 ---- *************** *** 163,168 **** } ! .legalnotice { ! font-size: 70%; } - --- 238,254 ---- } ! .legalnotice { ! font-family: Verdana, Arial, helvetica, sans-serif; ! font-size: 12px; ! font-style: italic; ! } ! ! .sidebar { ! float: right; ! margin: 10px 0px 10px 30px; ! padding: 10px 20px 20px 20px; ! width: 33%; ! border: 1px solid black; ! background-color: #F4F4F4; ! font-size: 14px; } Index: fopdf.xsl =================================================================== RCS file: /cvsroot/springframework/spring-projects/spring-webflow/docs/reference/styles/fopdf.xsl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** fopdf.xsl 2 Mar 2006 23:47:20 -0000 1.2 --- fopdf.xsl 19 Apr 2006 20:08:57 -0000 1.3 *************** *** 2,6 **** <!-- ! The base of this stylesheet was graciously borrowed from the Hibernate project. --> --- 2,12 ---- <!-- ! ! This is the XSL FO (PDF) stylesheet for the Spring reference ! documentation. ! ! Thanks are due to Christian Bauer of the Hibernate project ! team for writing the original stylesheet upon which this one ! is based. --> *************** *** 8,11 **** --- 14,18 ---- <!ENTITY db_xsl_path "../lib/docbook-xsl/"> <!ENTITY admon_gfx_path "../images/admons/"> + <!ENTITY copyright "©"> ]> *************** *** 50,54 **** <fo:table-cell text-align="center"> <fo:block font-family="Helvetica" font-size="12pt" padding="10mm"> ! <xsl:text>Copyright (c) 2004-2006 </xsl:text> <xsl:for-each select="bookinfo/authorgroup/author"> <xsl:if test="position() > 1"> --- 57,61 ---- <fo:table-cell text-align="center"> <fo:block font-family="Helvetica" font-size="12pt" padding="10mm"> ! <xsl:text>Copyright ©right; 2004-2006 </xsl:text> <xsl:for-each select="bookinfo/authorgroup/author"> <xsl:if test="position() > 1"> *************** *** 94,166 **** Custom Footer ################################################### --> ! ! <!-- This footer prints the Spring Web Flow version number on the left side --> ! <xsl:template name="footer.content"> ! <xsl:param name="pageclass" select="''"/> ! <xsl:param name="sequence" select="''"/> ! <xsl:param name="position" select="''"/> ! <xsl:param name="gentext-key" select="''"/> ! ! <xsl:variable name="Version"> ! <xsl:choose> ! <xsl:when test="//releaseinfo"> ! <xsl:text>Spring Web Flow </xsl:text><xsl:value-of select="//releaseinfo"/> ! </xsl:when> ! <xsl:otherwise> ! <!-- nop --> ! </xsl:otherwise> ! </xsl:choose> ! </xsl:variable> ! ! <xsl:choose> ! <xsl:when test="$sequence='blank'"> ! <xsl:choose> ! <xsl:when test="$double.sided != 0 and $position = 'left'"> ! <xsl:value-of select="$Version"/> ! </xsl:when> ! ! <xsl:when test="$double.sided = 0 and $position = 'center'"> ! <!-- nop --> ! </xsl:when> ! ! <xsl:otherwise> ! <fo:page-number/> ! </xsl:otherwise> ! </xsl:choose> ! </xsl:when> ! ! <xsl:when test="$pageclass='titlepage'"> ! <!-- nop: other titlepage sequences have no footer --> ! </xsl:when> ! ! <xsl:when test="$double.sided != 0 and $sequence = 'even' and $position='left'"> ! <fo:page-number/> ! </xsl:when> ! ! <xsl:when test="$double.sided != 0 and $sequence = 'odd' and $position='right'"> ! <fo:page-number/> ! </xsl:when> ! ! <xsl:when test="$double.sided = 0 and $position='right'"> ! <fo:page-number/> ! </xsl:when> ! ! <xsl:when test="$double.sided != 0 and $sequence = 'odd' and $position='left'"> ! <xsl:value-of select="$Version"/> ! </xsl:when> ! ! <xsl:when test="$double.sided != 0 and $sequence = 'even' and $position='right'"> ! <xsl:value-of select="$Version"/> ! </xsl:when> ! ! <xsl:when test="$double.sided = 0 and $position='left'"> ! <xsl:value-of select="$Version"/> ! </xsl:when> ! ! <xsl:otherwise> ! <!-- nop --> ! </xsl:otherwise> ! </xsl:choose> ! </xsl:template> <!--################################################### --- 101,147 ---- Custom Footer ################################################### --> ! <xsl:template name="footer.content"> ! <xsl:param name="pageclass" select="''" /> ! <xsl:param name="sequence" select="''" /> ! <xsl:param name="position" select="''" /> ! <xsl:param name="gentext-key" select="''" /> ! <xsl:variable name="Version"> ! <xsl:if test="//releaseinfo"> ! <xsl:text>Spring Framework (</xsl:text><xsl:value-of select="//releaseinfo" /><xsl:text>)</xsl:text> ! </xsl:if> ! </xsl:variable> ! <xsl:choose> ! <xsl:when test="$sequence='blank'"> ! <xsl:if test="$position = 'center'"> ! <xsl:value-of select="$Version" /> ! </xsl:if> ! </xsl:when> ! <!-- for double sided printing, print page numbers on alternating sides (of the page) --> ! <xsl:when test="$double.sided != 0"> ! <xsl:choose> ! <xsl:when test="$sequence = 'even' and $position='left'"> ! <fo:page-number /> ! </xsl:when> ! <xsl:when test="$sequence = 'odd' and $position='right'"> ! <fo:page-number /> ! </xsl:when> ! <xsl:when test="$position='center'"> ! <xsl:value-of select="$Version" /> ! </xsl:when> ! </xsl:choose> ! </xsl:when> ! <!-- for single sided printing, print all page numbers on the right (of the page) --> ! <xsl:when test="$double.sided = 0"> ! <xsl:choose> ! <xsl:when test="$position='center'"> ! <xsl:value-of select="$Version" /> ! </xsl:when> ! <xsl:when test="$position='right'"> ! <fo:page-number /> ! </xsl:when> ! </xsl:choose> ! </xsl:when> ! </xsl:choose> ! </xsl:template> <!--################################################### *************** *** 182,185 **** --- 163,167 ---- last-line-end-indent="-{$toc.indent.width}pt" white-space-treatment="preserve" + text-align="left" white-space-collapse="false"> <fo:inline keep-with-next.within-line="always"> *************** *** 272,276 **** <!-- Left aligned text and no hyphenation --> ! <xsl:param name="alignment">left</xsl:param> <xsl:param name="hyphenate">false</xsl:param> --- 254,258 ---- <!-- Left aligned text and no hyphenation --> ! <xsl:param name="alignment">justify</xsl:param> <xsl:param name="hyphenate">false</xsl:param> *************** *** 410,417 **** <xsl:attribute name="space-before.optimum">1em</xsl:attribute> <xsl:attribute name="space-before.maximum">1em</xsl:attribute> - <!-- alef: commented out because footnotes were screwed because of it --> - <!--<xsl:attribute name="space-after.minimum">0.1em</xsl:attribute> - <xsl:attribute name="space-after.optimum">0.1em</xsl:attribute> - <xsl:attribute name="space-after.maximum">0.1em</xsl:attribute>--> <xsl:attribute name="border-color">#444444</xsl:attribute> <xsl:attribute name="border-style">solid</xsl:attribute> --- 392,395 ---- *************** *** 476,478 **** --- 454,475 ---- </xsl:attribute-set> + <!--################################################### + colored and hyphenated links + ################################################### --> + <xsl:template match="ulink"> + <fo:basic-link external-destination="{@url}" + xsl:use-attribute-sets="xref.properties" + text-decoration="underline" + color="blue"> + <xsl:choose> + <xsl:when test="count(child::node())=0"> + <xsl:value-of select="@url"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> + </fo:basic-link> + </xsl:template> + </xsl:stylesheet> Index: html.xsl =================================================================== RCS file: /cvsroot/springframework/spring-projects/spring-webflow/docs/reference/styles/html.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** html.xsl 24 Sep 2005 07:55:49 -0000 1.1 --- html.xsl 19 Apr 2006 20:08:57 -0000 1.2 *************** *** 1,17 **** <?xml version="1.0"?> - <!-- ! ! This is the XSL HTML configuration file for the Hibernate ! Reference Documentation. ! ! It took me days to figure out this stuff and fix most of ! the obvious bugs in the DocBook XSL distribution, so if you ! use this stylesheet, give some credit back to the Hibernate ! project. ! ! chr...@bl... --> - <!DOCTYPE xsl:stylesheet [ <!ENTITY db_xsl_path "../lib/docbook-xsl/"> --- 1,7 ---- <?xml version="1.0"?> <!-- ! This is the XSL HTML configuration file for the Spring ! Reference Documentation. --> <!DOCTYPE xsl:stylesheet [ <!ENTITY db_xsl_path "../lib/docbook-xsl/"> *************** *** 79,88 **** <xsl:param name="admon.graphics.path">&admon_gfx_path;</xsl:param> ! <!--################################################### Misc ! ################################################### --> ! ! <!-- Placement of titles --> ! <xsl:param name="formal.title.placement"> figure after example before --- 69,77 ---- <xsl:param name="admon.graphics.path">&admon_gfx_path;</xsl:param> ! <!--################################################### Misc ! ################################################### --> ! <!-- Placement of titles --> ! <xsl:param name="formal.title.placement"> figure after example before *************** *** 90,94 **** table before procedure before ! </xsl:param> ! </xsl:stylesheet> --- 79,100 ---- table before procedure before ! </xsl:param> ! <xsl:template match="author" mode="titlepage.mode"> ! <xsl:if test="name(preceding-sibling::*[1]) = 'author'"> ! <xsl:text>, </xsl:text> ! </xsl:if> ! <span class="{name(.)}"> ! <xsl:call-template name="person.name" /> ! <xsl:apply-templates mode="titlepage.mode" select="./contrib" /> ! <xsl:apply-templates mode="titlepage.mode" select="./affiliation" /> ! </span> ! </xsl:template> ! <xsl:template match="authorgroup" mode="titlepage.mode"> ! <div class="{name(.)}"> ! <h2>Authors</h2> ! <p/> ! <xsl:apply-templates mode="titlepage.mode" /> ! </div> ! </xsl:template> ! </xsl:stylesheet> |