Browse Source

DATAJDBC-258 - Integration test support for MS SQL Server added.

This adds MS-SQL-Server via Testcontainers to the set of databases available for integration testing.
For this purpose it accepts the EULA of MS SQL Server.

Failing tests are ignored to be fixed in separate issues.

Original pull request: #98.
pull/99/head
tlang 7 years ago committed by Jens Schauder
parent
commit
4f6ecf5d48
  1. 26
      pom.xml
  2. 14
      spring-data-jdbc/pom.xml
  3. 41
      spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/DefaultDataAccessStrategy.java
  4. 3
      spring-data-jdbc/src/main/java/org/springframework/data/jdbc/support/JdbcUtil.java
  5. 4
      spring-data-jdbc/src/test/java/org/springframework/data/jdbc/core/AggregateTemplateIntegrationTests.java
  6. 7
      spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryPropertyConversionIntegrationTests.java
  7. 3
      spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryWithCollectionsIntegrationTests.java
  8. 3
      spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryWithListsIntegrationTests.java
  9. 3
      spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryWithMapsIntegrationTests.java
  10. 56
      spring-data-jdbc/src/test/java/org/springframework/data/jdbc/testing/MsSqlDataSourceConfiguration.java
  11. 1
      spring-data-jdbc/src/test/resources/container-license-acceptance.txt
  12. 15
      spring-data-jdbc/src/test/resources/org.springframework.data.jdbc.core/AggregateTemplateIntegrationTests-mssql.sql
  13. 2
      spring-data-jdbc/src/test/resources/org.springframework.data.jdbc.repository.config/EnableJdbcRepositoriesIntegrationTests-mssql.sql
  14. 5
      spring-data-jdbc/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryIdGenerationIntegrationTests-mssql.sql
  15. 2
      spring-data-jdbc/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryIntegrationTests-mssql.sql
  16. 4
      spring-data-jdbc/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryManipulateDbActionsIntegrationTests-mssql.sql
  17. 2
      spring-data-jdbc/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryPropertyConversionIntegrationTests-mssql.sql
  18. 4
      spring-data-jdbc/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithCollectionsIntegrationTests-mssql.sql
  19. 4
      spring-data-jdbc/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithCollectionsNoIdIntegrationTests-mssql.sql
  20. 4
      spring-data-jdbc/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithListsIntegrationTests-mssql.sql
  21. 4
      spring-data-jdbc/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithMapsIntegrationTests-mssql.sql

26
pom.xml

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.data</groupId>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-relational-parent</artifactId>
<version>1.1.0.BUILD-SNAPSHOT</version>
<packaging>pom</packaging>
@ -29,12 +29,14 @@ @@ -29,12 +29,14 @@
<degraph-check.version>0.1.4</degraph-check.version>
<hsqldb.version>2.2.8</hsqldb.version>
<mssql.verion>7.0.0.jre8</mssql.verion>
<mybatis.version>3.4.6</mybatis.version>
<mybatis-spring.version>1.3.2</mybatis-spring.version>
<mysql-connector-java.version>5.1.41</mysql-connector-java.version>
<postgresql.version>42.0.0</postgresql.version>
<mariadb-java-client.version>2.2.3</mariadb-java-client.version>
<testcontainers.version>1.7.3</testcontainers.version>
<testcontainers.version>1.9.1</testcontainers.version>
</properties>
<inceptionYear>2017</inceptionYear>
@ -164,6 +166,24 @@ @@ -164,6 +166,24 @@
</systemPropertyVariables>
</configuration>
</execution>
<execution>
<id>mssql-test</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<includes>
<include>**/*IntegrationTests.java</include>
</includes>
<excludes>
<exclude>**/*HsqlIntegrationTests.java</exclude>
</excludes>
<systemPropertyVariables>
<spring.profiles.active>mssql</spring.profiles.active>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
@ -177,7 +197,7 @@ @@ -177,7 +197,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<version>2.22.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>

14
spring-data-jdbc/pom.xml

@ -158,6 +158,13 @@ @@ -158,6 +158,13 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>${mssql.verion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>de.schauderhaft.degraph</groupId>
<artifactId>degraph-check</artifactId>
@ -192,6 +199,13 @@ @@ -192,6 +199,13 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>mssqlserver</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

41
spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/DefaultDataAccessStrategy.java

@ -24,6 +24,7 @@ import java.util.Map; @@ -24,6 +24,7 @@ import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
import org.springframework.dao.DataRetrievalFailureException;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.dao.InvalidDataAccessApiUsageException;
import org.springframework.data.jdbc.support.JdbcUtil;
@ -48,6 +49,7 @@ import org.springframework.util.Assert; @@ -48,6 +49,7 @@ import org.springframework.util.Assert;
*
* @author Jens Schauder
* @author Mark Paluch
* @author Thomas Lang
*/
@RequiredArgsConstructor
public class DefaultDataAccessStrategy implements DataAccessStrategy {
@ -319,20 +321,31 @@ public class DefaultDataAccessStrategy implements DataAccessStrategy { @@ -319,20 +321,31 @@ public class DefaultDataAccessStrategy implements DataAccessStrategy {
private <S> Object getIdFromHolder(KeyHolder holder, RelationalPersistentEntity<S> persistentEntity) {
try {
// MySQL just returns one value with a special name
return holder.getKey();
} catch (InvalidDataAccessApiUsageException e) {
// Postgres returns a value for each column
Map<String, Object> keys = holder.getKeys();
if (keys == null || persistentEntity.getIdProperty() == null) {
return null;
}
return keys.get(persistentEntity.getIdColumn());
}
}
try {
// MySQL just returns one value with a special name
return holder.getKey();
} catch (InvalidDataAccessApiUsageException e) {
// Postgres returns a value for each column
Map<String, Object> keys = holder.getKeys();
if (keys == null || persistentEntity.getIdProperty() == null) {
return null;
}
return keys.get(persistentEntity.getIdColumn());
} catch (DataRetrievalFailureException e) {
// thomas.lang@th-deg.de
// mssql causes org.springframework.dao.DataRetrievalFailureException:
// The generated key is not of a supported numeric type. Unable to cast [null] to [java.lang.Number]
// see what happens here
Map<String, Object> keys = holder.getKeys();
if (keys == null || persistentEntity.getIdProperty() == null) {
return null;
}
return null;
}
}
private EntityRowMapper<?> getEntityRowMapper(Class<?> domainType) {
return new EntityRowMapper<>(getRequiredPersistentEntity(domainType), context, converter, accessStrategy);

3
spring-data-jdbc/src/main/java/org/springframework/data/jdbc/support/JdbcUtil.java

@ -32,6 +32,7 @@ import org.springframework.jdbc.support.JdbcUtils; @@ -32,6 +32,7 @@ import org.springframework.jdbc.support.JdbcUtils;
* Contains methods dealing with the quirks of JDBC, independent of any Entity, Aggregate or Repository abstraction.
*
* @author Jens Schauder
* @author Thomas Lang
*/
@UtilityClass
public class JdbcUtil {
@ -42,7 +43,7 @@ public class JdbcUtil { @@ -42,7 +43,7 @@ public class JdbcUtil {
sqlTypeMappings.put(String.class, Types.VARCHAR);
sqlTypeMappings.put(BigInteger.class, Types.BIGINT);
sqlTypeMappings.put(BigDecimal.class, Types.NUMERIC);
sqlTypeMappings.put(BigDecimal.class, Types.DECIMAL);
sqlTypeMappings.put(Byte.class, Types.TINYINT);
sqlTypeMappings.put(byte.class, Types.TINYINT);
sqlTypeMappings.put(Short.class, Types.SMALLINT);

4
spring-data-jdbc/src/test/java/org/springframework/data/jdbc/core/AggregateTemplateIntegrationTests.java

@ -34,6 +34,7 @@ import org.springframework.data.jdbc.testing.TestConfiguration; @@ -34,6 +34,7 @@ import org.springframework.data.jdbc.testing.TestConfiguration;
import org.springframework.data.relational.core.conversion.RelationalConverter;
import org.springframework.data.relational.core.mapping.Column;
import org.springframework.data.relational.core.mapping.RelationalMappingContext;
import org.springframework.test.annotation.IfProfileValue;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.rules.SpringClassRule;
import org.springframework.test.context.junit4.rules.SpringMethodRule;
@ -46,6 +47,7 @@ import java.util.List; @@ -46,6 +47,7 @@ import java.util.List;
* Integration tests for {@link JdbcAggregateTemplate}.
*
* @author Jens Schauder
* @author Thomas Lang
*/
@ContextConfiguration
@Transactional
@ -143,6 +145,7 @@ public class AggregateTemplateIntegrationTests { @@ -143,6 +145,7 @@ public class AggregateTemplateIntegrationTests {
}
@Test // DATAJDBC-112
@IfProfileValue(name = "spring.profiles.active", values = {"mysql", "postgres", "mariadb", "default"}) // DATAJDBC-278
public void updateReferencedEntityFromNull() {
legoSet.setManual(null);
@ -201,6 +204,7 @@ public class AggregateTemplateIntegrationTests { @@ -201,6 +204,7 @@ public class AggregateTemplateIntegrationTests {
}
@Test // DATAJDBC-112
@IfProfileValue(name = "spring.profiles.active", values = {"mysql", "postgres", "mariadb", "default"}) // DATAJDBC-278
public void changeReferencedEntity() {
template.save(legoSet);

7
spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryPropertyConversionIntegrationTests.java

@ -43,6 +43,7 @@ import org.springframework.data.jdbc.repository.support.JdbcRepositoryFactory; @@ -43,6 +43,7 @@ import org.springframework.data.jdbc.repository.support.JdbcRepositoryFactory;
import org.springframework.data.jdbc.testing.TestConfiguration;
import org.springframework.data.relational.core.mapping.event.BeforeSaveEvent;
import org.springframework.data.repository.CrudRepository;
import org.springframework.test.annotation.IfProfileValue;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.rules.SpringClassRule;
import org.springframework.test.context.junit4.rules.SpringMethodRule;
@ -53,6 +54,7 @@ import org.springframework.transaction.annotation.Transactional; @@ -53,6 +54,7 @@ import org.springframework.transaction.annotation.Transactional;
* something the database driver can handle.
*
* @author Jens Schauder
* @author Thomas Lang
*/
@ContextConfiguration
@Transactional
@ -88,6 +90,7 @@ public class JdbcRepositoryPropertyConversionIntegrationTests { @@ -88,6 +90,7 @@ public class JdbcRepositoryPropertyConversionIntegrationTests {
@Autowired DummyEntityRepository repository;
@Test // DATAJDBC-95
@IfProfileValue(name = "spring.profiles.active", values = {"mysql", "postgres", "mariadb", "default"}) // DATAJDBC-278
public void saveAndLoadAnEntity() {
EntityWithColumnsRequiringConversions entity = repository.save(createDummyEntity());
@ -106,6 +109,7 @@ public class JdbcRepositoryPropertyConversionIntegrationTests { @@ -106,6 +109,7 @@ public class JdbcRepositoryPropertyConversionIntegrationTests {
}
@Test // DATAJDBC-95
@IfProfileValue(name = "spring.profiles.active", values = {"mysql", "postgres", "mariadb", "default"}) // DATAJDBC-278
public void existsById() {
EntityWithColumnsRequiringConversions entity = repository.save(createDummyEntity());
@ -114,6 +118,7 @@ public class JdbcRepositoryPropertyConversionIntegrationTests { @@ -114,6 +118,7 @@ public class JdbcRepositoryPropertyConversionIntegrationTests {
}
@Test // DATAJDBC-95
@IfProfileValue(name = "spring.profiles.active", values = {"mysql", "postgres", "mariadb", "default"}) // DATAJDBC-278
public void findAllById() {
EntityWithColumnsRequiringConversions entity = repository.save(createDummyEntity());
@ -122,6 +127,7 @@ public class JdbcRepositoryPropertyConversionIntegrationTests { @@ -122,6 +127,7 @@ public class JdbcRepositoryPropertyConversionIntegrationTests {
}
@Test // DATAJDBC-95
@IfProfileValue(name = "spring.profiles.active", values = {"mysql", "postgres", "mariadb", "default"}) // DATAJDBC-278
public void deleteAll() {
EntityWithColumnsRequiringConversions entity = repository.save(createDummyEntity());
@ -132,6 +138,7 @@ public class JdbcRepositoryPropertyConversionIntegrationTests { @@ -132,6 +138,7 @@ public class JdbcRepositoryPropertyConversionIntegrationTests {
}
@Test // DATAJDBC-95
@IfProfileValue(name = "spring.profiles.active", values = {"mysql", "postgres", "mariadb", "default"}) // DATAJDBC-278
public void deleteById() {
EntityWithColumnsRequiringConversions entity = repository.save(createDummyEntity());

3
spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryWithCollectionsIntegrationTests.java

@ -37,6 +37,7 @@ import org.springframework.data.jdbc.repository.support.JdbcRepositoryFactory; @@ -37,6 +37,7 @@ import org.springframework.data.jdbc.repository.support.JdbcRepositoryFactory;
import org.springframework.data.jdbc.testing.TestConfiguration;
import org.springframework.data.repository.CrudRepository;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.test.annotation.IfProfileValue;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.rules.SpringClassRule;
import org.springframework.test.context.junit4.rules.SpringMethodRule;
@ -46,6 +47,7 @@ import org.springframework.transaction.annotation.Transactional; @@ -46,6 +47,7 @@ import org.springframework.transaction.annotation.Transactional;
* Very simple use cases for creation and usage of JdbcRepositories.
*
* @author Jens Schauder
* @author Thomas Lang
*/
@ContextConfiguration
@Transactional
@ -134,6 +136,7 @@ public class JdbcRepositoryWithCollectionsIntegrationTests { @@ -134,6 +136,7 @@ public class JdbcRepositoryWithCollectionsIntegrationTests {
}
@Test // DATAJDBC-113
@IfProfileValue(name = "spring.profiles.active", values = {"mysql", "postgres", "mariadb", "default"}) // DATAJDBC-278
public void updateSet() {
Element element1 = createElement("one");

3
spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryWithListsIntegrationTests.java

@ -37,6 +37,7 @@ import org.springframework.data.jdbc.repository.support.JdbcRepositoryFactory; @@ -37,6 +37,7 @@ import org.springframework.data.jdbc.repository.support.JdbcRepositoryFactory;
import org.springframework.data.jdbc.testing.TestConfiguration;
import org.springframework.data.repository.CrudRepository;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.test.annotation.IfProfileValue;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.rules.SpringClassRule;
import org.springframework.test.context.junit4.rules.SpringMethodRule;
@ -46,6 +47,7 @@ import org.springframework.transaction.annotation.Transactional; @@ -46,6 +47,7 @@ import org.springframework.transaction.annotation.Transactional;
* Very simple use cases for creation and usage of JdbcRepositories for Entities that contain {@link List}s.
*
* @author Jens Schauder
* @author Thomas Lang
*/
@ContextConfiguration
@Transactional
@ -134,6 +136,7 @@ public class JdbcRepositoryWithListsIntegrationTests { @@ -134,6 +136,7 @@ public class JdbcRepositoryWithListsIntegrationTests {
}
@Test // DATAJDBC-130
@IfProfileValue(name = "spring.profiles.active", values = {"mysql", "postgres", "mariadb", "default"}) // DATAJDBC-278
public void updateList() {
Element element1 = createElement("one");

3
spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryWithMapsIntegrationTests.java

@ -36,6 +36,7 @@ import org.springframework.data.jdbc.repository.support.JdbcRepositoryFactory; @@ -36,6 +36,7 @@ import org.springframework.data.jdbc.repository.support.JdbcRepositoryFactory;
import org.springframework.data.jdbc.testing.TestConfiguration;
import org.springframework.data.repository.CrudRepository;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.test.annotation.IfProfileValue;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.rules.SpringClassRule;
import org.springframework.test.context.junit4.rules.SpringMethodRule;
@ -45,6 +46,7 @@ import org.springframework.transaction.annotation.Transactional; @@ -45,6 +46,7 @@ import org.springframework.transaction.annotation.Transactional;
* Very simple use cases for creation and usage of JdbcRepositories for Entities that contain {@link java.util.Map}s.
*
* @author Jens Schauder
* @author Thomas Lang
*/
@ContextConfiguration
@Transactional
@ -133,6 +135,7 @@ public class JdbcRepositoryWithMapsIntegrationTests { @@ -133,6 +135,7 @@ public class JdbcRepositoryWithMapsIntegrationTests {
}
@Test // DATAJDBC-131
@IfProfileValue(name = "spring.profiles.active", values = {"mysql", "postgres", "mariadb", "default"}) // DATAJDBC-278
public void updateMap() {
Element element1 = createElement("one");

56
spring-data-jdbc/src/test/java/org/springframework/data/jdbc/testing/MsSqlDataSourceConfiguration.java

@ -0,0 +1,56 @@ @@ -0,0 +1,56 @@
/*
* Copyright 2017-2018 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.data.jdbc.testing;
import com.microsoft.sqlserver.jdbc.SQLServerDataSource;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.testcontainers.containers.MSSQLServerContainer;
import javax.sql.DataSource;
/**
* {@link DataSource} setup for PostgreSQL.
* <p>
* Configuration for a MSSQL Datasource.
*
* @author Thomas Lang
* @see <a href="https://github.com/testcontainers/testcontainers-java/tree/master/modules/mssqlserver"></a>
*/
@Configuration
@Profile({"mssql"})
public class MsSqlDataSourceConfiguration extends DataSourceConfiguration {
private static final MSSQLServerContainer mssqlserver = new MSSQLServerContainer();
static {
mssqlserver.start();
}
/*
* (non-Javadoc)
* @see org.springframework.data.jdbc.testing.DataSourceConfiguration#createDataSource()
*/
@Override
protected DataSource createDataSource() {
SQLServerDataSource sqlServerDataSource = new SQLServerDataSource();
sqlServerDataSource.setURL(mssqlserver.getJdbcUrl());
sqlServerDataSource.setUser(mssqlserver.getUsername());
sqlServerDataSource.setPassword(mssqlserver.getPassword());
return sqlServerDataSource;
}
}

1
spring-data-jdbc/src/test/resources/container-license-acceptance.txt

@ -0,0 +1 @@ @@ -0,0 +1 @@
microsoft/mssql-server-linux:2017-CU6

15
spring-data-jdbc/src/test/resources/org.springframework.data.jdbc.core/AggregateTemplateIntegrationTests-mssql.sql

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
DROP TABLE IF EXISTS LEGO_SET;
DROP TABLE IF EXISTS MANUAL;
CREATE TABLE LEGO_SET ( id BIGINT IDENTITY PRIMARY KEY, NAME VARCHAR(30));
CREATE TABLE MANUAL ( id BIGINT IDENTITY PRIMARY KEY, LEGO_SET BIGINT, ALTERNATIVE BIGINT, CONTENT VARCHAR(2000));
ALTER TABLE MANUAL ADD FOREIGN KEY (LEGO_SET) REFERENCES LEGO_SET(id);
DROP TABLE IF EXISTS ONE_TO_ONE_PARENT;
DROP TABLE IF EXISTS Child_No_Id;
CREATE TABLE ONE_TO_ONE_PARENT ( id BIGINT IDENTITY PRIMARY KEY, content VARCHAR(30));
CREATE TABLE Child_No_Id (ONE_TO_ONE_PARENT BIGINT PRIMARY KEY, content VARCHAR(30));
DROP TABLE IF EXISTS LIST_PARENT;
DROP TABLE IF EXISTS element_no_id;
CREATE TABLE LIST_PARENT ( id BIGINT IDENTITY PRIMARY KEY, NAME VARCHAR(100));
CREATE TABLE element_no_id ( content VARCHAR(100), LIST_PARENT_key BIGINT, LIST_PARENT BIGINT);

2
spring-data-jdbc/src/test/resources/org.springframework.data.jdbc.repository.config/EnableJdbcRepositoriesIntegrationTests-mssql.sql

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
DROP TABLE IF EXISTS Dummy_Entity;
CREATE TABLE Dummy_Entity ( id BIGINT IDENTITY PRIMARY KEY);

5
spring-data-jdbc/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryIdGenerationIntegrationTests-mssql.sql

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
DROP TABLE IF EXISTS ReadOnlyIdEntity;
DROP TABLE IF EXISTS PrimitiveIdEntity;
CREATE TABLE ReadOnlyIdEntity (ID BIGINT IDENTITY PRIMARY KEY, NAME VARCHAR(100));
CREATE TABLE PrimitiveIdEntity (ID BIGINT IDENTITY PRIMARY KEY, NAME VARCHAR(100));

2
spring-data-jdbc/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryIntegrationTests-mssql.sql

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
DROP TABLE IF EXISTS dummy_entity;
CREATE TABLE dummy_entity (id_Prop BIGINT IDENTITY PRIMARY KEY, NAME VARCHAR(100));

4
spring-data-jdbc/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryManipulateDbActionsIntegrationTests-mssql.sql

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
DROP TABLE IF EXISTS dummy_entity;
DROP TABLE IF EXISTS log;
CREATE TABLE dummy_entity ( id BIGINT IDENTITY PRIMARY KEY, NAME VARCHAR(100), DELETED CHAR(1), log BIGINT);
CREATE TABLE log ( id BIGINT, TEXT VARCHAR(100));

2
spring-data-jdbc/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryPropertyConversionIntegrationTests-mssql.sql

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
DROP TABLE IF EXISTS ENTITY_WITH_COLUMNS_REQUIRING_CONVERSIONS;
CREATE TABLE ENTITY_WITH_COLUMNS_REQUIRING_CONVERSIONS ( id_Timestamp DATETIME PRIMARY KEY, bool bit, SOME_ENUM VARCHAR(100), big_Decimal DECIMAL(38), big_Integer DECIMAL(20), date DATETIME, local_Date_Time DATETIME, zoned_Date_Time VARCHAR(30));

4
spring-data-jdbc/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithCollectionsIntegrationTests-mssql.sql

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
DROP TABLE IF EXISTS dummy_entity;
DROP TABLE IF EXISTS element;
CREATE TABLE dummy_entity ( id BIGINT identity PRIMARY KEY, NAME VARCHAR(100));
CREATE TABLE element (id BIGINT identity PRIMARY KEY, content VARCHAR(100), dummy_entity BIGINT);

4
spring-data-jdbc/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithCollectionsNoIdIntegrationTests-mssql.sql

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
DROP TABLE IF EXISTS dummy_entity;
DROP TABLE IF EXISTS element;
CREATE TABLE dummy_entity ( id BIGINT identity PRIMARY KEY, NAME VARCHAR(100));
CREATE TABLE element (content VARCHAR(100), dummy_entity BIGINT);

4
spring-data-jdbc/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithListsIntegrationTests-mssql.sql

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
DROP TABLE IF EXISTS dummy_entity;
DROP TABLE IF EXISTS element;
CREATE TABLE dummy_entity ( id BIGINT IDENTITY PRIMARY KEY, NAME VARCHAR(100));
CREATE TABLE element (id BIGINT IDENTITY PRIMARY KEY, content VARCHAR(100), Dummy_Entity_key BIGINT,dummy_entity BIGINT);

4
spring-data-jdbc/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithMapsIntegrationTests-mssql.sql

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
DROP TABLE IF EXISTS dummy_entity;
DROP TABLE IF EXISTS element;
CREATE TABLE dummy_entity ( id BIGINT IDENTITY PRIMARY KEY, NAME VARCHAR(100));
CREATE TABLE element (id BIGINT IDENTITY PRIMARY KEY, content VARCHAR(100), Dummy_Entity_key VARCHAR(100),dummy_entity BIGINT);
Loading…
Cancel
Save