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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  1. static Table<?> join(Table<?> table, ZipkinAnnotations joinTable, String key, int type) {
  2. return table.join(joinTable)
  3. .on(ZIPKIN_SPANS.TRACE_ID.eq(joinTable.TRACE_ID))
  4. .and(ZIPKIN_SPANS.ID.eq(joinTable.SPAN_ID))
  5. .and(joinTable.A_TYPE.eq(type))
  6. .and(joinTable.A_KEY.eq(key));
  7. }
  8. }

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

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

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

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

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

  1. @Override
  2. public final void addJoinOnKey(TableLike<?> table, JoinType type, TableField<?, ?>... keyFields) throws DataAccessException {
  3. // TODO: This and similar methods should be refactored, patterns extracted...
  4. int index = getFrom().size() - 1;
  5. Table<?> joined = null;
  6. switch (type) {
  7. case JOIN:
  8. joined = getFrom().get(index).join(table).onKey(keyFields);
  9. break;
  10. case LEFT_OUTER_JOIN:
  11. joined = getFrom().get(index).leftOuterJoin(table).onKey(keyFields);
  12. break;
  13. case RIGHT_OUTER_JOIN:
  14. joined = getFrom().get(index).rightOuterJoin(table).onKey(keyFields);
  15. break;
  16. case FULL_OUTER_JOIN:
  17. joined = getFrom().get(index).fullOuterJoin(table).onKey(keyFields);
  18. break;
  19. default:
  20. throw new IllegalArgumentException("JoinType " + type + " is not supported with the addJoinOnKey() method. Use INNER or OUTER JOINs only");
  21. }
  22. getFrom().set(index, joined);
  23. }

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

  1. @Override
  2. public final void addJoinUsing(TableLike<?> table, JoinType type, Collection<? extends Field<?>> fields) {
  3. // TODO: This and similar methods should be refactored, patterns extracted...
  4. int index = getFrom().size() - 1;
  5. Table<?> joined = null;
  6. switch (type) {
  7. case JOIN:
  8. joined = getFrom().get(index).join(table).using(fields);
  9. break;
  10. case LEFT_OUTER_JOIN:
  11. joined = getFrom().get(index).leftOuterJoin(table).using(fields);
  12. break;
  13. case RIGHT_OUTER_JOIN:
  14. joined = getFrom().get(index).rightOuterJoin(table).using(fields);
  15. break;
  16. case FULL_OUTER_JOIN:
  17. joined = getFrom().get(index).fullOuterJoin(table).using(fields);
  18. break;
  19. default:
  20. throw new IllegalArgumentException("JoinType " + type + " is not supported with the addJoinUsing() method. Use INNER or OUTER JOINs only");
  21. }
  22. getFrom().set(index, joined);
  23. }

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

  1. @Override
  2. public final void addJoinOnKey(TableLike<?> table, JoinType type) throws DataAccessException {
  3. // TODO: This and similar methods should be refactored, patterns extracted...
  4. int index = getFrom().size() - 1;
  5. Table<?> joined = null;
  6. switch (type) {
  7. case JOIN:
  8. joined = getFrom().get(index).join(table).onKey();
  9. break;
  10. case LEFT_OUTER_JOIN:
  11. joined = getFrom().get(index).leftOuterJoin(table).onKey();
  12. break;
  13. case RIGHT_OUTER_JOIN:
  14. joined = getFrom().get(index).rightOuterJoin(table).onKey();
  15. break;
  16. case FULL_OUTER_JOIN:
  17. joined = getFrom().get(index).fullOuterJoin(table).onKey();
  18. break;
  19. default:
  20. throw new IllegalArgumentException("JoinType " + type + " is not supported with the addJoinOnKey() method. Use INNER or OUTER JOINs only");
  21. }
  22. getFrom().set(index, joined);
  23. }

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

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

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

  1. @Override
  2. public final void addJoinOnKey(TableLike<?> table, JoinType type, ForeignKey<?, ?> key) {
  3. // TODO: This and similar methods should be refactored, patterns extracted...
  4. int index = getFrom().size() - 1;
  5. Table<?> joined = null;
  6. switch (type) {
  7. case JOIN:
  8. joined = getFrom().get(index).join(table).onKey(key);
  9. break;
  10. case LEFT_OUTER_JOIN:
  11. joined = getFrom().get(index).leftOuterJoin(table).onKey(key);
  12. break;
  13. case RIGHT_OUTER_JOIN:
  14. joined = getFrom().get(index).rightOuterJoin(table).onKey(key);
  15. break;
  16. case FULL_OUTER_JOIN:
  17. joined = getFrom().get(index).fullOuterJoin(table).onKey(key);
  18. break;
  19. default:
  20. throw new IllegalArgumentException("JoinType " + type + " is not supported with the addJoinOnKey() method. Use INNER or OUTER JOINs only");
  21. }
  22. getFrom().set(index, joined);
  23. }

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

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

相关文章