本文整理匯總了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;
}