We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@MappedCollection
Enum
I have two entities:
@Data @Table(name = "analyze_session") @SuperBuilder @NoArgsConstructor @AllArgsConstructor @EqualsAndHashCode(callSuper = true) public class AnalyzeSessionEntity extends BaseEntity { private Instant endAt; private Instant startAt; private boolean ended; @ToString.Exclude @MappedCollection(idColumn = "analyze_session_id", keyColumn = "sport") private Map<SportType, AnalyzeSessionSportDataEntity> sportDataBySport; public boolean isAllSportsDataDone() { return this.sportDataBySport.entrySet().stream().allMatch(entry -> entry.getValue().isDone()); } }
@Data @Table(name = "analyze_session_sport_data") @Builder @NoArgsConstructor @AllArgsConstructor @EqualsAndHashCode(callSuper = true) public class AnalyzeSessionSportDataEntity extends BaseEntity { private boolean done; private SportType sport; private int analyzedCount; private Integer lastDonePage; private LocalDate lastDoneDate; private long analyzeSessionId; }
And when Spring data jdbc load sportDataBySport Map and use String as key of Map, but need use my own enum SportType.
sportDataBySport
here screenshoots from debugger:
The text was updated successfully, but these errors were encountered:
Convert key of maps.
9f679a6
Keys of maps now get properly converted. Among others this enables the use of enums as keys. Closes #1656
Properly convert Map keys.
b063663
Keys of maps now get properly converted. Among others this enables the use of enums as keys. Closes #1656 Original pull request: #1663
15bb8d1
Fix Oracle database setup script.
42e786c
Changed BIGINT to NUMBER. See #1656 Original pull request #1663
082b744
schauder
Successfully merging a pull request may close this issue.
I have two entities:
And when Spring data jdbc load
sportDataBySport
Map and use String as key of Map, but need use my own enum SportType.here screenshoots from debugger:
The text was updated successfully, but these errors were encountered: