本文整理汇总了Java中javax.persistence.Index类的典型用法代码示例。如果您正苦于以下问题:Java Index类的具体用法?Java Index怎么用?Java Index使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Index类属于javax.persistence包,在下文中一共展示了Index类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: JPAIndexHolder
import javax.persistence.Index; //导入依赖的package包/类
public JPAIndexHolder(Index index) {
StringTokenizer tokenizer = new StringTokenizer( index.columnList(), "," );
List<String> tmp = new ArrayList<String>();
while ( tokenizer.hasMoreElements() ) {
tmp.add( tokenizer.nextToken().trim() );
}
this.name = index.name();
this.columns = new String[tmp.size()];
this.ordering = new String[tmp.size()];
this.unique = index.unique();
initializeColumns( columns, ordering, tmp );
}
示例2: buildIndex
import javax.persistence.Index; //导入依赖的package包/类
private static void buildIndex(AnnotationDescriptor annotation, Element element){
List indexElementList = element.elements( "index" );
Index[] indexes = new Index[indexElementList.size()];
for(int i=0;i<indexElementList.size();i++){
Element subelement = (Element)indexElementList.get( i );
AnnotationDescriptor indexAnn = new AnnotationDescriptor( Index.class );
copyStringAttribute( indexAnn, subelement, "name", false );
copyStringAttribute( indexAnn, subelement, "column-list", true );
copyBooleanAttribute( indexAnn, subelement, "unique" );
indexes[i] = AnnotationFactory.create( indexAnn );
}
annotation.setValue( "indexes", indexes );
}
示例3: getAttributes
import javax.persistence.Index; //导入依赖的package包/类
/**
* @return the attributes
*/
@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(name = "MCRUserAttr",
joinColumns = @JoinColumn(name = "id"),
indexes = { @Index(name = "MCRUserAttributes", columnList = "name, value"),
@Index(name = "MCRUserValues", columnList = "value") })
@MapKeyColumn(name = "name", length = 128)
@Column(name = "value", length = 255)
public Map<String, String> getAttributes() {
return attributes;
}
示例4: tableUniqueIndexes
import javax.persistence.Index; //导入依赖的package包/类
@Override
public String[] tableUniqueIndexes() {
if (annotationOf(javax.persistence.Table.class).isPresent()) {
Index[] indexes = annotationOf(javax.persistence.Table.class)
.map(javax.persistence.Table::indexes)
.orElse(new Index[0]);
Set<String> names = Stream.of(indexes).filter(Index::unique)
.map(Index::name).collect(Collectors.toSet());
return names.toArray(new String[names.size()]);
}
return annotationOf(Table.class).map(Table::uniqueIndexes).orElse(new String[]{});
}
示例5: getDependentTasks
import javax.persistence.Index; //导入依赖的package包/类
@ElementCollection(fetch = FetchType.LAZY)
@CollectionTable(name = "TASK_DATA_DEPENDENCIES", joinColumns = { @JoinColumn(name = "JOB_ID", referencedColumnName = "TASK_ID_JOB"),
@JoinColumn(name = "TASK_ID", referencedColumnName = "TASK_ID_TASK") }, indexes = { @Index(name = "TASK_DATA_DEP_JOB_ID", columnList = "JOB_ID"),
@Index(name = "TASK_DATA_DEP_TASK_ID", columnList = "TASK_ID"), })
@BatchSize(size = 100)
public List<DBTaskId> getDependentTasks() {
return dependentTasks;
}
示例6: getJoinedBranches
import javax.persistence.Index; //导入依赖的package包/类
@ElementCollection(fetch = FetchType.LAZY)
@CollectionTable(name = "TASK_DATA_JOINED_BRANCHES", joinColumns = { @JoinColumn(name = "JOB_ID", referencedColumnName = "TASK_ID_JOB"),
@JoinColumn(name = "TASK_ID", referencedColumnName = "TASK_ID_TASK") }, indexes = { @Index(name = "TASK_DATA_JB_JOB_ID", columnList = "JOB_ID"),
@Index(name = "TASK_DATA_JB_TASK_ID", columnList = "TASK_ID"), })
@BatchSize(size = 100)
public List<DBTaskId> getJoinedBranches() {
return joinedBranches;
}
示例7: getOutcome
import javax.persistence.Index; //导入依赖的package包/类
@Column(name = "outcome", length = 255)
@Type(type = "org.openyu.mix.wuxing.po.usertype.OutcomeUserType")
@Field(store = Store.YES, index = org.hibernate.search.annotations.Index.YES, analyze = Analyze.NO)
@FieldBridge(impl = OutcomeBridge.class)
public Outcome getOutcome() {
return outcome;
}
示例8: getSpendItems
import javax.persistence.Index; //导入依赖的package包/类
@Column(name = "spend_items", length = 1024)
@Type(type = "org.openyu.mix.item.po.usertype.ItemListUserType")
@Field(store = Store.YES, index = org.hibernate.search.annotations.Index.YES, analyze = Analyze.NO)
@FieldBridge(impl = ItemListBridge.class)
public List<Item> getSpendItems() {
return spendItems;
}
示例9: getPutType
import javax.persistence.Index; //导入依赖的package包/类
@Column(name = "put_type", length = 13)
@Type(type = "org.openyu.mix.wuxing.po.usertype.PutTypeUserType")
@Field(store = Store.YES, index = org.hibernate.search.annotations.Index.YES, analyze = Analyze.NO)
@FieldBridge(impl = PutTypeBridge.class)
public PutType getPutType() {
return putType;
}
示例10: getAwards
import javax.persistence.Index; //导入依赖的package包/类
@Column(name = "awards", length = 1024)
@Type(type = "org.openyu.commons.entity.usertype.StringIntegerUserType")
@Field(store = Store.YES, index = org.hibernate.search.annotations.Index.YES, analyze = Analyze.NO)
@FieldBridge(impl = StringIntegerBridge.class)
public Map<String, Integer> getAwards() {
return awards;
}
示例11: getPlayType
import javax.persistence.Index; //导入依赖的package包/类
@Column(name = "play_type", length = 13)
@Type(type = "org.openyu.mix.wuxing.po.usertype.PlayTypeUserType")
@Field(store = Store.YES, index = org.hibernate.search.annotations.Index.YES, analyze = Analyze.NO)
@FieldBridge(impl = PlayTypeBridge.class)
public PlayType getPlayType()
{
return playType;
}
示例12: getOutcome
import javax.persistence.Index; //导入依赖的package包/类
@Column(name = "outcome", length = 255)
@Type(type = "org.openyu.mix.wuxing.po.usertype.OutcomeUserType")
@Field(store = Store.YES, index = org.hibernate.search.annotations.Index.YES, analyze = Analyze.NO)
@FieldBridge(impl = OutcomeBridge.class)
public Outcome getOutcome()
{
return outcome;
}
示例13: getActionType
import javax.persistence.Index; //导入依赖的package包/类
@Column(name = "action_type", length = 13)
@Type(type = "org.openyu.mix.train.po.usertype.ActionTypeUserType")
@Field(store = Store.YES, index = org.hibernate.search.annotations.Index.YES, analyze = Analyze.NO)
@FieldBridge(impl = ActionTypeBridge.class)
public ActionType getActionType() {
return actionType;
}
示例14: getConnectAction
import javax.persistence.Index; //导入依赖的package包/类
@Column(name = "connect_action", length = 13)
@Type(type = "org.openyu.mix.core.po.usertype.ConnectActionUserType")
@Field(store = Store.YES, index = org.hibernate.search.annotations.Index.YES, analyze = Analyze.NO)
@FieldBridge(impl = ConnectActionBridge.class)
public ConnectAction getConnectAction() {
return connectAction;
}
示例15: getBagInfo
import javax.persistence.Index; //导入依赖的package包/类
@Column(name = "bag_info", length = 8192)
@Type(type = "org.openyu.mix.role.po.usertype.BagInfoUserType")
@Field(store = Store.YES, index = org.hibernate.search.annotations.Index.YES, analyze = Analyze.NO)
@FieldBridge(impl = BagInfoBridge.class)
public BagInfo getBagInfo() {
return bagInfo;
}