@@ -14,10 +14,44 @@ You can obtain [JSqlServerBulkInsert] from Maven by adding the following:
1414<dependency >
1515 <groupId >de.bytefish</groupId >
1616 <artifactId >jsqlserverbulkinsert</artifactId >
17- <version >1.5 </version >
17+ <version >2.0 </version >
1818</dependency >
1919```
2020
21+
22+ ## Supported Types ##
23+
24+ Please read up the Microsoft Documentation for understanding the mapping between SQL Server Types and JDBC Data Types:
25+
26+ * (Understanding the JDBC Driver Data Types)[ https://docs.microsoft.com/en-us/sql/connect/jdbc/understanding-the-jdbc-driver-data-types ]
27+
28+ The following JDBC Types are supported by the library:
29+
30+ * [ Numeric Types] ( http://www.postgresql.org/docs/current/static/datatype-numeric.html )
31+ * TINYINT
32+ * SMALLINT
33+ * INTEGER
34+ * BIGINT
35+ * NUMERIC
36+ * REAL
37+ * DOUBLE
38+ * Date/Time Types
39+ * DATE
40+ * TIMESTAMP
41+ * TIMESTAMP with Timezone
42+ * Boolean Type
43+ * BIT
44+ * Character / Text Types
45+ * CHAR
46+ * NCHAR
47+ * CLOB
48+ * VARCHAR
49+ * NVARCHAR
50+ * LONGVARCHAR
51+ * NLONGVARCHAR
52+ * Binary Data Types
53+ * VARBINARY
54+
2155## Getting Started ##
2256
2357Imagine `` 1,000,000 `` Persons should be inserted into an SQL Server database.
@@ -35,7 +69,7 @@ Bulk Inserting ``1,000,000``entities to a SQL Server 2016 database took ``5`` Se
3569The domain model could be the `` Person `` class with a First Name, Last Name and a birth date.
3670
3771``` java
38- // Copyright (c) Philipp Wagner. All rights reserved.
72+ // Copyright (c) Philipp Wagner and Victor Lee . All rights reserved.
3973// Licensed under the MIT license. See LICENSE file in the project root for full license information.
4074
4175package de.bytefish.jsqlserverbulkinsert.test.model ;
@@ -85,7 +119,7 @@ To bulk insert the ``Person`` data to a SQL Server database it is important to k
85119between the Java Object and the Database Columns:
86120
87121``` java
88- // Copyright (c) Philipp Wagner. All rights reserved.
122+ // Copyright (c) Philipp Wagner and Victor Lee . All rights reserved.
89123// Licensed under the MIT license. See LICENSE file in the project root for full license information.
90124
91125package de.bytefish.jsqlserverbulkinsert.test.integration ;
@@ -98,16 +132,17 @@ public class PersonMapping extends AbstractMapping<Person> {
98132 public PersonMapping () {
99133 super (" dbo" , " UnitTest" );
100134
101- mapString (" FirstName" , Person :: getFirstName);
102- mapString (" LastName" , Person :: getLastName);
135+ mapNvarchar (" FirstName" , Person :: getFirstName);
136+ mapNvarchar (" LastName" , Person :: getLastName);
103137 mapDate(" BirthDate" , Person :: getBirthDate);
104138 }
105139}
106140```
107141
108142### Construct and use the SqlServerBulkInsert ###
109143
110- The `` AbstractMapping `` is used to instantiate a `` SqlServerBulkInsert `` , which provides a `` saveAll `` method to store a given stream of data.
144+ The `` AbstractMapping `` is used to instantiate a `` SqlServerBulkInsert `` , which provides
145+ a `` saveAll `` method to store a given stream of data.
111146
112147``` java
113148// Instantiate the SqlServerBulkInsert class:
@@ -119,15 +154,14 @@ bulkInsert.saveAll(connection, persons.stream());
119154And the full Integration Test:
120155
121156``` java
122- // Copyright (c) Philipp Wagner. All rights reserved.
157+ // Copyright (c) Philipp Wagner and Victor Lee . All rights reserved.
123158// Licensed under the MIT license. See LICENSE file in the project root for full license information.
124159
125160package de.bytefish.jsqlserverbulkinsert.test.integration ;
126161
127- import de.bytefish.jsqlserverbulkinsert.mapping.AbstractMapping ;
128- import de.bytefish.jsqlserverbulkinsert.test.model.Person ;
129162import de.bytefish.jsqlserverbulkinsert.SqlServerBulkInsert ;
130163import de.bytefish.jsqlserverbulkinsert.test.base.TransactionalTestBase ;
164+ import de.bytefish.jsqlserverbulkinsert.test.model.Person ;
131165import de.bytefish.jsqlserverbulkinsert.test.utils.MeasurementUtils ;
132166import org.junit.Assert ;
133167import org.junit.Test ;
0 commit comments