-
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 pull request #26 from ZorTik/development
Allow to use options in SQLConnectionPool.java
- Loading branch information
Showing
13 changed files
with
166 additions
and
59 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
api/src/main/java/me/zort/sqllib/api/ISQLConnectionBuilder.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,7 @@ | ||
package me.zort.sqllib.api; | ||
|
||
public interface ISQLConnectionBuilder<C extends SQLConnection> { | ||
|
||
C build(ISQLDatabaseOptions options); | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
api/src/main/java/me/zort/sqllib/api/ISQLDatabaseOptions.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,20 @@ | ||
package me.zort.sqllib.api; | ||
|
||
import com.google.gson.Gson; | ||
import me.zort.sqllib.api.options.NamingStrategy; | ||
|
||
public interface ISQLDatabaseOptions { | ||
|
||
void setAutoReconnect(boolean autoReconnect); | ||
void setDebug(boolean debug); | ||
void setLogSqlErrors(boolean logSqlErrors); | ||
void setNamingStrategy(NamingStrategy namingStrategy); | ||
void setGson(Gson gson); | ||
|
||
boolean isAutoReconnect(); | ||
boolean isDebug(); | ||
boolean isLogSqlErrors(); | ||
NamingStrategy getNamingStrategy(); | ||
Gson getGson(); | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
api/src/main/java/me/zort/sqllib/api/cache/CacheManager.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,25 @@ | ||
package me.zort.sqllib.api.cache; | ||
|
||
import me.zort.sqllib.api.Query; | ||
import me.zort.sqllib.api.data.QueryResult; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public interface CacheManager { | ||
|
||
void set(@NotNull Query query, @NotNull QueryResult result); | ||
@Nullable QueryResult get(@NotNull Query query, boolean isExec); | ||
|
||
static CacheManager noCache() { | ||
return new CacheManager() { | ||
@Override | ||
public void set(@NotNull Query query, @NotNull QueryResult result) { | ||
} | ||
@Override | ||
public @Nullable QueryResult get(@NotNull Query query, boolean isExec) { | ||
return null; | ||
} | ||
}; | ||
} | ||
|
||
} |
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
20 changes: 20 additions & 0 deletions
20
core/src/main/java/me/zort/sqllib/cache/ExpirableEntriesCacheManager.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,20 @@ | ||
package me.zort.sqllib.cache; | ||
|
||
import me.zort.sqllib.api.Query; | ||
import me.zort.sqllib.api.cache.CacheManager; | ||
import me.zort.sqllib.api.data.QueryResult; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public class ExpirableEntriesCacheManager implements CacheManager { | ||
@Override | ||
public void set(@NotNull Query query, @NotNull QueryResult result) { | ||
// TODO: Implement | ||
} | ||
|
||
@Override | ||
public @Nullable QueryResult get(@NotNull Query query, boolean isExec) { | ||
// TODO: Implement | ||
return null; | ||
} | ||
} |
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
Oops, something went wrong.