本文整理汇总了Java中org.hibernate.search.annotations.IndexedEmbedded类的典型用法代码示例。如果您正苦于以下问题:Java IndexedEmbedded类的具体用法?Java IndexedEmbedded怎么用?Java IndexedEmbedded使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IndexedEmbedded类属于org.hibernate.search.annotations包,在下文中一共展示了IndexedEmbedded类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getIndexedFields
import org.hibernate.search.annotations.IndexedEmbedded; //导入依赖的package包/类
/**
*
* @param entity
* entity to inspect
* @param prefix
* optional prefix for fieldNames (@see
* {@link #getIndexedEmbeddedFields(Class)}
* @param declaredFields
* @return String array containing all fieldNames of the given entity which
* are annotated with {@link Field} to mark them indexable.
*/
private List<String> getIndexedFields(Class<?> entity, Optional<String> prefix) {
List<String> fieldNames = new ArrayList<>();
for (Class<?> klass = entity; klass != null; klass = klass.getSuperclass()) {
for (java.lang.reflect.Field field : klass.getDeclaredFields()) {
if (field.getAnnotation(Field.class) != null) {
fieldNames.add(prefix.isPresent() ? prefix.get() + "." + field.getName() : field.getName());
} else if (field.getAnnotation(IndexedEmbedded.class) != null) {
fieldNames.addAll(getIndexedFields(field.getType(),
Optional.of((prefix.isPresent() ? prefix.get() + "." : "") + field.getName())));
}
}
}
return fieldNames;
}
示例2: getAllObjects
import org.hibernate.search.annotations.IndexedEmbedded; //导入依赖的package包/类
@IndexedEmbedded(prefix = ALL_OBJECTS_PREFIX, includePaths = {HistoryValue.REFERENCE})
public Set<HistoryValue> getAllObjects() {
Set<HistoryValue> result = Sets.newLinkedHashSet();
for (HistoryValue value : new HistoryValue[] {mainObject, object1, object2, object3, object4}) {
if (value != null) {
result.add(value);
}
}
return result;
}
示例3: getDisease
import org.hibernate.search.annotations.IndexedEmbedded; //导入依赖的package包/类
/**
* @return disease disease to which given key perf. index belongs
*/
@ManyToOne(fetch = FetchType.LAZY, optional=false)
@JoinColumn(name = "disease_id", nullable = false)
@IndexedEmbedded
public Disease getDisease() {
return this.disease;
}
示例4: getPzn
import org.hibernate.search.annotations.IndexedEmbedded; //导入依赖的package包/类
/**
* @return pznNumber
*/
@IndexedEmbedded
@Embedded()
@AttributeOverrides(value={
@AttributeOverride(name="number", [email protected](name="pzn", length = 7, nullable = true, unique = true))
})
public PznBarcode getPzn() {
return this.pznBarcode;
}
示例5: getPlace
import org.hibernate.search.annotations.IndexedEmbedded; //导入依赖的package包/类
@ContainedIn
@ManyToOne(cascade = CascadeType.ALL)
@JoinTable(name = "Place_Sorcerer")
@UpdateInfo(tableName = "Place_Sorcerer", updateTableName = "PlaceSorcererUpdatesHsearch", updateTableIdColumn = "updateid", updateTableEventTypeColumn = "eventCase", idInfos = {
@IdInfo(entity = Place.class, columns = @IdColumn(column = "Place_ID", updateTableColumn = "placefk", columnType = ColumnType.INTEGER)),
@IdInfo(entity = Sorcerer.class, columns = @IdColumn(column = "Sorcerer_ID", updateTableColumn = "sorcererfk", columnType = ColumnType.INTEGER))
})
@IndexedEmbedded(includeEmbeddedObjectId = true)
public Place getPlace() {
return place;
}
示例6: getVendors
import org.hibernate.search.annotations.IndexedEmbedded; //导入依赖的package包/类
@IndexedEmbedded(includeEmbeddedObjectId = true, targetElement = Vendor.class)
@ManyToMany
@JoinTable(name = "Game_Vendor")
@UpdateInfo(tableName = "Game_Vendor", idInfos = {
@IdInfo(entity = Game.class, columns = @IdColumn(column = "Game_ID", columnType = ColumnType.LONG)),
@IdInfo(entity = Vendor.class, columns = @IdColumn(column = "vendors_ID", columnType = ColumnType.LONG))
})
public List<Vendor> getVendors() {
return vendors;
}
示例7: getName
import org.hibernate.search.annotations.IndexedEmbedded; //导入依赖的package包/类
/**
* @return user's name
*/
@Embedded
@IndexedEmbedded
public Name getName() {
return this.name;
}
示例8: getAddress
import org.hibernate.search.annotations.IndexedEmbedded; //导入依赖的package包/类
@Embedded
@IndexedEmbedded
public Address getAddress() {
return address;
}
示例9: getTransactions
import org.hibernate.search.annotations.IndexedEmbedded; //导入依赖的package包/类
@IndexedEmbedded
public List<Transaction> getTransactions() {
return this.transactions;
}
示例10: getProducer
import org.hibernate.search.annotations.IndexedEmbedded; //导入依赖的package包/类
/**
* @return the producer
*/
@Embedded
@IndexedEmbedded
public Producer getProducer() {
return producer;
}
示例11: getAuthors
import org.hibernate.search.annotations.IndexedEmbedded; //导入依赖的package包/类
@IndexedEmbedded
@ManyToMany
public Set<Author> getAuthors()
{
return authors;
}
示例12: getSorcerers
import org.hibernate.search.annotations.IndexedEmbedded; //导入依赖的package包/类
@IndexedEmbedded(depth = 3, includeEmbeddedObjectId = true)
@ContainedIn
@OneToMany(cascade = CascadeType.ALL, mappedBy = "place")
public Set<Sorcerer> getSorcerers() {
return sorcerers;
}
示例13: getEmbedded
import org.hibernate.search.annotations.IndexedEmbedded; //导入依赖的package包/类
@IndexedEmbedded
public Embedded getEmbedded() {
return embedded;
}
示例14: getEmbedded2
import org.hibernate.search.annotations.IndexedEmbedded; //导入依赖的package包/类
@IndexedEmbedded
public List<Embedded2> getEmbedded2() {
return embedded2;
}
示例15: getSorcerers
import org.hibernate.search.annotations.IndexedEmbedded; //导入依赖的package包/类
/**
* @return the sorcerers
*/
@IndexedEmbedded(includeEmbeddedObjectId = true)
public Set<Sorcerer> getSorcerers() {
return sorcerers;
}