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