forked from Dreampie/Resty
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
resty-orm/src/main/java/cn/dreampie/orm/provider/ds/DsDataSourceProvider.java
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package cn.dreampie.orm.provider.ds; | ||
|
||
import cn.dreampie.orm.dialect.Dialect; | ||
import cn.dreampie.orm.provider.DataSourceProvider; | ||
|
||
import javax.sql.DataSource; | ||
|
||
/** | ||
* Created by zhaopeng on 16/1/21. | ||
*/ | ||
public class DsDataSourceProvider implements DataSourceProvider { | ||
private DataSource dataSource; | ||
private Dialect dialect; | ||
private boolean showSql = false; | ||
private String dsName = "default"; | ||
|
||
public DsDataSourceProvider(DataSource dataSource, Dialect dialect) { | ||
this.dataSource = dataSource; | ||
this.dialect = dialect; | ||
} | ||
|
||
public DsDataSourceProvider(DataSource dataSource, Dialect dialect, boolean showSql, String dsName) { | ||
this.dataSource = dataSource; | ||
this.dialect = dialect; | ||
this.showSql = showSql; | ||
this.dsName = dsName; | ||
} | ||
|
||
public DataSource getDataSource() { | ||
return this.dataSource; | ||
} | ||
|
||
public Dialect getDialect() { | ||
return this.dialect; | ||
} | ||
|
||
public String getDsName() { | ||
return dsName; | ||
} | ||
|
||
public boolean isShowSql() { | ||
return this.showSql; | ||
} | ||
|
||
public void close() { | ||
//do nothing becouse it have no close method | ||
} | ||
|
||
} |