本文整理汇总了Java中org.hibernate.search.annotations.Field类的典型用法代码示例。如果您正苦于以下问题:Java Field类的具体用法?Java Field怎么用?Java Field使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Field类属于org.hibernate.search.annotations包,在下文中一共展示了Field类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getContent
import org.hibernate.search.annotations.Field; //导入依赖的package包/类
/**
* 获取内容
*
* @return 内容
*/
@Field(store = Store.YES, index = Index.TOKENIZED, analyzer = @Analyzer(impl = IKAnalyzer.class))
@Lob
public String getContent() {
if (pageNumber != null) {
String[] pageContents = getPageContents();
if (pageNumber < 1) {
pageNumber = 1;
}
if (pageNumber > pageContents.length) {
pageNumber = pageContents.length;
}
return pageContents[pageNumber - 1];
} else {
return content;
}
}
示例2: getCode
import org.hibernate.search.annotations.Field; //导入依赖的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: getSortName
import org.hibernate.search.annotations.Field; //导入依赖的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();
}
示例4: getCreateDate
import org.hibernate.search.annotations.Field; //导入依赖的package包/类
/**
* 获取创建日期
*
* @return 创建日期
*/
@JsonProperty
@Field(store = Store.YES, index = Index.UN_TOKENIZED)
@DateBridge(resolution = Resolution.SECOND)
@Column(nullable = false, updatable = false)
public Date getCreateDate() {
return createDate;
}
示例5: getModifyDate
import org.hibernate.search.annotations.Field; //导入依赖的package包/类
/**
* 获取修改日期
*
* @return 修改日期
*/
@JsonProperty
@Field(store = Store.YES, index = Index.UN_TOKENIZED)
@DateBridge(resolution = Resolution.SECOND)
@Column(nullable = false)
public Date getModifyDate() {
return modifyDate;
}
示例6: getTitle
import org.hibernate.search.annotations.Field; //导入依赖的package包/类
/**
* 获取标题
*
* @return 标题
*/
@Field(store = Store.YES, index = Index.TOKENIZED, analyzer = @Analyzer(impl = IKAnalyzer.class))
@NotEmpty
@Length(max = 200)
@Column(nullable = false)
public String getTitle() {
return title;
}
示例7: getIsPublication
import org.hibernate.search.annotations.Field; //导入依赖的package包/类
/**
* 获取是否发布
*
* @return 是否发布
*/
@Field(store = Store.YES, index = Index.UN_TOKENIZED)
@NotNull
@Column(nullable = false)
public Boolean getIsPublication() {
return isPublication;
}
示例8: getIsTop
import org.hibernate.search.annotations.Field; //导入依赖的package包/类
/**
* 获取是否置顶
*
* @return 是否置顶
*/
@Field(store = Store.YES, index = Index.UN_TOKENIZED)
@NotNull
@Column(nullable = false)
public Boolean getIsTop() {
return isTop;
}
示例9: getOrder
import org.hibernate.search.annotations.Field; //导入依赖的package包/类
/**
* 获取排序
*
* @return 排序
*/
@JsonProperty
@Field(store = Store.YES, index = Index.UN_TOKENIZED)
@Min(0)
@Column(name = "orders")
public Integer getOrder() {
return order;
}
示例10: getSn
import org.hibernate.search.annotations.Field; //导入依赖的package包/类
/**
* 获取编号
*
* @return 编号
*/
@JsonProperty
@Field(store = Store.YES, index = Index.UN_TOKENIZED)
@Pattern(regexp = "[\\s\\S]*")
@Length(max = 100)
@Column(nullable = false, unique = true, length = 100)
public String getSn() {
return sn;
}
示例11: getName
import org.hibernate.search.annotations.Field; //导入依赖的package包/类
/**
* 获取名称
*
* @return 名称
*/
@JsonProperty
@Field(store = Store.YES, index = Index.TOKENIZED, analyzer = @Analyzer(impl = IKAnalyzer.class))
@NotEmpty
@Length(max = 200)
@Column(nullable = false)
public String getName() {
return name;
}
示例12: getFullName
import org.hibernate.search.annotations.Field; //导入依赖的package包/类
/**
* 获取全称
*
* @return 全称
*/
@JsonProperty
@Field(store = Store.YES, index = Index.NO)
@Column(nullable = false)
public String getFullName() {
return fullName;
}
示例13: getPrice
import org.hibernate.search.annotations.Field; //导入依赖的package包/类
/**
* 获取销售价
*
* @return 销售价
*/
@JsonProperty
@Field(store = Store.YES, index = Index.UN_TOKENIZED)
@NumericField
@FieldBridge(impl = BigDecimalNumericFieldBridge.class)
@NotNull
@Min(0)
@Digits(integer = 12, fraction = 3)
@Column(nullable = false, precision = 21, scale = 6)
public BigDecimal getPrice() {
return price;
}
示例14: getMarketPrice
import org.hibernate.search.annotations.Field; //导入依赖的package包/类
/**
* 获取市场价
*
* @return 市场价
*/
@Field(store = Store.YES, index = Index.NO)
@Min(0)
@Digits(integer = 12, fraction = 3)
@Column(nullable = false, precision = 21, scale = 6)
public BigDecimal getMarketPrice() {
return marketPrice;
}
示例15: getImage
import org.hibernate.search.annotations.Field; //导入依赖的package包/类
/**
* 获取展示图片
*
* @return 展示图片
*/
@JsonProperty
@Field(store = Store.YES, index = Index.NO)
@Length(max = 200)
public String getImage() {
return image;
}