我有本地化的实体,我想实现一个语言过滤器。
@Entity
@RooJavaBean
@RooToString
@RooJpaEntity
@RooJpaActiveRecord
public class MyEntityI18n {
@Column(columnDefinition = "text")
@Basic(fetch=FetchType.LAZY)
private String description;
@NotNull
@ManyToOne(targetEntity = MyEntity.class)
private MyEntity backedEntity;
@NotNull
private String languageCode;
@NotNull
@Length(min=3, max=60)
private String name;
}
有没有办法设置一个始终存在的过滤器,只要检索实体,它就会在 languageCode 字段上添加额外的条件?