當前位置: 首頁>>代碼示例>>Java>>正文


Java JoinColumns類代碼示例

本文整理匯總了Java中javax.persistence.JoinColumns的典型用法代碼示例。如果您正苦於以下問題:Java JoinColumns類的具體用法?Java JoinColumns怎麽用?Java JoinColumns使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


JoinColumns類屬於javax.persistence包,在下文中一共展示了JoinColumns類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getReferenceColumnNamesMapForReferenceAttribute

import javax.persistence.JoinColumns; //導入依賴的package包/類
private Map<String, String> getReferenceColumnNamesMapForReferenceAttribute(SingularAttribute<?, ?> attribute, ManagedType<?> targetEntity) {
	List<String> idAttributeNames = targetEntity.getSingularAttributes().stream()
               .filter(this::isIdAttribute)
               .map(this::getSingularAttributeColumnName)
               .collect(Collectors.toList());

	JoinColumns joinColumnsAnnotation =
               ((AnnotatedElement) attribute.getJavaMember()).getAnnotation(JoinColumns.class);
	JoinColumn joinColumnAnnotation =
               ((AnnotatedElement) attribute.getJavaMember()).getAnnotation(JoinColumn.class);
	JoinColumn[] joinColumns = joinColumnsAnnotation != null ? joinColumnsAnnotation.value() :
               joinColumnAnnotation != null ? new JoinColumn[]{joinColumnAnnotation} : null;
	Map<String, String> referenceColumnNamesMap;
	if (joinColumns != null) {
           referenceColumnNamesMap = Arrays.stream(joinColumns)
                   .collect(Collectors.toMap(JoinColumn::name, joinColumn ->
                           joinColumn.referencedColumnName().length() > 0 ? joinColumn.referencedColumnName() :
                                   idAttributeNames.get(0)));
       } else {
           referenceColumnNamesMap = idAttributeNames.stream()
                   .collect(Collectors.toMap(idAttributeName -> attribute.getName().toUpperCase() + "_"
                           + idAttributeName, idAttributeName -> idAttributeName));
       }
	return referenceColumnNamesMap;
}
 
開發者ID:btc-ag,項目名稱:redg,代碼行數:26,代碼來源:JpaMetamodelRedGProvider.java

示例2: addForeignKey

import javax.persistence.JoinColumns; //導入依賴的package包/類
private void addForeignKey(final Attribute<?, ?> jpaAttribute) throws ODataJPAModelException,
    ODataJPARuntimeException {

  AnnotatedElement annotatedElement = (AnnotatedElement) jpaAttribute.getJavaMember();
  joinColumnNames = null;
  if (annotatedElement == null) {
    return;
  }
  JoinColumn joinColumn = annotatedElement.getAnnotation(JoinColumn.class);
  if (joinColumn == null) {
    JoinColumns joinColumns = annotatedElement.getAnnotation(JoinColumns.class);
    if (joinColumns != null) {
      for (JoinColumn jc : joinColumns.value()) {
        buildForeignKey(jc, jpaAttribute);
      }
    }
  } else {
    buildForeignKey(joinColumn, jpaAttribute);
  }
}
 
開發者ID:apache,項目名稱:olingo-odata2,代碼行數:21,代碼來源:JPAEdmProperty.java

示例3: buildJoinColumns

import javax.persistence.JoinColumns; //導入依賴的package包/類
private void buildJoinColumns(List<Annotation> annotationList, Element element) {
	JoinColumn[] joinColumns = getJoinColumns( element, false );
	if ( joinColumns.length > 0 ) {
		AnnotationDescriptor ad = new AnnotationDescriptor( JoinColumns.class );
		ad.setValue( "value", joinColumns );
		annotationList.add( AnnotationFactory.create( ad ) );
	}
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:9,代碼來源:JPAOverriddenAnnotationReader.java

示例4: getView

import javax.persistence.JoinColumns; //導入依賴的package包/類
@OneToOne(cascade  =  CascadeType.PERSIST)
   @JoinColumns ({
       @JoinColumn(name  =   "view" , referencedColumnName  =   "dataid" ),
       @JoinColumn(name  =   "creater" , referencedColumnName  =   "creater" )
   })
public TopicView getView() {
	return view;
}
 
開發者ID:uckefu,項目名稱:uckefu,代碼行數:9,代碼來源:TopicComment.java

示例5: getRecord

import javax.persistence.JoinColumns; //導入依賴的package包/類
@ForeignKey(name = "none")
@MapsId("record")
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumns({
        @JoinColumn(name = COLUMN_RECORD_ID, referencedColumnName = "id")
})
public RAuditEventRecord getRecord() {
    return record;
}
 
開發者ID:Pardus-Engerek,項目名稱:engerek,代碼行數:10,代碼來源:RAuditItem.java

示例6: getAssignment

import javax.persistence.JoinColumns; //導入依賴的package包/類
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumns({
	@JoinColumn(name = "unit_id", referencedColumnName = "unit_id", nullable = false),
	@JoinColumn(name = "operational_period_id", referencedColumnName = "operational_period_id", nullable = false) })
public Assignment getAssignment() {
	return this.assignment;
}
 
開發者ID:hadrsystems,項目名稱:nics-common,代碼行數:8,代碼來源:ResourceAssign.java

示例7: getStorage

import javax.persistence.JoinColumns; //導入依賴的package包/類
@NotNull
@ManyToOne(optional = false, fetch = FetchType.LAZY)
@JoinColumns(value = {
	@JoinColumn(name = "storage_owner_id", referencedColumnName = "owner_id", insertable = false, updatable = false),
	@JoinColumn(name = "storage_name", referencedColumnName = "name", insertable = false, updatable = false)
}, foreignKey = @ForeignKey(name = RdbmsConstants.PREFIX + "storage_tag_object_statistics_fk_storage"))
public Storage getStorage() {
	return storage;
}
 
開發者ID:Blazebit,項目名稱:blaze-storage,代碼行數:10,代碼來源:StorageTagObjectStatistics.java

示例8: getBucketObject

import javax.persistence.JoinColumns; //導入依賴的package包/類
@NotNull
@ManyToOne(optional = false, fetch = FetchType.LAZY)
@JoinColumns(
		foreignKey = @ForeignKey(name = RdbmsConstants.PREFIX + "bucket_object_version_fk_bucket_object"),
		value = {
	@JoinColumn(name = "bucket_id", referencedColumnName = "bucket_id", insertable = false, updatable = false),
	@JoinColumn(name = "object_name", referencedColumnName = "name", insertable = false, updatable = false)
})
public BucketObject getBucketObject() {
	return bucketObject;
}
 
開發者ID:Blazebit,項目名稱:blaze-storage,代碼行數:12,代碼來源:BucketObjectVersion.java

示例9: getStorage

import javax.persistence.JoinColumns; //導入依賴的package包/類
@NotNull
@ManyToOne(optional = false, fetch = FetchType.LAZY)
@JoinColumns(
		foreignKey = @ForeignKey(name = RdbmsConstants.PREFIX + "bucket_object_version_fk_storage"),
		value = {
	@JoinColumn(name = "storage_owner_id", referencedColumnName = "owner_id"),
	@JoinColumn(name = "storage_name", referencedColumnName = "name")
})
public Storage getStorage() {
	return storage;
}
 
開發者ID:Blazebit,項目名稱:blaze-storage,代碼行數:12,代碼來源:BucketObjectVersion.java

示例10: getContentVersion

import javax.persistence.JoinColumns; //導入依賴的package包/類
@ManyToOne(optional = true, fetch = FetchType.LAZY)
@JoinColumns(
		foreignKey = @ForeignKey(name = RdbmsConstants.PREFIX + "bucket_object_fk_content_version"),
		value = {
	@JoinColumn(name = "bucket_id", referencedColumnName = "bucket_id", insertable = false, updatable = false),
	@JoinColumn(name = "name", referencedColumnName = "object_name", insertable = false, updatable = false),
	@JoinColumn(name = "content_version_uuid", referencedColumnName = "version_uuid", insertable = false, updatable = false)
})
public BucketObjectVersion getContentVersion() {
	return contentVersion;
}
 
開發者ID:Blazebit,項目名稱:blaze-storage,代碼行數:12,代碼來源:BucketObject.java

示例11: getStorage

import javax.persistence.JoinColumns; //導入依賴的package包/類
@NotNull
@ManyToOne(optional = false, fetch = FetchType.LAZY)
@JoinColumns(
		foreignKey = @ForeignKey(name = RdbmsConstants.PREFIX + "bucket_fk_storage"),
		value = {
	@JoinColumn(name = "storage_owner", referencedColumnName = "owner_id"),
	@JoinColumn(name = "storage_name", referencedColumnName = "name")
})
public Storage getStorage() {
	return storage;
}
 
開發者ID:Blazebit,項目名稱:blaze-storage,代碼行數:12,代碼來源:Bucket.java

示例12: getQuotaPlan

import javax.persistence.JoinColumns; //導入依賴的package包/類
@NotNull
@ManyToOne(optional = false, fetch = FetchType.LAZY)
@JoinColumns(value = {
		@JoinColumn(name = "quota_plan_id", referencedColumnName = "quota_model_id"), 
		@JoinColumn(name = "quota_plan_limit", referencedColumnName = "gigabyte_limit")
	}, foreignKey = @ForeignKey(name = RdbmsConstants.PREFIX + "storage_fk_quota_plan"))
public StorageQuotaPlan getQuotaPlan() {
	return quotaPlan;
}
 
開發者ID:Blazebit,項目名稱:blaze-storage,代碼行數:10,代碼來源:Storage.java

示例13: getPlayersHasQuests

import javax.persistence.JoinColumns; //導入依賴的package包/類
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumns({
		@JoinColumn(name = "players_has_quests_players_idplayers", referencedColumnName = "players_idplayers", nullable = false, insertable = false, updatable = false),
		@JoinColumn(name = "players_has_quests_quests_idquests", referencedColumnName = "quests_idquests", nullable = false, insertable = false, updatable = false) })
public PlayersHasQuests getPlayersHasQuests() {
	return this.playersHasQuests;
}
 
開發者ID:machadolucas,項目名稱:watchout,代碼行數:8,代碼來源:TurnsHistory.java

示例14: getPlacesHasTransports

import javax.persistence.JoinColumns; //導入依賴的package包/類
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumns({
		@JoinColumn(name = "places_has_transports_places_origin", referencedColumnName = "places_origin", nullable = false, insertable = false, updatable = false),
		@JoinColumn(name = "places_has_transports_transportation", referencedColumnName = "transportation", nullable = false, insertable = false, updatable = false),
		@JoinColumn(name = "places_has_transports_places_destination", referencedColumnName = "places_destination", nullable = false, insertable = false, updatable = false) })
public PlacesHasTransports getPlacesHasTransports() {
	return this.placesHasTransports;
}
 
開發者ID:machadolucas,項目名稱:watchout,代碼行數:9,代碼來源:TurnsHistory.java

示例15: getTurnsHistory

import javax.persistence.JoinColumns; //導入依賴的package包/類
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumns({
		@JoinColumn(name = "turns_history_players_has_quests_players_idplayers", referencedColumnName = "players_has_quests_players_idplayers", nullable = false, insertable = false, updatable = false),
		@JoinColumn(name = "turns_history_players_has_quests_quests_idquests", referencedColumnName = "players_has_quests_quests_idquests", nullable = false, insertable = false, updatable = false),
		@JoinColumn(name = "turns_history_places_has_transports_places_origin", referencedColumnName = "places_has_transports_places_origin", nullable = false, insertable = false, updatable = false),
		@JoinColumn(name = "turns_history_places_has_transports_transportation", referencedColumnName = "places_has_transports_transportation", nullable = false, insertable = false, updatable = false),
		@JoinColumn(name = "turns_history_places_has_transports_places_destination", referencedColumnName = "places_has_transports_places_destination", nullable = false, insertable = false, updatable = false) })
public TurnsHistory getTurnsHistory() {
	return this.turnsHistory;
}
 
開發者ID:machadolucas,項目名稱:watchout,代碼行數:11,代碼來源:TurnsHistoryHasTransportationrisks.java


注:本文中的javax.persistence.JoinColumns類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。