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

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

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

Table.getReferences介绍

[英]Get the list of FOREIGN KEY's of this table
[中]获取此表的FOREIGN KEY列表

代码示例

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

  1. @SuppressWarnings({ "unchecked", "rawtypes" })
  2. @Override
  3. public final List<ForeignKey<Record, ?>> getReferences() {
  4. List<ForeignKey<?, ?>> result = new ArrayList<ForeignKey<?, ?>>();
  5. result.addAll(lhs.getReferences());
  6. result.addAll(rhs.getReferences());
  7. return (List) result;
  8. }

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

  1. @SuppressWarnings({ "unchecked", "rawtypes" })
  2. @Override
  3. public final List<ForeignKey<Record, ?>> getReferences() {
  4. List<? extends ForeignKey<?, ?>> lhsReferences = lhs.getReferences();
  5. List<? extends ForeignKey<?, ?>> rhsReferences = rhs.getReferences();
  6. List<ForeignKey<?, ?>> result = new ArrayList<ForeignKey<?, ?>>(lhsReferences.size() + rhsReferences.size());
  7. result.addAll(lhsReferences);
  8. result.addAll(rhsReferences);
  9. return (List) result;
  10. }

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

  1. @Override
  2. public final List<ForeignKey<R, ?>> getReferences() {
  3. return alias.wrapped().getReferences();
  4. }

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

  1. @Override
  2. public final List<ForeignKey<R, ?>> getReferences() {
  3. return alias.wrapped().getReferences();
  4. }

代码示例来源:origin: rancher/cattle

  1. /**
  2. * Determines if a table's primary key is referenced at all by other tables.
  3. *
  4. * @param table
  5. * @param others
  6. * @return
  7. */
  8. public static boolean isReferencedBy(Table<?> table, List<Table<?>> others) {
  9. for (Table<?> other : others) {
  10. for (ForeignKey<?, ?> key : other.getReferences()) {
  11. if (key.getKey().getTable().equals(table)) {
  12. return true;
  13. }
  14. }
  15. }
  16. return false;
  17. }

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

  1. @Override
  2. public final JoinTable onKey(TableField<?, ?>... keyFields) throws DataAccessException {
  3. if (keyFields != null && keyFields.length > 0) {
  4. if (keyFields[0].getTable().equals(lhs)) {
  5. for (ForeignKey<?, ?> key : lhs.getReferences()) {
  6. if (key.getFields().containsAll(asList(keyFields))) {
  7. return onKey(key);
  8. }
  9. }
  10. }
  11. else if (keyFields[0].getTable().equals(rhs)) {
  12. for (ForeignKey<?, ?> key : rhs.getReferences()) {
  13. if (key.getFields().containsAll(asList(keyFields))) {
  14. return onKey(key);
  15. }
  16. }
  17. }
  18. }
  19. throw onKeyException();
  20. }

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

  1. @Override
  2. public final JoinTable onKey(TableField<?, ?>... keyFields) throws DataAccessException {
  3. if (keyFields != null && keyFields.length > 0) {
  4. if (search(lhs, keyFields[0].getTable()) != null) {
  5. for (ForeignKey<?, ?> key : lhs.getReferences()) {
  6. if (key.getFields().containsAll(asList(keyFields))) {
  7. return onKey(key);
  8. }
  9. }
  10. }
  11. else if (search(rhs, keyFields[0].getTable()) != null) {
  12. for (ForeignKey<?, ?> key : rhs.getReferences()) {
  13. if (key.getFields().containsAll(asList(keyFields))) {
  14. return onKey(key);
  15. }
  16. }
  17. }
  18. }
  19. throw onKeyException(OnKeyExceptionReason.NOT_FOUND, null, null);
  20. }

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

  1. private List<Constraint> foreignKeys(Table<?> table) {
  2. List<Constraint> result = new ArrayList<Constraint>();
  3. if (flags.contains(FOREIGN_KEY))
  4. for (ForeignKey<?, ?> key : table.getReferences())
  5. result.add(constraint(key.getName()).foreignKey(key.getFieldsArray()).references(key.getKey().getTable(), key.getKey().getFieldsArray()));
  6. return result;
  7. }

代码示例来源:origin: rancher/cattle

  1. protected void registerRelationships() {
  2. for (TypeSet typeSet : typeSets) {
  3. for (Class<?> clz : typeSet.getTypeClasses()) {
  4. Table<?> table = JooqUtils.getTableFromRecordClass(clz);
  5. if (table == null) {
  6. continue;
  7. }
  8. registerTableFields(table);
  9. for (ForeignKey<?, ?> reference : table.getReferences()) {
  10. register(reference);
  11. }
  12. }
  13. }
  14. findMappings();
  15. }

代码示例来源:origin: mevdschee/java-crud-api

  1. @SuppressWarnings("unchecked")
  2. public ReflectedTable(Table<?> table) {
  3. super(table.getQualifiedName());
  4. this.table = table;
  5. for (Field<?> field : table.fields()) {
  6. String name = field.getName();
  7. DataType<Object> dataType = (DataType<Object>) field.getDataType();
  8. TableField newField = createField(name, dataType);
  9. fields.put(name, newField);
  10. }
  11. UniqueKey<?> primaryKey = table.getPrimaryKey();
  12. if (primaryKey != null) {
  13. if (primaryKey.getFields().size() == 1) {
  14. pk = primaryKey.getFields().get(0);
  15. }
  16. }
  17. for (ForeignKey<?, ?> fk : table.getReferences()) {
  18. fks.put(findForeignKeyFieldName(fk), findForeignKeyReference(fk));
  19. }
  20. }

代码示例来源:origin: rancher/cattle

  1. if (foreignKey == null) {
  2. Table<?> childTable = JooqUtils.getTableFromRecordClass(child);
  3. for (ForeignKey<?, ?> foreignKeyTest : childTable.getReferences()) {
  4. if (foreignKeyTest.getKey().getTable().getRecordType() == parent) {
  5. if (propertyField != null) {

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

  1. exportKey0(result, t, key, key.isPrimary() ? PRIMARY_KEY : UNIQUE);
  2. for (ForeignKey<?, ?> fk : t.getReferences())
  3. if (includedTables.contains(fk.getKey().getTable()))
  4. exportKey0(result, t, fk, FOREIGN_KEY);

相关文章