forked from spring-projects/spring-data-relational
-
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.
Add support for forein keys in schema generation within aggregates.
Closes spring-projects#1599 Related tickets spring-projects#756, spring-projects#1600
- Loading branch information
1 parent
88ab6b6
commit cef626b
Showing
11 changed files
with
386 additions
and
36 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
...data-jdbc/src/main/java/org/springframework/data/jdbc/core/mapping/schema/ForeignKey.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.springframework.data.jdbc.core.mapping.schema; | ||
|
||
import java.util.Objects; | ||
|
||
/** | ||
* Models a Foreign Key for generating SQL for Schema generation. | ||
* | ||
* @author Evgenii Koba | ||
* @since 3.2 | ||
*/ | ||
record ForeignKey(String name, String tableName, String columnName, String referencedTableName, | ||
String referencedColumnName) { | ||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) | ||
return true; | ||
if (o == null || getClass() != o.getClass()) | ||
return false; | ||
ForeignKey that = (ForeignKey) o; | ||
return Objects.equals(name, that.name); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(name); | ||
} | ||
} |
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
Oops, something went wrong.