-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
49 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 ([email protected]) | ||
|
@@ -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<String, Any> { | ||
return Gson().fromJson(properties, object : TypeToken<Map<String, Any>>() {}.type) | ||
} | ||
|
||
|
||
@JsonIgnore | ||
|
@@ -64,8 +67,8 @@ open class SimpleEndpoint( | |
if (driverClassName != null) { | ||
dataSourceNew.driverClassName = driverClassName | ||
} | ||
if (url != null) { | ||
dataSourceNew.url = url | ||
if (properties()["url"] != null) { | ||
dataSourceNew.url = properties()["url"].toString() | ||
} | ||
if (user != null) { | ||
dataSourceNew.username = user | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters