ui.setUpdateValidationError(this.updateInfo.getUpdateValidationError()); if (this.updateInfo.getInsertValidationError() != null) { ui.setInsertValidationError(this.updateInfo.getInsertValidationError());
ui.setUpdateValidationError(this.updateInfo.getUpdateValidationError()); if (this.updateInfo.getInsertValidationError() != null) { ui.setInsertValidationError(this.updateInfo.getInsertValidationError());
ui.setUpdateValidationError(this.updateInfo.getUpdateValidationError()); if (this.updateInfo.getInsertValidationError() != null) { ui.setInsertValidationError(this.updateInfo.getInsertValidationError());
public static String validateUpdateInfo(GroupSymbol group, int type, UpdateInfo info) { String error = info.getDeleteValidationError(); String name = "Delete"; //$NON-NLS-1$ if (type == Command.TYPE_UPDATE) { error = info.getUpdateValidationError(); name = "Update"; //$NON-NLS-1$ } else if (type == Command.TYPE_INSERT) { error = info.getInsertValidationError(); name = "Insert"; //$NON-NLS-1$ } if (error != null) { return QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30061, group, name, error); } return null; }
public static String validateUpdateInfo(GroupSymbol group, int type, UpdateInfo info) { String error = info.getDeleteValidationError(); String name = "Delete"; //$NON-NLS-1$ if (type == Command.TYPE_UPDATE) { error = info.getUpdateValidationError(); name = "Update"; //$NON-NLS-1$ } else if (type == Command.TYPE_INSERT) { error = info.getInsertValidationError(); name = "Insert"; //$NON-NLS-1$ } if (error != null) { return QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30061, group, name, error); } return null; }
public static String validateUpdateInfo(GroupSymbol group, int type, UpdateInfo info) { String error = info.getDeleteValidationError(); String name = "Delete"; //$NON-NLS-1$ if (type == Command.TYPE_UPDATE) { error = info.getUpdateValidationError(); name = "Update"; //$NON-NLS-1$ } else if (type == Command.TYPE_INSERT) { error = info.getInsertValidationError(); name = "Insert"; //$NON-NLS-1$ } if (error != null) { return QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30061, group, name, error); } return null; }
private UpdateValidator helpTest(String sql, TransformationMetadata md, boolean failInsert, boolean failUpdate, boolean failDelete) { try { String vGroup = "gx"; Command command = createView(sql, md, vGroup); UpdateValidator uv = new UpdateValidator(md, UpdateType.INHERENT, UpdateType.INHERENT, UpdateType.INHERENT); GroupSymbol gs = new GroupSymbol(vGroup); ResolverUtil.resolveGroup(gs, md); uv.validate(command, ResolverUtil.resolveElementsInGroup(gs, md)); UpdateInfo info = uv.getUpdateInfo(); assertEquals(uv.getReport().getFailureMessage(), failInsert, info.getInsertValidationError() != null); assertEquals(uv.getReport().getFailureMessage(), failUpdate, info.getUpdateValidationError() != null); assertEquals(uv.getReport().getFailureMessage(), failDelete, info.getDeleteValidationError() != null); return uv; } catch (TeiidException e) { throw new RuntimeException(e); } }