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

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

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

Table.join介绍

[英]INNER JOIN a table to this table.

A synonym for #innerJoin(String).

NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!
[中]INNER JOIN一张桌子到这张桌子。
#innerJoin(String)的同义词。
注意:在将普通SQL插入jOOQ对象时,必须保证语法完整性。您还可能创建恶意SQL注入的可能性。在连接到SQL子句时,请确保正确使用绑定变量和/或转义文字!

代码示例

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

@Override
public final void addJoinOnKey(TableLike<?> table, JoinType type) throws DataAccessException {
  // TODO: This and similar methods should be refactored, patterns extracted...
  int index = getFrom().size() - 1;
  Table<?> joined = null;
  switch (type) {
    case JOIN:
    case LEFT_OUTER_JOIN:
    case RIGHT_OUTER_JOIN:
    case FULL_OUTER_JOIN:
    case LEFT_SEMI_JOIN:
    case LEFT_ANTI_JOIN:
      joined = getFrom().get(index).join(table, type).onKey();
      break;
    default:
      throw new IllegalArgumentException("JoinType " + type + " is not supported with the addJoinOnKey() method. Use INNER or OUTER JOINs only");
  }
  getFrom().set(index, joined);
}

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

@Override
public final void addJoinOnKey(TableLike<?> table, JoinType type, TableField<?, ?>... keyFields) throws DataAccessException {
  // TODO: This and similar methods should be refactored, patterns extracted...
  int index = getFrom().size() - 1;
  Table<?> joined = null;
  switch (type) {
    case JOIN:
    case LEFT_OUTER_JOIN:
    case RIGHT_OUTER_JOIN:
    case FULL_OUTER_JOIN:
    case LEFT_SEMI_JOIN:
    case LEFT_ANTI_JOIN:
      joined = getFrom().get(index).join(table, type).onKey(keyFields);
      break;
    default:
      throw new IllegalArgumentException("JoinType " + type + " is not supported with the addJoinOnKey() method. Use INNER or OUTER JOINs only");
  }
  getFrom().set(index, joined);
}

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

@Override
public final void addJoinUsing(TableLike<?> table, JoinType type, Collection<? extends Field<?>> fields) {
  // TODO: This and similar methods should be refactored, patterns extracted...
  int index = getFrom().size() - 1;
  Table<?> joined = null;
  switch (type) {
    case JOIN:
    case LEFT_OUTER_JOIN:
    case RIGHT_OUTER_JOIN:
    case FULL_OUTER_JOIN:
    case LEFT_SEMI_JOIN:
    case LEFT_ANTI_JOIN:
      joined = getFrom().get(index).join(table, type).using(fields);
      break;
    default:
      throw new IllegalArgumentException("JoinType " + type + " is not supported with the addJoinUsing() method. Use INNER or OUTER JOINs only");
  }
  getFrom().set(index, joined);
}

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

@Override
public final void addJoinOnKey(TableLike<?> table, JoinType type, ForeignKey<?, ?> key) {
  // TODO: This and similar methods should be refactored, patterns extracted...
  int index = getFrom().size() - 1;
  Table<?> joined = null;
  switch (type) {
    case JOIN:
    case LEFT_OUTER_JOIN:
    case RIGHT_OUTER_JOIN:
    case FULL_OUTER_JOIN:
    case LEFT_SEMI_JOIN:
    case LEFT_ANTI_JOIN:
      joined = getFrom().get(index).join(table, type).onKey(key);
      break;
    default:
      throw new IllegalArgumentException("JoinType " + type + " is not supported with the addJoinOnKey() method. Use INNER or OUTER JOINs only");
  }
  getFrom().set(index, joined);
}

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

case LEFT_ANTI_JOIN:
case FULL_OUTER_JOIN: {
  TableOptionalOnStep<Record> o = getFrom().get(index).join(table, type);
  TablePartitionByStep<?> p = (TablePartitionByStep<?>) getFrom().get(index).join(table, type);
  TableOnStep<?> o = p;
  joined = getFrom().get(index).join(table, type);
  break;

代码示例来源:origin: io.zipkin.java/zipkin-storage-jdbc

static Table<?> join(Table<?> table, ZipkinAnnotations joinTable, String key, int type) {
 return table.join(joinTable)
   .on(ZIPKIN_SPANS.TRACE_ID.eq(joinTable.TRACE_ID))
   .and(ZIPKIN_SPANS.ID.eq(joinTable.SPAN_ID))
   .and(joinTable.A_TYPE.eq(type))
   .and(joinTable.A_KEY.eq(key));
}

代码示例来源:origin: io.zipkin.java/storage-jdbc

static Table<?> join(Table<?> table, ZipkinAnnotations joinTable, String key, int type) {
 return table.join(joinTable)
   .on(ZIPKIN_SPANS.TRACE_ID.eq(joinTable.TRACE_ID))
   .and(ZIPKIN_SPANS.ID.eq(joinTable.SPAN_ID))
   .and(joinTable.A_TYPE.eq(type))
   .and(joinTable.A_KEY.eq(key));
}

代码示例来源:origin: io.zipkin.java/spanstore-jdbc

static Table<?> join(Table<?> table, ZipkinAnnotations joinTable, String key, int type) {
  return table.join(joinTable)
    .on(ZIPKIN_SPANS.TRACE_ID.eq(joinTable.TRACE_ID))
    .and(ZIPKIN_SPANS.ID.eq(joinTable.SPAN_ID))
    .and(joinTable.A_TYPE.eq(type))
    .and(joinTable.A_KEY.eq(key));
 }
}

代码示例来源:origin: infiniteautomation/ma-core-public

TableOnConditionStep<Record> joinPointPermissions(Table<Record> table, Field<Integer> dataPointIdField, User user) {
  Condition userHasPermission = DataPointDao.getInstance().userHasPermission(user);
  return table
      .join(DataPointDao.DATA_POINTS).on(dataPointIdField.eq(DataPointDao.ID))
      .join(DataSourceDao.DATA_SOURCES).on(DSL.and(DataPointDao.DATA_SOURCE_ID.eq(DataSourceDao.ID), userHasPermission));
}

代码示例来源:origin: perfectsense/dari

table = table.join(join.table, forceLeftJoins || join.isLeftOuter() ? JoinType.LEFT_OUTER_JOIN : JoinType.JOIN)
      .on(join.idField.eq(recordIdField))
      .and(join.typeIdField.eq(recordTypeIdField))
table = table.join(subJoin.table).on(subJoin.on);

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

@Override
public final void addJoinOnKey(TableLike<?> table, JoinType type, TableField<?, ?>... keyFields) throws DataAccessException {
  // TODO: This and similar methods should be refactored, patterns extracted...
  int index = getFrom().size() - 1;
  Table<?> joined = null;
  switch (type) {
    case JOIN:
      joined = getFrom().get(index).join(table).onKey(keyFields);
      break;
    case LEFT_OUTER_JOIN:
      joined = getFrom().get(index).leftOuterJoin(table).onKey(keyFields);
      break;
    case RIGHT_OUTER_JOIN:
      joined = getFrom().get(index).rightOuterJoin(table).onKey(keyFields);
      break;
    case FULL_OUTER_JOIN:
      joined = getFrom().get(index).fullOuterJoin(table).onKey(keyFields);
      break;
    default:
      throw new IllegalArgumentException("JoinType " + type + " is not supported with the addJoinOnKey() method. Use INNER or OUTER JOINs only");
  }
  getFrom().set(index, joined);
}

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

@Override
public final void addJoinUsing(TableLike<?> table, JoinType type, Collection<? extends Field<?>> fields) {
  // TODO: This and similar methods should be refactored, patterns extracted...
  int index = getFrom().size() - 1;
  Table<?> joined = null;
  switch (type) {
    case JOIN:
      joined = getFrom().get(index).join(table).using(fields);
      break;
    case LEFT_OUTER_JOIN:
      joined = getFrom().get(index).leftOuterJoin(table).using(fields);
      break;
    case RIGHT_OUTER_JOIN:
      joined = getFrom().get(index).rightOuterJoin(table).using(fields);
      break;
    case FULL_OUTER_JOIN:
      joined = getFrom().get(index).fullOuterJoin(table).using(fields);
      break;
    default:
      throw new IllegalArgumentException("JoinType " + type + " is not supported with the addJoinUsing() method. Use INNER or OUTER JOINs only");
  }
  getFrom().set(index, joined);
}

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

@Override
public final void addJoinOnKey(TableLike<?> table, JoinType type) throws DataAccessException {
  // TODO: This and similar methods should be refactored, patterns extracted...
  int index = getFrom().size() - 1;
  Table<?> joined = null;
  switch (type) {
    case JOIN:
      joined = getFrom().get(index).join(table).onKey();
      break;
    case LEFT_OUTER_JOIN:
      joined = getFrom().get(index).leftOuterJoin(table).onKey();
      break;
    case RIGHT_OUTER_JOIN:
      joined = getFrom().get(index).rightOuterJoin(table).onKey();
      break;
    case FULL_OUTER_JOIN:
      joined = getFrom().get(index).fullOuterJoin(table).onKey();
      break;
    default:
      throw new IllegalArgumentException("JoinType " + type + " is not supported with the addJoinOnKey() method. Use INNER or OUTER JOINs only");
  }
  getFrom().set(index, joined);
}

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

TablePartitionByStep<?> s1;
TableOnStep<?> s2;
s2 = s1 = (TablePartitionByStep<?>) (s0 = left.join(right, joinType));

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

@Override
public final void addJoinOnKey(TableLike<?> table, JoinType type, ForeignKey<?, ?> key) {
  // TODO: This and similar methods should be refactored, patterns extracted...
  int index = getFrom().size() - 1;
  Table<?> joined = null;
  switch (type) {
    case JOIN:
      joined = getFrom().get(index).join(table).onKey(key);
      break;
    case LEFT_OUTER_JOIN:
      joined = getFrom().get(index).leftOuterJoin(table).onKey(key);
      break;
    case RIGHT_OUTER_JOIN:
      joined = getFrom().get(index).rightOuterJoin(table).onKey(key);
      break;
    case FULL_OUTER_JOIN:
      joined = getFrom().get(index).fullOuterJoin(table).onKey(key);
      break;
    default:
      throw new IllegalArgumentException("JoinType " + type + " is not supported with the addJoinOnKey() method. Use INNER or OUTER JOINs only");
  }
  getFrom().set(index, joined);
}

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

joined = getFrom().get(index).join(table).on(conditions);
  break;
case LEFT_OUTER_JOIN: {

相关文章