Java 类javax.persistence.JoinColumns 实例源码

项目:redg    文件:JpaMetamodelRedGProvider.java   
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;
}
项目:olingo-odata2    文件:JPAEdmProperty.java   
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);
  }
}
项目:lams    文件:JPAOverriddenAnnotationReader.java   
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 ) );
    }
}
项目:uckefu    文件:TopicComment.java   
@OneToOne(cascade  =  CascadeType.PERSIST)
   @JoinColumns ({
       @JoinColumn(name  =   "view" , referencedColumnName  =   "dataid" ),
       @JoinColumn(name  =   "creater" , referencedColumnName  =   "creater" )
   })
public TopicView getView() {
    return view;
}
项目:engerek    文件:RAuditItem.java   
@ForeignKey(name = "none")
@MapsId("record")
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumns({
        @JoinColumn(name = COLUMN_RECORD_ID, referencedColumnName = "id")
})
public RAuditEventRecord getRecord() {
    return record;
}
项目:nics-common    文件:ResourceAssign.java   
@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;
}
项目:nics-common    文件:TaskAssign.java   
@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;
}
项目:blaze-storage    文件:StorageTagObjectStatistics.java   
@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;
}
项目:blaze-storage    文件:BucketObjectVersion.java   
@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;
}
项目:blaze-storage    文件:BucketObjectVersion.java   
@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;
}
项目:blaze-storage    文件:BucketObject.java   
@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;
}
项目:blaze-storage    文件:Bucket.java   
@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;
}
项目:blaze-storage    文件:Storage.java   
@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;
}
项目:watchout    文件:TurnsHistory.java   
@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;
}
项目:watchout    文件:TurnsHistory.java   
@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;
}
项目:watchout    文件:QuestInsurances.java   
@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;
}
项目:watchout    文件:TurnsHistoryHasTransportationrisks.java   
@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;
}
项目:watchout    文件:TurnsHistoryHasPlacesrisks.java   
@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;
}
项目:ef-orm    文件:MetaHolder.java   
private static JoinPath getHint(FieldAnnotationProvider annos, AbstractMetadata meta, ITableMetadata target) {
    if (annos.getAnnotation(JoinColumn.class) != null) {
        JoinColumn j = annos.getAnnotation(JoinColumn.class);
        return processJoin(meta, target, annos, j);
    } else if (annos.getAnnotation(JoinColumns.class) != null) {
        JoinColumns jj = annos.getAnnotation(JoinColumns.class);
        return processJoin(meta, target, annos, jj.value());
    } else if (annos.getAnnotation(JoinTable.class) != null) {
        JoinTable jt = annos.getAnnotation(JoinTable.class);
        return processJoin(meta, target, annos, jt);
    }
    return null;
}
项目:hyperjaxb3    文件:CreateXAnnotations.java   
public XAnnotation<?> createJoinColumns(List<JoinColumn> cJoinColumns) {
    return transform(
            JoinColumns.class,
            javax.persistence.JoinColumn.class,
            cJoinColumns,
            new Transformer<JoinColumn, XAnnotation<javax.persistence.JoinColumn>>() {
                public XAnnotation<javax.persistence.JoinColumn> transform(
                        JoinColumn input) {
                    return createJoinColumn(input);
                }
            });
}
项目:pm    文件:ScreeningSupplementedStock.java   
@ManyToOne(fetch=FetchType.EAGER,cascade = CascadeType.MERGE)
@JoinColumns ({
       @JoinColumn(name="isin", referencedColumnName = "isin"),
       @JoinColumn(name="symbol", referencedColumnName = "symbol")
   })
   @Id
public Stock getStock() {
    return stock;
}
项目:pm    文件:PortfolioShare.java   
@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
@JoinColumns( { @JoinColumn(name = "isin", referencedColumnName = "isin"), @JoinColumn(name = "symbol", referencedColumnName = "symbol") })
@ForeignKey(name = "FK_STOCK")
@Id
public Stock getStock() {
    return stock;
}
项目:pm    文件:AlertOnEvent.java   
@Id
@ManyToOne
@ForeignKey(name="FK_ALERTONEVENT_TO_PORTFOLIO")
@JoinColumns({
    @JoinColumn(name="symbol", referencedColumnName="symbol" , nullable = false),
    @JoinColumn(name="isin", referencedColumnName="isin", nullable = false),
    @JoinColumn(name="name", referencedColumnName="name", nullable = false)
})
public PortfolioShare getPortfolioShare() {
    return portfolioShare;
}
项目:pm    文件:AlertOnThreshold.java   
@Id
@ManyToOne
@ForeignKey(name="FK_ALERTS_TO_PORTFOLIO")
@JoinColumns({
    @JoinColumn(name="symbol", referencedColumnName="symbol" , nullable = false),
    @JoinColumn(name="isin", referencedColumnName="isin", nullable = false),
    @JoinColumn(name="name", referencedColumnName="name", nullable = false)
})
public PortfolioShare getPortfolioShare() {
    return portfolioShare;
}
项目:pm    文件:TunedConfId.java   
@ManyToOne
@JoinColumns( { 
    @JoinColumn(name = "isin", referencedColumnName = "isin", insertable = false, updatable = false, nullable = false),
    @JoinColumn(name = "symbol", referencedColumnName = "symbol", insertable = false, updatable = false, nullable = false) 
})
public Stock getStock() {
    return stock;
}
项目:zswxsqxt    文件:ApplicationRely.java   
@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
@JoinColumns({
    @JoinColumn(name = "application_id",nullable = false, insertable = false, updatable = false) 
})
public Application getApplication() {
    return application;
}
项目:zswxsqxt    文件:ApplicationRely.java   
@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
@JoinColumns({
    @JoinColumn(name = "rely_application_id",nullable = false, insertable = false, updatable = false) 
})
public Application getRelyApplication() {
    return relyApplication;
}
项目:zswxsqxt    文件:Permission.java   
@ManyToOne(cascade = {}, fetch = FetchType.EAGER)
@JoinColumns({
    @JoinColumn(name = "application_id",nullable = false, insertable = false, updatable = false) 
})
public Application getApplication() {
    return application;
}
项目:zswxsqxt    文件:Permission.java   
@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
@JoinColumns({
    @JoinColumn(name = "parent_id",nullable = true, insertable = false, updatable = false) 
})
public Permission getParentPermission() {
    return parentPermission;
}
项目:zswxsqxt    文件:Resources.java   
@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
@JoinColumns({
    @JoinColumn(name = "parent_id",nullable = true, insertable = false, updatable = false) 
})
public Resources getResources() {
    return resources;
}
项目:zswxsqxt    文件:Resources.java   
@ManyToOne(cascade = {}, fetch = FetchType.EAGER)
@JoinColumns({
    @JoinColumn(name = "permission_id",nullable = true, insertable = false, updatable = false) 
})
public Permission getPermission() {
    return permission;
}
项目:zswxsqxt    文件:Dictvalue.java   
@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
@JoinColumns({
    @JoinColumn(name = "parent_id",nullable = false, insertable = false, updatable = false) 
})
public Dictvalue getDictvalue() {
    return dictvalue;
}
项目:zswxsqxt    文件:Dictvalue.java   
@ManyToOne(cascade = {}, fetch = FetchType.EAGER)
@JoinColumns({
    @JoinColumn(name = "dictitem_id",nullable = false, insertable = false, updatable = false) 
})
public Dictitem getDictitem() {
    return dictitem;
}
项目:zswxsqxt    文件:RsExpandProperty.java   
@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
@JoinColumns({
    @JoinColumn(name = "resources_id",nullable = true, insertable = true, updatable = true) 
})
public RsResources getRsResources() {
    return rsResources;
}
项目:zswxsqxt    文件:RsResources.java   
@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
@JoinColumns({
    @JoinColumn(name = "resources_type_id",nullable = false, insertable = false, updatable = false) 
})
public RsType getRsType() {
    return rsType;
}
项目:zswxsqxt    文件:RsResources.java   
@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
@JoinColumns({
    @JoinColumn(name = "upload_user_id",nullable = false, insertable = false, updatable = false) 
})
public User getOgUser() {
    return ogUser;
}
项目:zswxsqxt    文件:Organization.java   
@ManyToOne(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY)
@JoinColumns({
    @JoinColumn(name = "parentId",nullable = true, insertable = false, updatable = false) 
})
public Organization getOrganization() {
    return organization;
}
项目:zswxsqxt    文件:Organization.java   
@ManyToOne(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY)
@JoinColumns({
    @JoinColumn(name = "managerId",nullable = true, insertable = false, updatable = false) 
})
public User getManager() {
    return manager;
}
项目:zswxsqxt    文件:Dept.java   
@ManyToOne(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY)
@JoinColumns({
    @JoinColumn(name = "parentId",nullable = true, insertable = false, updatable = false) 
})
public Dept getDept() {
    return dept;
}
项目:zswxsqxt    文件:Dept.java   
@ManyToOne(cascade = { CascadeType.MERGE }, fetch = FetchType.LAZY)
@JoinColumns({
    @JoinColumn(name = "leaderId",nullable = true, insertable = false, updatable = false) 
})
public User getLeader() {
    return leader;
}