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 ); }
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 ); }
/** * @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; }
@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[]{}); }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }
@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; }