Browse Source

polish

conversation
Keith Donald 16 years ago
parent
commit
f64dcd379e
  1. 3
      org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/ConnectionProperties.java
  2. 2
      org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/DataSourceFactory.java
  3. 2
      org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/DatabasePopulator.java
  4. 2
      org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurerFactory.java
  5. 6
      org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java
  6. 1
      org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseType.java
  7. 9
      org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/ResourceDatabasePopulator.java
  8. 19
      org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/SimpleDriverDataSourceFactory.java

3
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/ConnectionProperties.java

@ -16,7 +16,8 @@ @@ -16,7 +16,8 @@
package org.springframework.jdbc.datasource.embedded;
/**
* Allows DataSource connection properties to be configured in a DataSource implementation independent manner.
* DataSourceFactory helper that allows essential JDBC connection properties to be configured consistently,
* independent of the actual DataSource implementation.
* @author Keith Donald
* @see DataSourceFactory
*/

2
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/DataSourceFactory.java

@ -20,7 +20,7 @@ import javax.sql.DataSource; @@ -20,7 +20,7 @@ import javax.sql.DataSource;
import org.springframework.jdbc.datasource.SimpleDriverDataSource;
/**
* A factory for DataSource implementation, such as a {@link SimpleDriverDataSource} or connection pool such as Apache DBCP or c3p0.
* Encapsulates the creation of a particular DataSource implementation, such as a {@link SimpleDriverDataSource} or connection pool such as Apache DBCP or c3p0.
* Call {@link #getConnectionProperties()} to configure normalized DataSource properties before calling {@link #getDataSource()} to actually get the configured DataSource instance.
* @author Keith Donald
*/

2
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/DatabasePopulator.java

@ -19,7 +19,7 @@ import java.sql.Connection; @@ -19,7 +19,7 @@ import java.sql.Connection;
import java.sql.SQLException;
/**
* Strategy for populating a database with data.
* Strategy used to populate an embedded database during initialization.
* @author Keith Donald
* @see ResourceDatabasePopulator
*/

2
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurerFactory.java

@ -18,7 +18,7 @@ package org.springframework.jdbc.datasource.embedded; @@ -18,7 +18,7 @@ package org.springframework.jdbc.datasource.embedded;
import org.springframework.util.Assert;
/**
* Package private factory for mapping well-known {@link EmbeddedDatabaseType embedded database types} to
* Maps well-known {@link EmbeddedDatabaseType embedded database types} to
* {@link EmbeddedDatabaseConfigurer} strategies.
* @author Keith Donald
*/

6
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java

@ -26,13 +26,13 @@ import org.apache.commons.logging.LogFactory; @@ -26,13 +26,13 @@ import org.apache.commons.logging.LogFactory;
import org.springframework.util.Assert;
/**
* Returns a {@link EmbeddedDatabase} instance pre-populated with test data. When the database is returned, callers are
* guaranteed that the database schema and test data will have already been loaded.
* Creates a {@link EmbeddedDatabase} instance.
* Callers are guaranteed that the returned database has been fully initialized and populated.
* <p>
* Can be configured:<br>
* Call {@link #setDatabaseName(String)} to change the name of the database.<br>
* Call {@link #setDatabaseType(EmbeddedDatabaseType)} to set the database type if you wish to use one of the supported types.<br>
* Call {@link #setDatabaseConfigurer(EmbeddedDatabaseConfigurer)} to set a configuration strategy for your own embedded database type.<br>
* Call {@link #setDatabaseConfigurer(EmbeddedDatabaseConfigurer)} to configure support for your own embedded database type.<br>
* Call {@link #setDatabasePopulator(DatabasePopulator)} to change the algorithm used to populate the database.<br>
* Call {@link #setDataSourceFactory(DataSourceFactory)} to change the type of DataSource used to connect to the database.<br>
* Call {@link #getDatabase()} to get the {@link EmbeddedDatabase} instance.<br>

1
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseType.java

@ -18,7 +18,6 @@ package org.springframework.jdbc.datasource.embedded; @@ -18,7 +18,6 @@ package org.springframework.jdbc.datasource.embedded;
/**
* A supported embedded database type.
* @author Keith Donald
* @see HsqlEmbeddedDatabaseConfigurer
*/
public enum EmbeddedDatabaseType {
HSQL;

9
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/ResourceDatabasePopulator.java

@ -33,10 +33,11 @@ import org.springframework.util.StringUtils; @@ -33,10 +33,11 @@ import org.springframework.util.StringUtils;
/**
* Populates a database from schema and test-data SQL defined in external resources. By default, looks for a schema.sql
* file and test-data.sql resource in the root of the classpath.
*
* May be configured. Call {@link #setSchemaLocation(Resource)} to configure the location of the database schema file.
* Call {@link #setTestDataLocation(Resource)} to configure the location of the test data file. Call
* {@link #setSqlScriptEncoding(String)} to set the encoding for the schema and test data SQL.
* <p>
* May be configured:<br>
* Call {@link #setSchemaLocation(Resource)} to configure the location of the database schema file.<br>
* Call {@link #setTestDataLocation(Resource)} to configure the location of the test data file.<br>
* Call {@link #setSqlScriptEncoding(String)} to set the encoding for the schema and test data SQL.<br>
*/
public class ResourceDatabasePopulator implements DatabasePopulator {

19
org.springframework.jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/SimpleDriverDataSourceFactory.java

@ -1,9 +1,28 @@ @@ -1,9 +1,28 @@
/*
* Copyright 2002-2009 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.datasource.embedded;
import javax.sql.DataSource;
import org.springframework.jdbc.datasource.SimpleDriverDataSource;
/**
* Creates a {@link SimpleDriverDataSource}.
* @author Keith Donald
*/
final class SimpleDriverDataSourceFactory implements DataSourceFactory {
private SimpleDriverDataSource dataSource = new SimpleDriverDataSource();

Loading…
Cancel
Save