下面列出了怎么用org.hibernate.annotations.SortNatural的API类实例代码及写法,或者点击链接到github查看源代码。
private AnnotationException buildIllegalSortCombination() {
return new AnnotationException(
String.format(
"Illegal combination of annotations on %s. Only one of @%s, @%s and @%s can be used",
safeCollectionRole(),
Sort.class.getName(),
SortNatural.class.getName(),
SortComparator.class.getName()
)
);
}
@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(name = "MCRUserAttr",
joinColumns = @JoinColumn(name = "id"),
indexes = { @Index(name = "MCRUserAttributes", columnList = "name, value"),
@Index(name = "MCRUserValues", columnList = "value") })
@SortNatural
@XmlElementWrapper(name = "attributes")
@XmlElement(name = "attribute")
public SortedSet<MCRUserAttribute> getAttributes() {
return this.attributes;
}
public void setNaturalSort(SortNatural naturalSort) {
this.naturalSort = naturalSort;
}