@Override public Void visitIndexUnique(IndexUniqueContext ctx) { if (indexes.isEmpty()) return null; indexes.peek().setUnique(true); return null; }
@Override public Void visitIndexUnique(IndexUniqueContext ctx) { if (indexes.isEmpty()) return null; indexes.peek().setUnique(true); return null; }
throw new IOException("Invalid file format: " + line); Index i = new Index(lst.get(0).substring(1)); i.setUnique(lst.get(1).indexOf('U') > -1); i.setPrimary(lst.get(1).indexOf('P') > -1); for (int zz = 2; zz < lst.size(); zz++) {
throw new IOException("Invalid file format: " + line); Index i = new Index(lst.get(0).substring(1)); i.setUnique(lst.get(1).indexOf('U') > -1); i.setPrimary(lst.get(1).indexOf('P') > -1); for (int zz = 2; zz < lst.size(); zz++) {
@Override public Void visitAddIndex(AddIndexContext ctx) { Index index = new Index(ctx.index.getText()); index.setFirstLine(ctx.getStart().getLine()); index.setLastLine(ctx.getStop().getLine()); indexes.push(index); if (ctx.uniq != null) index.setUnique(true); // Search for Table object for this field Table table = null; for (Table t : tables) { if (t.getName().equalsIgnoreCase(ctx.table.getText())) table = t; } if (table != null) { table.addIndex(index); } else { // Log error ? } return visitChildren(ctx); }
@Override public Void visitAddIndex(AddIndexContext ctx) { Index index = new Index(ctx.index.getText()); index.setFirstLine(ctx.getStart().getLine()); index.setLastLine(ctx.getStop().getLine()); indexes.push(index); if (ctx.uniq != null) index.setUnique(true); // Search for Table object for this field Table table = null; for (Table t : tables) { if (t.getName().equalsIgnoreCase(ctx.table.getText())) table = t; } if (table != null) { table.addIndex(index); } else { // Log error ? } return visitChildren(ctx); }