-
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.
- Loading branch information
Showing
6 changed files
with
75 additions
and
4 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
7 changes: 7 additions & 0 deletions
7
src/main/java/springbook/chapter07/sqlService/SqlNotFoundException.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 springbook.chapter07.sqlService; | ||
|
||
public class SqlNotFoundException extends RuntimeException { | ||
public SqlNotFoundException(String message) { | ||
super(message); | ||
} | ||
} |
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,6 @@ | ||
package springbook.chapter07.sqlService; | ||
|
||
public interface SqlReader { | ||
|
||
void read(SqlRegistry sqlRegistry); | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/springbook/chapter07/sqlService/SqlRegistry.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 springbook.chapter07.sqlService; | ||
|
||
public interface SqlRegistry { | ||
/** | ||
* SQL을 키와 함께 등록한다. | ||
* | ||
* @param key | ||
* @param sql | ||
*/ | ||
void registerSql(String key, String sql); | ||
|
||
/** | ||
* 키에 해당하는 SQL을 조회한다. | ||
* | ||
* @param key | ||
* @return 찾은 SQL | ||
* @throws SqlNotFoundException | ||
*/ | ||
String findSql(String key) throws SqlNotFoundException; | ||
} |