org.jooq.Table.getReferencesTo()方法的使用及代码示例

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

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

Table.getReferencesTo介绍

[英]Get a list of FOREIGN KEY's of this table, referencing a specific table.
[中]获取此表的FOREIGN KEY列表,引用特定表。

代码示例

代码示例来源:origin: org.jooq/jooq

/**
 * {@inheritDoc}
 */
@Override
public final <O extends Record> List<ForeignKey<O, R>> getReferencesFrom(Table<O> other) {
  return other.getReferencesTo(this);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * {@inheritDoc}
 */
@Override
public final <O extends Record> List<ForeignKey<O, R>> getReferencesFrom(Table<O> other) {
  return other.getReferencesTo(this);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public final JoinTable onKey() throws DataAccessException {
  List<?> leftToRight = lhs.getReferencesTo(rhs);
  List<?> rightToLeft = rhs.getReferencesTo(lhs);
  if (leftToRight.size() == 1 && rightToLeft.size() == 0) {
    return onKey((ForeignKey<?, ?>) leftToRight.get(0));
  }
  else if (rightToLeft.size() == 1 && leftToRight.size() == 0) {
    return onKey((ForeignKey<?, ?>) rightToLeft.get(0));
  }
  throw onKeyException();
}

代码示例来源:origin: org.jooq/jooq

@Override
public final JoinTable onKey() throws DataAccessException {
  List<?> leftToRight = lhs.getReferencesTo(rhs);
  List<?> rightToLeft = rhs.getReferencesTo(lhs);
  if (leftToRight.size() == 1 && rightToLeft.size() == 0) {
    return onKey((ForeignKey<?, ?>) leftToRight.get(0), lhs, rhs);
  }
  else if (rightToLeft.size() == 1 && leftToRight.size() == 0) {
    return onKey((ForeignKey<?, ?>) rightToLeft.get(0), rhs, lhs);
  }
  if (rightToLeft.isEmpty() && leftToRight.isEmpty())
    throw onKeyException(OnKeyExceptionReason.NOT_FOUND, leftToRight, rightToLeft);
  else
    throw onKeyException(OnKeyExceptionReason.AMBIGUOUS, null, null);
}

相关文章