在带有JPA的SpringBoot应用程序中使用Katharsis需要用@JsonApiToMany注释JPA的@OneToMany关系,用@JsonApiToOne注释类似的@ManyToOne。我想知道是否有任何方法可以避免这种重复的注释?在SpringBoot + JPA应用程序中集成Katharsis有什么更简单的方法吗?
发布于 2017-03-17 14:20:28
您可以通过示例构建自己的构造型注释
@Target({ElementType.FIELD, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@JsonApiToMany
@OneToMany
public @interface CustomOneToMany{
// ....
}Meta-annotations
发布于 2017-03-21 12:34:23
实际上,您应该看一看Katharsis JPA module
https://stackoverflow.com/questions/42847304
复制相似问题