-
Notifications
You must be signed in to change notification settings - Fork 25
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
1 parent
7a45db8
commit 5c90f99
Showing
10 changed files
with
269 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ target | |
.settings | ||
.factorypath | ||
.apt_generated | ||
.vscode/ |
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
42 changes: 42 additions & 0 deletions
42
...spring-boot-core/src/main/java/org/seasar/doma/boot/DomaSpringBootSqlBuilderSettings.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,42 @@ | ||
package org.seasar.doma.boot; | ||
|
||
import java.util.function.Predicate; | ||
|
||
import org.seasar.doma.jdbc.SqlBuilderSettings; | ||
|
||
public class DomaSpringBootSqlBuilderSettings implements SqlBuilderSettings { | ||
|
||
private final Predicate<String> shouldRemoveBlockComment; | ||
private final Predicate<String> shouldRemoveLineComment; | ||
private final boolean shouldRemoveBlankLines; | ||
private final boolean shouldRequireInListPadding; | ||
|
||
public DomaSpringBootSqlBuilderSettings(Predicate<String> shouldRemoveBlockComment, | ||
Predicate<String> shouldRemoveLineComment, boolean shouldRemoveBlankLines, | ||
boolean shouldRequireInListPadding) { | ||
this.shouldRemoveBlockComment = shouldRemoveBlockComment; | ||
this.shouldRemoveLineComment = shouldRemoveLineComment; | ||
this.shouldRemoveBlankLines = shouldRemoveBlankLines; | ||
this.shouldRequireInListPadding = shouldRequireInListPadding; | ||
} | ||
|
||
@Override | ||
public boolean shouldRemoveBlockComment(String comment) { | ||
return shouldRemoveBlockComment.test(comment); | ||
} | ||
|
||
@Override | ||
public boolean shouldRemoveLineComment(String comment) { | ||
return shouldRemoveLineComment.test(comment); | ||
} | ||
|
||
@Override | ||
public boolean shouldRemoveBlankLines() { | ||
return shouldRemoveBlankLines; | ||
} | ||
|
||
@Override | ||
public boolean shouldRequireInListPadding() { | ||
return shouldRequireInListPadding; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
doma-spring-boot-core/src/main/java/org/seasar/doma/boot/ResourceLoaderScriptFileLoader.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,27 @@ | ||
package org.seasar.doma.boot; | ||
|
||
import java.io.IOException; | ||
import java.io.UncheckedIOException; | ||
import java.net.URL; | ||
|
||
import org.seasar.doma.jdbc.ScriptFileLoader; | ||
import org.springframework.core.io.ResourceLoader; | ||
|
||
public class ResourceLoaderScriptFileLoader implements ScriptFileLoader { | ||
|
||
private final ResourceLoader resourceLoader; | ||
|
||
public ResourceLoaderScriptFileLoader(ResourceLoader resourceLoader) { | ||
this.resourceLoader = resourceLoader; | ||
} | ||
|
||
@Override | ||
public URL loadAsURL(String path) { | ||
var resource = resourceLoader.getResource(ResourceLoader.CLASSPATH_URL_PREFIX + path); | ||
try { | ||
return resource.getURL(); | ||
} catch (IOException e) { | ||
throw new UncheckedIOException(e); | ||
} | ||
} | ||
} |
Oops, something went wrong.