public static final long getRowCount(final Table table) { if (table == null) { return UNKNOWN_TABLE_ROW_COUNT; } final long tableCount = table .getAttribute(TABLE_ROW_COUNT_KEY, Long.valueOf(UNKNOWN_TABLE_ROW_COUNT)); return tableCount; }
public static final Collection<WeakAssociationForeignKey> getWeakAssociations(final Table table) { if (table == null) { return null; } final SortedSet<WeakAssociationForeignKey> weakAssociations = table .getAttribute(WEAK_ASSOCIATIONS_KEY, new TreeSet<WeakAssociationForeignKey>()); final List<WeakAssociationForeignKey> weakAssociationsList = new ArrayList<>(weakAssociations); weakAssociationsList.sort(naturalOrder()); return weakAssociationsList; }
static void addWeakAssociationToTable(final Table table, final WeakAssociationForeignKey weakAssociation) { if (table != null && weakAssociation != null) { final SortedSet<WeakAssociationForeignKey> tableWeakAssociations = table .getAttribute(WEAK_ASSOCIATIONS_KEY, new TreeSet<WeakAssociationForeignKey>()); tableWeakAssociations.add(weakAssociation); table.setAttribute(WEAK_ASSOCIATIONS_KEY, tableWeakAssociations); } }
private void printForeignKeys(final Table table, final Collection<? extends BaseForeignKey<?>> foreignKeys) { for (final BaseForeignKey<? extends ColumnReference> foreignKey: foreignKeys) { final ForeignKeyCardinality fkCardinality = findForeignKeyCardinality(foreignKey); for (final ColumnReference columnRef: foreignKey) { final Table referencedTable = columnRef.getForeignKeyColumn() .getParent(); final boolean isForeignKeyFiltered = referencedTable .getAttribute("schemacrawler.table.no_grep_match", false); if (isForeignKeyFiltered) { continue; } final boolean isFkColumnFiltered = referencedTable .getAttribute("schemacrawler.table.filtered_out", false); if (table.equals(columnRef.getPrimaryKeyColumn().getParent())) { formattingHelper.append(printColumnReference(identifiers .quoteName(foreignKey.getName()), columnRef, fkCardinality, isFkColumnFiltered)); } } } }
@Override public <T> T getAttribute(String name) { return (T) table.getAttribute(name); }
public static final long getRowCount(final Table table) { if (table == null) { return UNKNOWN_TABLE_ROW_COUNT; } final long tableCount = table .getAttribute(TABLE_ROW_COUNT_KEY, Long.valueOf(UNKNOWN_TABLE_ROW_COUNT)); return tableCount; }
public static final long getRowCount(final Table table) { if (table == null) { return UNKNOWN_TABLE_ROW_COUNT; } final long tableCount = table .getAttribute(TABLE_ROW_COUNT_KEY, Long.valueOf(UNKNOWN_TABLE_ROW_COUNT)); return tableCount; }
public static final Collection<ColumnReference> getWeakAssociations(final Table table) { if (table == null) { return null; } final SortedSet<ColumnReference> weakAssociations = table .getAttribute(WEAK_ASSOCIATIONS_KEY, new TreeSet<ColumnReference>()); final List<ColumnReference> weakAssociationsList = new ArrayList<>(weakAssociations); Collections.sort(weakAssociationsList); return weakAssociationsList; }
public static final Collection<WeakAssociationForeignKey> getWeakAssociations(final Table table) { if (table == null) { return null; } final SortedSet<WeakAssociationForeignKey> weakAssociations = table .getAttribute(WEAK_ASSOCIATIONS_KEY, new TreeSet<WeakAssociationForeignKey>()); final List<WeakAssociationForeignKey> weakAssociationsList = new ArrayList<>(weakAssociations); weakAssociationsList.sort(naturalOrder()); return weakAssociationsList; }
public static final Collection<WeakAssociationForeignKey> getWeakAssociations(final Table table) { if (table == null) { return null; } final SortedSet<WeakAssociationForeignKey> weakAssociations = table .getAttribute(WEAK_ASSOCIATIONS_KEY, new TreeSet<WeakAssociationForeignKey>()); final List<WeakAssociationForeignKey> weakAssociationsList = new ArrayList<>(weakAssociations); weakAssociationsList.sort(naturalOrder()); return weakAssociationsList; }
static void addWeakAssociationToTable(final Table table, final WeakAssociationForeignKey weakAssociation) { if (table != null && weakAssociation != null) { final SortedSet<WeakAssociationForeignKey> tableWeakAssociations = table .getAttribute(WEAK_ASSOCIATIONS_KEY, new TreeSet<WeakAssociationForeignKey>()); tableWeakAssociations.add(weakAssociation); table.setAttribute(WEAK_ASSOCIATIONS_KEY, tableWeakAssociations); } }
static void addWeakAssociationToTable(final Table table, final WeakAssociationForeignKey weakAssociation) { if (table != null && weakAssociation != null) { final SortedSet<WeakAssociationForeignKey> tableWeakAssociations = table .getAttribute(WEAK_ASSOCIATIONS_KEY, new TreeSet<WeakAssociationForeignKey>()); tableWeakAssociations.add(weakAssociation); table.setAttribute(WEAK_ASSOCIATIONS_KEY, tableWeakAssociations); } }
private void printForeignKeys(final Table table, final Collection<? extends BaseForeignKey<?>> foreignKeys) { for (final BaseForeignKey<? extends ColumnReference> foreignKey: foreignKeys) { final ForeignKeyCardinality fkCardinality = findForeignKeyCardinality(foreignKey); for (final ColumnReference columnRef: foreignKey) { final Table referencedTable = columnRef.getForeignKeyColumn() .getParent(); final boolean isForeignKeyFiltered = referencedTable .getAttribute("schemacrawler.table.no_grep_match", false); if (isForeignKeyFiltered) { continue; } final boolean isFkColumnFiltered = referencedTable .getAttribute("schemacrawler.table.filtered_out", false); if (table.equals(columnRef.getPrimaryKeyColumn().getParent())) { formattingHelper.append(printColumnReference(identifiers .quoteName(foreignKey.getName()), columnRef, fkCardinality, isFkColumnFiltered)); } } } }
private void printForeignKeys(final Table table, final Collection<? extends BaseForeignKey<?>> foreignKeys) { for (final BaseForeignKey<? extends ColumnReference> foreignKey: foreignKeys) { final ForeignKeyCardinality fkCardinality = findForeignKeyCardinality(foreignKey); for (final ColumnReference columnRef: foreignKey) { final Table referencedTable = columnRef.getForeignKeyColumn() .getParent(); final boolean isForeignKeyFiltered = referencedTable .getAttribute("schemacrawler.table.no_grep_match", false); if (isForeignKeyFiltered) { continue; } final boolean isFkColumnFiltered = referencedTable .getAttribute("schemacrawler.table.filtered_out", false); if (table.equals(columnRef.getPrimaryKeyColumn().getParent())) { formattingHelper.append(printColumnReference(identifiers .quoteName(foreignKey.getName()), columnRef, fkCardinality, isFkColumnFiltered)); } } } }