-
Notifications
You must be signed in to change notification settings - Fork 1
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 #1 from Oskarowski/prep-for-publication
Prepare Repository for changing visibility
- Loading branch information
Showing
53 changed files
with
840 additions
and
267 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
16 changes: 16 additions & 0 deletions
16
JdbcDao/src/main/java/sudoku/jdbcdao/database/database-schema.md
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,16 @@ | ||
```mermaid | ||
erDiagram | ||
SUDOKU_BOARDS { | ||
int id PK | ||
string name | ||
} | ||
SUDOKU_FIELDS { | ||
int id PK | ||
int board_id FK | ||
int row | ||
int column | ||
int value | ||
} | ||
SUDOKU_FIELDS }|--|| SUDOKU_BOARDS : board_id | ||
``` |
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
CREATE TABLE IF NOT EXISTS SUDOKU_BOARD ( | ||
CREATE TABLE IF NOT EXISTS SUDOKU_BOARDS ( | ||
id INTEGER PRIMARY KEY AUTOINCREMENT, | ||
name TEXT NOT NULL UNIQUE | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS SUDOKU_FIELD ( | ||
CREATE TABLE IF NOT EXISTS SUDOKU_FIELDS ( | ||
id INTEGER PRIMARY KEY AUTOINCREMENT, | ||
board_id INTEGER, | ||
row INTEGER, | ||
column INTEGER, | ||
value INTEGER, | ||
FOREIGN KEY (board_id) REFERENCES SUDOKU_BOARD (id) | ||
FOREIGN KEY (board_id) REFERENCES SUDOKU_BOARDS (id) | ||
); |
27 changes: 26 additions & 1 deletion
27
JdbcDao/src/main/java/sudoku/jdbcdao/exceptions/LocalizedException.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
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
Binary file modified
BIN
+0 Bytes
(100%)
JdbcDao/src/test/java/sudoku/jdbcdao/resources/test_sudoku.db
Binary file not shown.
Binary file not shown.
54 changes: 54 additions & 0 deletions
54
Model/src/main/java/sudoku/model/exceptions/FillingBoardSudokuException.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,54 @@ | ||
package sudoku.model.exceptions; | ||
|
||
/** | ||
* Exception thrown when there is an error during the process of filling a | ||
* Sudoku board. | ||
* This exception typically indicates issues encountered while populating the | ||
* board with values. | ||
* | ||
* <p> | ||
* This exception extends {@link LocalizedModelException}, which provides | ||
* support | ||
* for localized error messages based on {@link ModelMessageKey}. | ||
* </p> | ||
* | ||
* <p> | ||
* The default error message is retrieved using the | ||
* {@link ModelMessageKey#FILLING_BOARD_ERROR} | ||
* key from the resource bundle. | ||
* </p> | ||
* | ||
* <p> | ||
* This exception can optionally wrap another throwable as its cause, providing | ||
* additional context or information about the error. | ||
* </p> | ||
* | ||
* @see LocalizedModelException | ||
* @see ModelMessageKey | ||
*/ | ||
public class FillingBoardSudokuException extends LocalizedModelException { | ||
/** | ||
* Constructs a new FillingBoardSudokuException with a default error message | ||
* key. | ||
* The error message will be retrieved based on | ||
* {@link ModelMessageKey#FILLING_BOARD_ERROR}. | ||
*/ | ||
public FillingBoardSudokuException() { | ||
super(ModelMessageKey.FILLING_BOARD_ERROR); | ||
} | ||
|
||
/** | ||
* Constructs a new FillingBoardSudokuException with the specified cause and | ||
* a default error message key. | ||
* | ||
* <p> | ||
* The error message will be retrieved based on | ||
* {@link ModelMessageKey#FILLING_BOARD_ERROR}. | ||
* </p> | ||
* | ||
* @param cause the cause of the exception | ||
*/ | ||
public FillingBoardSudokuException(Throwable cause) { | ||
super(ModelMessageKey.FILLING_BOARD_ERROR, cause); | ||
} | ||
} |
52 changes: 49 additions & 3 deletions
52
Model/src/main/java/sudoku/model/exceptions/InvalidSudokuException.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 |
---|---|---|
@@ -1,7 +1,53 @@ | ||
package sudoku.model.exceptions; | ||
|
||
public class InvalidSudokuException extends Exception { | ||
public InvalidSudokuException(String message) { | ||
super(message); | ||
/** | ||
* Exception thrown when a trouble within the Sudoku board is determined. | ||
* This exception typically indicates that the Sudoku board does not adhere | ||
* to the rules of Sudoku, such as having duplicate numbers in rows, columns, | ||
* or boxes. | ||
* | ||
* <p> | ||
* This exception extends {@link LocalizedModelException}, which provides | ||
* support | ||
* for localized error messages based on {@link ModelMessageKey}. | ||
* </p> | ||
* | ||
* <p> | ||
* The default error message is retrieved using the | ||
* {@link ModelMessageKey#INVALID_SUDOKU_ERROR} | ||
* key from the resource bundle. | ||
* </p> | ||
* | ||
* <p> | ||
* This exception can optionally wrap another throwable as its cause, providing | ||
* additional context or information about the error. | ||
* </p> | ||
* | ||
* @see LocalizedModelException | ||
* @see ModelMessageKey | ||
*/ | ||
public class InvalidSudokuException extends LocalizedModelException { | ||
/** | ||
* Constructs a new InvalidSudokuException with a default error message key. | ||
* The error message will be retrieved based on | ||
* {@link ModelMessageKey#INVALID_SUDOKU_ERROR}. | ||
*/ | ||
public InvalidSudokuException() { | ||
super(ModelMessageKey.INVALID_SUDOKU_ERROR); | ||
} | ||
|
||
/** | ||
* Constructs a new InvalidSudokuException with the specified cause and | ||
* a default error message key. | ||
* | ||
* <p> | ||
* The error message will be retrieved based on | ||
* {@link ModelMessageKey#INVALID_SUDOKU_ERROR}. | ||
* </p> | ||
* | ||
* @param cause the cause of the exception | ||
*/ | ||
public InvalidSudokuException(Throwable cause) { | ||
super(ModelMessageKey.INVALID_SUDOKU_ERROR, cause); | ||
} | ||
} |
Oops, something went wrong.