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

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

本文整理了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

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

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

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

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

  1. @Override
  2. public final JoinTable onKey() throws DataAccessException {
  3. List<?> leftToRight = lhs.getReferencesTo(rhs);
  4. List<?> rightToLeft = rhs.getReferencesTo(lhs);
  5. if (leftToRight.size() == 1 && rightToLeft.size() == 0) {
  6. return onKey((ForeignKey<?, ?>) leftToRight.get(0));
  7. }
  8. else if (rightToLeft.size() == 1 && leftToRight.size() == 0) {
  9. return onKey((ForeignKey<?, ?>) rightToLeft.get(0));
  10. }
  11. throw onKeyException();
  12. }

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

  1. @Override
  2. public final JoinTable onKey() throws DataAccessException {
  3. List<?> leftToRight = lhs.getReferencesTo(rhs);
  4. List<?> rightToLeft = rhs.getReferencesTo(lhs);
  5. if (leftToRight.size() == 1 && rightToLeft.size() == 0) {
  6. return onKey((ForeignKey<?, ?>) leftToRight.get(0), lhs, rhs);
  7. }
  8. else if (rightToLeft.size() == 1 && leftToRight.size() == 0) {
  9. return onKey((ForeignKey<?, ?>) rightToLeft.get(0), rhs, lhs);
  10. }
  11. if (rightToLeft.isEmpty() && leftToRight.isEmpty())
  12. throw onKeyException(OnKeyExceptionReason.NOT_FOUND, leftToRight, rightToLeft);
  13. else
  14. throw onKeyException(OnKeyExceptionReason.AMBIGUOUS, null, null);
  15. }

相关文章