本文整理汇总了Java中org.hibernate.search.annotations.SortableField类的典型用法代码示例。如果您正苦于以下问题:Java SortableField类的具体用法?Java SortableField怎么用?Java SortableField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SortableField类属于org.hibernate.search.annotations包,在下文中一共展示了SortableField类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSortName
import org.hibernate.search.annotations.SortableField; //导入依赖的package包/类
@Field(analyzer = @Analyzer(definition = HibernateSearchAnalyzer.TEXT_SORT))
@SortableField
public String getSortName() {
StringBuilder builder = new StringBuilder();
if(getLastName() != null) {
builder.append(getLastName());
builder.append(" ");
}
if(getFirstName() != null) {
builder.append(getFirstName());
}
return builder.toString().trim();
}
示例2: getCode
import org.hibernate.search.annotations.SortableField; //导入依赖的package包/类
@Override
@Fields({
@Field(name = CODE_FIELD_NAME, analyzer = @Analyzer(definition = HibernateSearchAnalyzer.KEYWORD)),
@Field(name = CODE_SORT_FIELD_NAME, analyzer = @Analyzer(definition = HibernateSearchAnalyzer.TEXT_SORT))
})
@SortableField(forField = CODE_SORT_FIELD_NAME)
public String getCode() {
return null;
}
示例3: getEntityId
import org.hibernate.search.annotations.SortableField; //导入依赖的package包/类
@Column(name = DbColumnNames.ENTITY_ID)
@DocumentId(name = DbFieldNames.ENTITY_ID)
@GeneratedValue(generator = DbSequenceNames.RESOURCE_ENTITY_ID, strategy = GenerationType.SEQUENCE)
@Id
@Nonnegative
@Nullable
@Override
@SequenceGenerator(allocationSize = 1, name = DbSequenceNames.RESOURCE_ENTITY_ID, sequenceName = DbSequenceNames.RESOURCE_ENTITY_ID)
@SortableField(forField = DbColumnNames.ENTITY_ID)
public Long getEntityId() {
return super.getEntityId();
}
示例4: getId
import org.hibernate.search.annotations.SortableField; //导入依赖的package包/类
/**
* Retourne la valeur de l'identifiant unique.
*
* @return id
*/
@Override
@QueryType(PropertyType.COMPARABLE)
@Field(name = ID_SORT, analyze = Analyze.NO)
@SortableField(forField = ID_SORT)
public abstract K getId();