diff --git a/pom.xml b/pom.xml
index 116e79c5..4d11271d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -18,7 +18,7 @@
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
~ FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
~ SOFTWARE.
-->
@@ -189,11 +189,6 @@
h2
-
- com.google.code.gson
- gson
-
-
io.swagger
swagger-parser
@@ -228,9 +223,8 @@
- org.json
- json
- 20171018
+ com.google.code.gson
+ gson
diff --git a/src/main/kotlin/com/github/mgramin/sqlboot/model/connection/Endpoint.kt b/src/main/kotlin/com/github/mgramin/sqlboot/model/connection/Endpoint.kt
index f7b61e5e..29994708 100644
--- a/src/main/kotlin/com/github/mgramin/sqlboot/model/connection/Endpoint.kt
+++ b/src/main/kotlin/com/github/mgramin/sqlboot/model/connection/Endpoint.kt
@@ -30,8 +30,10 @@ interface Endpoint {
fun name(): String
+ @Deprecated("Move to properties")
fun dialect(): String
+ @Deprecated("Move to SQLResourceType")
fun getDataSource(): DataSource
fun properties(): Map
diff --git a/src/main/kotlin/com/github/mgramin/sqlboot/model/connection/DbConnectionList.kt b/src/main/kotlin/com/github/mgramin/sqlboot/model/connection/EndpointList.kt
similarity index 84%
rename from src/main/kotlin/com/github/mgramin/sqlboot/model/connection/DbConnectionList.kt
rename to src/main/kotlin/com/github/mgramin/sqlboot/model/connection/EndpointList.kt
index 85dab896..27927a88 100644
--- a/src/main/kotlin/com/github/mgramin/sqlboot/model/connection/DbConnectionList.kt
+++ b/src/main/kotlin/com/github/mgramin/sqlboot/model/connection/EndpointList.kt
@@ -36,10 +36,10 @@ import org.springframework.stereotype.Service
@Service
@Configuration
@ConfigurationProperties(prefix = "conf")
-open class DbConnectionList(val connections: List) {
+open class EndpointList(val endpoints: List) {
- fun getConnectionByName(name: String) = connections.first { v -> v.name().equals(name, ignoreCase = true) }
+ fun getConnectionByName(name: String) = endpoints.first { v -> v.name().equals(name, ignoreCase = true) }
- fun getConnectionsByMask(name: String) = connections.filter { v -> v.name().matches(name.toRegex()) }
+ fun getConnectionsByMask(name: String) = endpoints.filter { v -> v.name().matches(name.toRegex()) }
}
diff --git a/src/main/kotlin/com/github/mgramin/sqlboot/model/connection/SimpleEndpoint.kt b/src/main/kotlin/com/github/mgramin/sqlboot/model/connection/SimpleEndpoint.kt
index 33045fcb..dd8d3c09 100644
--- a/src/main/kotlin/com/github/mgramin/sqlboot/model/connection/SimpleEndpoint.kt
+++ b/src/main/kotlin/com/github/mgramin/sqlboot/model/connection/SimpleEndpoint.kt
@@ -26,8 +26,10 @@ package com.github.mgramin.sqlboot.model.connection
import com.fasterxml.jackson.annotation.JsonIgnore
import org.apache.tomcat.jdbc.pool.DataSource
-import org.json.JSONObject
import org.springframework.core.io.Resource
+import com.google.gson.Gson
+import com.google.gson.reflect.TypeToken
+
/**
* @author Maksim Gramin (mgramin@gmail.com)
@@ -37,7 +39,6 @@ import org.springframework.core.io.Resource
open class SimpleEndpoint(
var name: String? = null,
@JsonIgnore var baseFolder: Resource? = null,
- var url: String? = null,
var user: String? = null,
@JsonIgnore var password: String? = null,
var driverClassName: String? = null,
@@ -52,7 +53,9 @@ open class SimpleEndpoint(
private var dataSource: DataSource? = null
- override fun properties() = JSONObject(properties).toMap()
+ override fun properties(): Map {
+ return Gson().fromJson(properties, object : TypeToken