Hy,我使用@Repositor CrudRepository<Player, String>
存储一些玩家信息。
每位玩家都有多张牌,有时会不止一次。
我如何在播放机中允许它?每次我尝试多次插入一次时都会出错
我的代码
public class Player {
@Id
String playerId;
@ElementCollection(targetClass = Card.class)
@LazyCollection(LazyCollectionOption.FALSE)
Collection<Card> cards = new ArrayList<>();
}
public enum Card {
km25, km50, km75, km100, km200, crevaison, roueDeSecours, increvable, accident, garage, asDuVolant, feuRouge, feuVert, vehiculePrioritaire, panneDessence, stationService, citerne, limiteVitesse, finLimiteVitesse
;