|
15 | 15 | */
|
16 | 16 | package org.springframework.data.jdbc.core.convert;
|
17 | 17 |
|
18 |
| -import lombok.Value; |
19 |
| - |
20 |
| -import java.util.*; |
21 |
| -import java.util.function.Function; |
22 |
| -import java.util.regex.Pattern; |
23 |
| -import java.util.stream.Collectors; |
24 |
| - |
25 | 18 | import org.springframework.data.domain.Pageable;
|
26 | 19 | import org.springframework.data.domain.Sort;
|
27 | 20 | import org.springframework.data.jdbc.repository.support.SimpleJdbcRepository;
|
|
41 | 34 | import org.springframework.lang.Nullable;
|
42 | 35 | import org.springframework.util.Assert;
|
43 | 36 |
|
| 37 | +import java.util.*; |
| 38 | +import java.util.function.Function; |
| 39 | +import java.util.regex.Pattern; |
| 40 | +import java.util.stream.Collectors; |
| 41 | + |
44 | 42 | /**
|
45 | 43 | * Generates SQL statements to be used by {@link SimpleJdbcRepository}
|
46 | 44 | *
|
@@ -722,11 +720,60 @@ private OrderByField orderToOrderByField(Sort.Order order) {
|
722 | 720 | /**
|
723 | 721 | * Value object representing a {@code JOIN} association.
|
724 | 722 | */
|
725 |
| - @Value |
726 |
| - static class Join { |
727 |
| - Table joinTable; |
728 |
| - Column joinColumn; |
729 |
| - Column parentId; |
| 723 | + static final class Join { |
| 724 | + |
| 725 | + private final Table joinTable; |
| 726 | + private final Column joinColumn; |
| 727 | + private final Column parentId; |
| 728 | + |
| 729 | + Join(Table joinTable, Column joinColumn, Column parentId) { |
| 730 | + |
| 731 | + Assert.notNull( joinTable,"JoinTable must not be null."); |
| 732 | + Assert.notNull( joinColumn,"JoinColumn must not be null."); |
| 733 | + Assert.notNull( parentId,"ParentId must not be null."); |
| 734 | + |
| 735 | + this.joinTable = joinTable; |
| 736 | + this.joinColumn = joinColumn; |
| 737 | + this.parentId = parentId; |
| 738 | + } |
| 739 | + |
| 740 | + Table getJoinTable() { |
| 741 | + return this.joinTable; |
| 742 | + } |
| 743 | + |
| 744 | + Column getJoinColumn() { |
| 745 | + return this.joinColumn; |
| 746 | + } |
| 747 | + |
| 748 | + Column getParentId() { |
| 749 | + return this.parentId; |
| 750 | + } |
| 751 | + |
| 752 | + @Override |
| 753 | + public boolean equals(Object o) { |
| 754 | + |
| 755 | + if (this == o) return true; |
| 756 | + if (o == null || getClass() != o.getClass()) return false; |
| 757 | + Join join = (Join) o; |
| 758 | + return joinTable.equals(join.joinTable) && |
| 759 | + joinColumn.equals(join.joinColumn) && |
| 760 | + parentId.equals(join.parentId); |
| 761 | + } |
| 762 | + |
| 763 | + @Override |
| 764 | + public int hashCode() { |
| 765 | + return Objects.hash(joinTable, joinColumn, parentId); |
| 766 | + } |
| 767 | + |
| 768 | + @Override |
| 769 | + public String toString() { |
| 770 | + |
| 771 | + return "Join{" + |
| 772 | + "joinTable=" + joinTable + |
| 773 | + ", joinColumn=" + joinColumn + |
| 774 | + ", parentId=" + parentId + |
| 775 | + '}'; |
| 776 | + } |
730 | 777 | }
|
731 | 778 |
|
732 | 779 | /**
|
|
0 commit comments