org.hibernate.annotations.Table.foreignKey()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(135)

本文整理了Java中org.hibernate.annotations.Table.foreignKey()方法的一些代码示例,展示了Table.foreignKey()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.foreignKey()方法的具体详情如下:
包路径:org.hibernate.annotations.Table
类名称:Table
方法名:foreignKey

Table.foreignKey介绍

暂无

代码示例

代码示例来源:origin: hibernate/hibernate-orm

private void setFKNameIfDefined(Join join) {
  // just awful..
  org.hibernate.annotations.Table matchingTable = findMatchingComplimentTableAnnotation( join );
  if ( matchingTable != null && !BinderHelper.isEmptyAnnotationValue( matchingTable.foreignKey().name() ) ) {
    ( (SimpleValue) join.getKey() ).setForeignKeyName( matchingTable.foreignKey().name() );
  }
  else {
    javax.persistence.SecondaryTable jpaSecondaryTable = findMatchingSecondaryTable( join );
    if ( jpaSecondaryTable != null ) {
      if ( jpaSecondaryTable.foreignKey().value() == ConstraintMode.NO_CONSTRAINT ) {
        ( (SimpleValue) join.getKey() ).setForeignKeyName( "none" );
      }
      else {
        ( (SimpleValue) join.getKey() ).setForeignKeyName( StringHelper.nullIfEmpty( jpaSecondaryTable.foreignKey().name() ) );
        ( (SimpleValue) join.getKey() ).setForeignKeyDefinition( StringHelper.nullIfEmpty( jpaSecondaryTable.foreignKey().foreignKeyDefinition() ) );
      }
    }
  }
}

代码示例来源:origin: org.hibernate/hibernate-annotations

private void setFKNameIfDefined(Join join) {
  org.hibernate.annotations.Table matchingTable = findMatchingComplimentTableAnnotation( join );
  if ( matchingTable != null && !BinderHelper.isDefault( matchingTable.foreignKey().name() ) ) {
    ( (SimpleValue) join.getKey() ).setForeignKeyName( matchingTable.foreignKey().name() );
  }
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

private void setFKNameIfDefined(Join join) {
  org.hibernate.annotations.Table matchingTable = findMatchingComplimentTableAnnotation( join );
  if ( matchingTable != null && !BinderHelper.isEmptyAnnotationValue( matchingTable.foreignKey().name() ) ) {
    ( (SimpleValue) join.getKey() ).setForeignKeyName( matchingTable.foreignKey().name() );
  }
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

private void setFKNameIfDefined(Join join) {
  org.hibernate.annotations.Table matchingTable = findMatchingComplimentTableAnnotation( join );
  if ( matchingTable != null && !BinderHelper.isEmptyAnnotationValue( matchingTable.foreignKey().name() ) ) {
    ( (SimpleValue) join.getKey() ).setForeignKeyName( matchingTable.foreignKey().name() );
  }
}

代码示例来源:origin: org.hibernate.orm/hibernate-core

private void setFKNameIfDefined(Join join) {
  // just awful..
  org.hibernate.annotations.Table matchingTable = findMatchingComplimentTableAnnotation( join );
  if ( matchingTable != null && !BinderHelper.isEmptyAnnotationValue( matchingTable.foreignKey().name() ) ) {
    ( (SimpleValue) join.getKey() ).setForeignKeyName( matchingTable.foreignKey().name() );
  }
  else {
    javax.persistence.SecondaryTable jpaSecondaryTable = findMatchingSecondaryTable( join );
    if ( jpaSecondaryTable != null ) {
      if ( jpaSecondaryTable.foreignKey().value() == ConstraintMode.NO_CONSTRAINT ) {
        ( (SimpleValue) join.getKey() ).setForeignKeyName( "none" );
      }
      else {
        ( (SimpleValue) join.getKey() ).setForeignKeyName( StringHelper.nullIfEmpty( jpaSecondaryTable.foreignKey().name() ) );
        ( (SimpleValue) join.getKey() ).setForeignKeyDefinition( StringHelper.nullIfEmpty( jpaSecondaryTable.foreignKey().foreignKeyDefinition() ) );
      }
    }
  }
}

相关文章