Java Code Examples for javax.persistence.Index

The following are top voted examples for showing how to use javax.persistence.Index. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: lams   File: JPAIndexHolder.java   View source code 5 votes vote down vote up
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 );
}
 
Example 2
Project: lams   File: JPAOverriddenAnnotationReader.java   View source code 5 votes vote down vote up
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 );
}
 
Example 3
Project: mycore   File: MCRUser.java   View source code 5 votes vote down vote up
/**
 * @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;
}
 
Example 4
Project: requery   File: EntityType.java   View source code 5 votes vote down vote up
@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[]{});
}
 
Example 5
Project: scheduling   File: TaskData.java   View source code 5 votes vote down vote up
@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;
}
 
Example 6
Project: scheduling   File: TaskData.java   View source code 5 votes vote down vote up
@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;
}
 
Example 7
Project: openyu-mix   File: WuxingPlayLogImpl.java   View source code 5 votes vote down vote up
@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;
}
 
Example 8
Project: openyu-mix   File: WuxingPlayLogImpl.java   View source code 5 votes vote down vote up
@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;
}
 
Example 9
Project: openyu-mix   File: WuxingPutLogImpl.java   View source code 5 votes vote down vote up
@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;
}
 
Example 10
Project: openyu-mix   File: WuxingPutLogImpl.java   View source code 5 votes vote down vote up
@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;
}
 
Example 11
Project: openyu-mix   File: WuxingFamousLogImpl.java   View source code 5 votes vote down vote up
@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;
}
 
Example 12
Project: openyu-mix   File: WuxingFamousLogImpl.java   View source code 5 votes vote down vote up
@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;
}
 
Example 13
Project: openyu-mix   File: TrainLogImpl.java   View source code 5 votes vote down vote up
@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;
}
 
Example 14
Project: openyu-mix   File: TrainLogImpl.java   View source code 5 votes vote down vote up
@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;
}
 
Example 15
Project: openyu-mix   File: CoreConnectLogImpl.java   View source code 5 votes vote down vote up
@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;
}
 
Example 16
Project: openyu-mix   File: RolePoImpl.java   View source code 5 votes vote down vote up
@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;
}
 
Example 17
Project: saos   File: SupremeCourtJudgment.java   View source code 5 votes vote down vote up
@ManyToMany(fetch = FetchType.LAZY, cascade={CascadeType.REFRESH})
@JoinTable(name = "supreme_court_judgment_chamber",
        indexes = { @Index(name = "sc_chamber_fk_judgment_index", columnList = "fk_judgment") },
        joinColumns = {@JoinColumn(name = "fk_judgment", nullable = false, updatable = true) }, 
        inverseJoinColumns = {@JoinColumn(name = "fk_chamber", nullable = false, updatable = true) })
private List<SupremeCourtChamber> getScChambers_() {
    return scChambers;
}
 
Example 18
Project: openyu-mix   File: RolePoImpl.java   View source code 5 votes vote down vote up
@Column(name = "treasure_info", length = 1024)
@Type(type = "org.openyu.mix.treasure.po.usertype.TreasureInfoUserType")
@Field(store = Store.YES, index = org.hibernate.search.annotations.Index.YES, analyze = Analyze.NO)
@FieldBridge(impl = TreasureInfoBridge.class)
public TreasureInfo getTreasureInfo() {
	return treasureInfo;
}
 
Example 19
Project: openyu-mix   File: RolePoImpl.java   View source code 5 votes vote down vote up
@Column(name = "train_info", length = 512)
@Type(type = "org.openyu.mix.train.po.usertype.TrainInfoUserType")
@Field(store = Store.YES, index = org.hibernate.search.annotations.Index.YES, analyze = Analyze.NO)
@FieldBridge(impl = TrainInfoBridge.class)
public TrainInfo getTrainInfo() {
	return trainInfo;
}
 
Example 20
Project: openyu-mix   File: RolePoImpl.java   View source code 5 votes vote down vote up
@Column(name = "wuxing_info", length = 1024)
@Type(type = "org.openyu.mix.wuxing.po.usertype.WuxingInfoUserType")
@Field(store = Store.YES, index = org.hibernate.search.annotations.Index.YES, analyze = Analyze.NO)
@FieldBridge(impl = WuxingInfoBridge.class)
public WuxingInfo getWuxingInfo() {
	return wuxingInfo;
}
 
Example 21
Project: openyu-mix   File: RoleGoldLogImpl.java   View source code 5 votes vote down vote up
@Column(name = "action_type", length = 13)
@Type(type = "org.openyu.mix.role.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;
}
 
Example 22
Project: openyu-mix   File: RoleGoldLogImpl.java   View source code 5 votes vote down vote up
@Column(name = "gold_type", length = 13)
@Type(type = "org.openyu.mix.role.po.usertype.GoldTypeUserType")
@Field(store = Store.YES, index = org.hibernate.search.annotations.Index.YES, analyze = Analyze.NO)
@FieldBridge(impl = GoldTypeBridge.class)
public GoldType getGoldType() {
	return goldType;
}
 
Example 23
Project: openyu-mix   File: ManorLandLogImpl.java   View source code 5 votes vote down vote up
@Column(name = "action_type", length = 13)
@Type(type = "org.openyu.mix.manor.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;
}
 
Example 24
Project: openyu-mix   File: ManorLandLogImpl.java   View source code 5 votes vote down vote up
@Column(name = "land", length = 1024)
@Type(type = "org.openyu.mix.item.po.usertype.ItemUserType")
@Field(store = Store.YES, index = org.hibernate.search.annotations.Index.YES, analyze = Analyze.NO)
@FieldBridge(impl = ItemBridge.class)
public Land getLand() {
	return land;
}
 
Example 25
Project: openyu-mix   File: ManorSeedLogImpl.java   View source code 5 votes vote down vote up
@Column(name = "culture_type", length = 13)
@Type(type = "org.openyu.mix.manor.po.usertype.CultureTypeUserType")
@Field(store = Store.YES, index = org.hibernate.search.annotations.Index.YES, analyze = Analyze.NO)
@FieldBridge(impl = CultureTypeBridge.class)
public CultureType getCultureType() {
	return cultureType;
}
 
Example 26
Project: saos   File: Judgment.java   View source code 5 votes vote down vote up
@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
@JoinTable(name = "assigned_judgment_keyword",
        indexes = {@Index(name = "assigned_keyword_fk_judgment_index", columnList = "fk_judgment")},
        joinColumns = {@JoinColumn(name = "fk_judgment", nullable = false, updatable = false) }, 
        inverseJoinColumns = {@JoinColumn(name = "fk_keyword", nullable = false, updatable = false) })
@OrderBy("phrase")
private List<JudgmentKeyword> getKeywords_() {
    return keywords;
}
 
Example 27
Project: openyu-mix   File: ManorSeedLogImpl.java   View source code 5 votes vote down vote up
@Column(name = "seed", length = 1024)
@Type(type = "org.openyu.mix.item.po.usertype.ItemUserType")
@Field(store = Store.YES, index = org.hibernate.search.annotations.Index.YES, analyze = Analyze.NO)
@FieldBridge(impl = ItemBridge.class)
public Seed getSeed() {
	return seed;
}
 
Example 28
Project: openyu-mix   File: ManorSeedLogImpl.java   View source code 5 votes vote down vote up
@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;
}
 
Example 29
Project: openyu-mix   File: ItemEnhanceLogImpl.java   View source code 5 votes vote down vote up
@Column(name = "action_type", length = 13)
@Type(type = "org.openyu.mix.item.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;
}
 
Example 30
Project: openyu-mix   File: ItemEnhanceLogImpl.java   View source code 5 votes vote down vote up
@Column(name = "item", length = 1024)
@Type(type = "org.openyu.mix.item.po.usertype.ItemUserType")
@Field(store = Store.YES, index = org.hibernate.search.annotations.Index.YES, analyze = Analyze.NO)
@FieldBridge(impl = ItemBridge.class)
public Item getItem() {
	return item;
}
 
Example 31
Project: openyu-mix   File: ItemEnhanceLogImpl.java   View source code 5 votes vote down vote up
@Column(name = "spend_item", length = 1024)
@Type(type = "org.openyu.mix.item.po.usertype.ItemUserType")
@Field(store = Store.YES, index = org.hibernate.search.annotations.Index.YES, analyze = Analyze.NO)
@FieldBridge(impl = ItemBridge.class)
public Item getSpendItem() {
	return spendItem;
}
 
Example 32
Project: openyu-mix   File: SasangPutLogImpl.java   View source code 5 votes vote down vote up
@Column(name = "put_type", length = 13)
@Type(type = "org.openyu.mix.sasang.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;
}
 
Example 33
Project: openyu-mix   File: SasangPutLogImpl.java   View source code 5 votes vote down vote up
@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;
}
 
Example 34
Project: openyu-mix   File: SasangFamousLogImpl.java   View source code 5 votes vote down vote up
@Column(name = "play_type", length = 13)
@Type(type = "org.openyu.mix.sasang.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;
}
 
Example 35
Project: openyu-mix   File: SasangFamousLogImpl.java   View source code 5 votes vote down vote up
@Column(name = "outcome", length = 255)
@Type(type = "org.openyu.mix.sasang.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;
}
 
Example 36
Project: openyu-mix   File: SasangPlayLogImpl.java   View source code 5 votes vote down vote up
@Column(name = "play_type", length = 13)
@Type(type = "org.openyu.mix.sasang.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;
}
 
Example 37
Project: openyu-mix   File: SasangPlayLogImpl.java   View source code 5 votes vote down vote up
@Column(name = "outcome", length = 255)
@Type(type = "org.openyu.mix.sasang.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;
}
 
Example 38
Project: openyu-mix   File: SasangPlayLogImpl.java   View source code 5 votes vote down vote up
@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;
}
 
Example 39
Project: openyu-mix   File: AccountCoinLogImpl.java   View source code 5 votes vote down vote up
@Column(name = "action_type", length = 13)
@Type(type = "org.openyu.mix.account.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;
}
 
Example 40
Project: openyu-mix   File: AccountCoinLogImpl.java   View source code 5 votes vote down vote up
@Column(name = "coin_type", length = 13)
@Type(type = "org.openyu.mix.account.po.usertype.CoinTypeUserType")
@Field(store = Store.YES, index = org.hibernate.search.annotations.Index.YES, analyze = Analyze.NO)
@FieldBridge(impl = CoinTypeBridge.class)
public CoinType getCoinType() {
	return coinType;
}