Skip to content

Commit

Permalink
デフォルトの規則に従うならMappedCollectionアノテーションは要らないっぽい
Browse files Browse the repository at this point in the history
  • Loading branch information
backpaper0 committed Jan 10, 2024
1 parent 77902ed commit 05beb6f
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@

import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Version;
import org.springframework.data.relational.core.mapping.MappedCollection;

public record Singer(
@Id Integer id,
String name,
@Version Integer version,
@MappedCollection Set<Song> songs) {
Set<Song> songs) {

public Singer withName(String newName) {
return new Singer(id, newName, version, songs);
Expand Down

0 comments on commit 05beb6f

Please sign in to comment.