1.String 类型

@ElementCollection(targetClass = String.class,fetch = FetchType.EAGER)
@CollectionTable(name = "TASK_MEDIAS")
private List<String> medias = new ArrayList<>();

 

2. 枚举类型

@Column(name = "PERMISSIONS")
@ElementCollection(targetClass = Permission.class, fetch = FetchType.EAGER)
@CollectionTable(name = "ROLE_PERMISSIONS")
@Enumerated(EnumType.STRING)
private Set<Permission> permissions;

相关文章:

  • 2021-08-27
  • 2021-05-28
  • 2022-01-02
  • 2022-12-23
  • 2022-02-13
  • 2022-12-23
  • 2022-01-28
  • 2021-12-21
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-04-01
  • 2022-12-23
  • 2022-02-20
  • 2022-01-28
  • 2022-01-05
相关资源
相似解决方案