INSERT and UPDATE assignments/column lists no longer include the table prefix for a column as columns as the support is Dialect-specific and we should generally assume columns in these clauses to belong to the table used in the statement.
Extend Javadoc. Reorder constructors in the order of their parameter number. Add missing assertions. Introduce utility to create predicates. Remove unused fields. Add since tags. Reformat.
Original pull request: #123.
Some JDBC drivers depend on correct explicit type information in order to pass on parameters to the database.
So far CustomConversion had no way to provide that information.
With this change one can use @WritingConverter that converts to JdbcTypeAware in order to provide that information.
byte[] now also get stored as BINARY.
Original pull request: #123.
Ids used as backreferences now get properly converted.
Introduced Identifier to hold information about data that needs to be considered for inserts or updates but is not part of the entity.
Apart from column names and values they also hold information about the desired JdbcType in order to facilitate conversions.
This replaces the Map handed around in the past.
Original pull request: #118.
Javadoc, static factory methods, typos. Refactor SQL rendering from a shared stack-based implementation to independent delegating visitors. Introduce DelegatingVisitor and TypedSubtreeVisitor base classes. Introduce SelectList container. Extract nested renderes to top-level types.
Move SQL renderer to renderer package.
Extend In to multi-expression argument. Introduce helper methods in Table to create multiple columns. Introduce factory method on StatementBuilder to create a new builder given a collection of expressions.
Add support for comparison conditions and LIKE and equal/not equal/less with equals to/greater with equals to conditions.
Add condition creation methods to Column so Column objects can now create conditions for a fluent DSL as in (.where(left.isGreater(right)).
StatementBuilder.select(left).from(table).where(left.isGreater(right)).build().
Introduce RenderContext and RenderNamingStrategy.
Add since tags. Improve Javadoc.
Original pull request: #119.
We now provide a Statement Builder API along with a renderer to build statement object graphs and to render these to SQL.
SelectBuilder builder = StatementBuilder.select();
Table employee = SQL.table("employee");
Table department = SQL.table("department");
Column name = employee.column("name").as("emp_name");
Column department_name = employee.column("name").as("department_name");
Select select = builder.select(name, department_name).from(employee).join(department)
.on(SQL.column("department_id", employee)).equals(SQL.column("id", department))
.and(SQL.column("tenant", employee)).equals(SQL.column("tenant", department))
.orderBy(OrderByField.from(name).asc()).build();
String sql = SqlRenderer.render(select);
Original pull request: #119.
When a column has a quoted name it contains characters illegal for parameter names.
Therefore the parameter names now get sanitised.
Original pull request: #120.
Simplify column name discovery using Optionals utility methods. Add test to verify Column annotation precedence.
Javadoc, formatting.
Original pull request: #117.
We now provide a @MappedCollection annotation as replacement for @Column's keyColumn attribute.
class Person {
@MappedCollection(idColumn = "the_id", keyColumn = "the_key")
private List<Integer> mappedList;
}
Original pull request: #117.
Reverting breaking changes to JdbcConfiguration.
Deprecating JdbcConfiguration in favor of AbstractJdbcConfiguration.
Cleaning up the API to separate it from spring-data-relational and therefore R2DBC.
Original pull request: #116.
Unwrap multi-dimensional array types to determine the proper component type. Extend tests. Inline isCollectionOf[Entities|SimpleType]Like calls and remove utility methods on RelationalPersistentProperty as the usage-scope is specific to array handling.
Original pull request: #113.
So far the lookup of `NamedParameterJdbcOperations` and `DataAccessStrategy` could happend before these beans were registered resulting in failure to consider those beans.
The logic is now split in two parts:
If a bean name is given, this is configured on the BeanDefinition level in the JdbcRepositoryConfigExtension.
If no name is give a bean is looked up by type in the JdbcRepositoryFactoryBean.
This makes the code even simpler and uses standard Spring features instead of reimplementing them.
Original pull request: #115.
This file accepted the license condition of Microsoft for there Docker image when running tests.
Very likely without the person using this knowing that she is accepting a license.
The file now has to be explicitly provided.
The Travis CI build adds the container-license-acceptance.txt for the build only.
The decision was made not to offer `insert` and `update` as part of the repository interface.
It stays available as part of the `JdbcAggregateTemplate` which may be used directly or inside of a custom method implementation.
Formatting.
Removed AbstractRelationalEntityWriter.
Fixed integration test for MS-SQL.
Extracted some common test infrastructure.
Original pull request: #107.
This introduces the JdbcRepository interface which offers two additional methods beyond the CrudRepository:
`insert` and `update`.
Both methods skip the test if the aggregate is new and perform the respective operation.
Especially `insert` is useful for saving new aggregates which are new but have an ID set by the client and not generated by the database.
Original pull request: #107.