@Test public void testSetPlaceholderValueException() { placeholderValues[0] = 5564; placeholderValues[1] = "cdef"; handler.columnValIndex = 0; handler.placeholderValues = placeholderValues; String msg=null; try { handler.setPlaceholderValue(handler.columnValue); } catch (Exception e) { msg = e.getMessage(); } assertEquals("Can't set NULL value", msg); }
@Override public void setPlaceholderValue(TreeNode node) { for (TreeNode child : node.getChildNodes()) { if ((child.getClass().isAssignableFrom((Placeholder.class)) || child.getClass().isAssignableFrom((IdentifierNode.class))) && placeholderIndexes.contains(columnValIndex)) { if (null != placeholderValues[placeholderIndexes.indexOf(columnValIndex)]) { IdentifierNode ident = new IdentifierNode( placeholderValues[placeholderIndexes.indexOf(columnValIndex)].toString()); ident.setParent(node); child.getParent().setChildNode(ident, columnValIndex); } else { LOGGER.error("ERROR: Can't set NULL value"); throw new BlkchnException("Can't set NULL value"); } } columnValIndex++; } }
InsertPlaceholderHandler implements PlaceholderHandler { @Override public void setPlaceholderValue(TreeNode node) { for (TreeNode child : node.getChildNodes()) { if ((child.getClass().isAssignableFrom((Placeholder.class)) || child.getClass().isAssignableFrom((IdentifierNode.class))) && placeholderIndexes.contains(columnValIndex)) { if (null != placeholderValues[placeholderIndexes.indexOf(columnValIndex)]) { IdentifierNode ident = new IdentifierNode( placeholderValues[placeholderIndexes.indexOf(columnValIndex)].toString()); ident.setParent(node); child.getParent().setChildNode(ident, columnValIndex); } else { LOGGER.error("ERROR: Can't set NULL value"); throw new BlkchnException("Can't set NULL value"); } } columnValIndex++; } } }
InsertPlaceholderHandler implements PlaceholderHandler { @Override public void setPlaceholderValue(TreeNode node) { for (TreeNode child : node.getChildNodes()) { if ((child.getClass().isAssignableFrom((Placeholder.class)) || child.getClass().isAssignableFrom((IdentifierNode.class))) && placeholderIndexes.contains(columnValIndex)) { if (null != placeholderValues[placeholderIndexes.indexOf(columnValIndex)]) { IdentifierNode ident = new IdentifierNode( placeholderValues[placeholderIndexes.indexOf(columnValIndex)].toString()); ident.setParent(node); child.getParent().setChildNode(ident, columnValIndex); } else { LOGGER.error("ERROR: Can't set NULL value"); throw new BlkchnException("Can't set NULL value"); } } columnValIndex++; } } InsertPlaceholderHandler(LogicalPlan logicalPlan); }
InsertPlaceholderHandler implements PlaceholderHandler { @Override public void setPlaceholderValue(TreeNode node) { for (TreeNode child : node.getChildNodes()) { if ((child.getClass().isAssignableFrom((Placeholder.class)) || child.getClass().isAssignableFrom((IdentifierNode.class))) && placeholderIndexes.contains(columnValIndex)) { if (null != placeholderValues[placeholderIndexes.indexOf(columnValIndex)]) { IdentifierNode ident = new IdentifierNode( placeholderValues[placeholderIndexes.indexOf(columnValIndex)].toString()); ident.setParent(node); child.getParent().setChildNode(ident, columnValIndex); } else { LOGGER.error("ERROR: Can't set NULL value"); throw new BlkchnException("Can't set NULL value"); } } columnValIndex++; } } InsertPlaceholderHandler(LogicalPlan logicalPlan); @Override void setPlaceholderIndex(); @Override void setPlaceholderIndex(TreeNode node); @Override void alterLogicalPlan(Object[] placeholderValues); @Override void setPlaceholderValue(TreeNode node); @Override boolean isIndexListEmpty(); @Override int getIndexListCount(); }
InsertPlaceholderHandler implements PlaceholderHandler { @Override public void setPlaceholderValue(TreeNode node) { for (TreeNode child : node.getChildNodes()) { if ((child.getClass().isAssignableFrom((Placeholder.class)) || child.getClass().isAssignableFrom((IdentifierNode.class))) && placeholderIndexes.contains(columnValIndex)) { if (null != placeholderValues[placeholderIndexes.indexOf(columnValIndex)]) { IdentifierNode ident = new IdentifierNode( placeholderValues[placeholderIndexes.indexOf(columnValIndex)].toString()); ident.setParent(node); child.getParent().setChildNode(ident, columnValIndex); } else { LOGGER.error("ERROR: Can't set NULL value"); throw new BlkchnException("Can't set NULL value"); } } columnValIndex++; } } InsertPlaceholderHandler(LogicalPlan logicalPlan); @Override void setPlaceholderIndex(); @Override void setPlaceholderIndex(TreeNode node); @Override void alterLogicalPlan(Object[] placeholderValues); @Override void setPlaceholderValue(TreeNode node); @Override boolean isIndexListEmpty(); @Override int getIndexListCount();  }