public void update() { tables = new LinkedHashMap<>(); cachedTables = new LinkedHashMap<>(); for (Table<?> table : dsl.meta().getTables()) { if (!(table.toString().startsWith(tablePrefix))) { // table not in current catalog or schema continue; } tables.put(table.getName(), table); } }
public static boolean tableExists(DSLContext context, Table table) { for (Table t : context.meta().getTables()) { if (t.getName().equalsIgnoreCase(table.getName())) { return true; } } return false; } }
public MappingQueryGenerator(DSLContext dslContext, final String tableName) { Meta meta = dslContext.meta(); for (Table table : meta.getTables()) { System.out.println(table.getName()); if (table.getName().equalsIgnoreCase(tableName)) { this.table = table; break; } } if (this.table == null) { throw new JDBCSinkException("Table not found: " + tableName); } }
if (context.meta().getTables().stream() .filter(t -> t.getName().equals(recordTable.getName())) .findFirst()
@Override public void clear(Class component) throws DaoException { if (!tableExists()) { return; } DSLContext context = getJooq(); try { if (!context.meta().getTables().contains(Tables.META_INFO)) { return; } context.delete(Tables.META_INFO) .where(Tables.META_INFO.COMPONENT.eq(component.getSimpleName())) .execute(); } finally { freeJooq(context); } }
existingTables = context.meta().getTables().stream() .map(t -> t.getName().toLowerCase(Locale.ENGLISH)) .collect(Collectors.toSet());