private void setUpSingleFieldConstraint(SingleFieldConstraint sfc) { this.factType = sfc.getFactType(); this.fieldName = sfc.getFieldName(); this.fieldType = oracle.getFieldType(factType, fieldName); }
private Set<String> visitSingleFieldConstraint(SingleFieldConstraint sfc) { final Set<String> factTypes = new HashSet<String>(); if (sfc.getFactType() != null) { factTypes.add(sfc.getFactType()); } factTypes.addAll(visit(sfc.getExpressionValue())); if (sfc.getConnectives() != null) { for (int i = 0; i < sfc.getConnectives().length; i++) { factTypes.addAll(visit(sfc.getConnectives()[i])); } } return factTypes; }
private void setUpSingleFieldConstraint(SingleFieldConstraint sfc) { this.factType = sfc.getFactType(); this.fieldName = sfc.getFieldName(); this.fieldType = oracle.getFieldType(factType, fieldName); }
private Set<String> visitSingleFieldConstraint(SingleFieldConstraint sfc) { final Set<String> factTypes = new HashSet<String>(); if (sfc.getFactType() != null) { factTypes.add(sfc.getFactType()); } factTypes.addAll(visit(sfc.getExpressionValue())); if (sfc.getConnectives() != null) { for (int i = 0; i < sfc.getConnectives().length; i++) { factTypes.addAll(visit(sfc.getConnectives()[i])); } } return factTypes; }
private String getFactTypeFromLHSField() { SingleFieldConstraint lhsBoundField = modeller.getModel().getLHSBoundField(model.getVariable()); if (lhsBoundField != null) { return oracle.getFieldClassName(lhsBoundField.getFactType(), lhsBoundField.getFieldName()); } else { return null; } }
private String getFactTypeFromLHSField() { SingleFieldConstraint lhsBoundField = modeller.getModel().getLHSBoundField(model.getVariable()); if (lhsBoundField != null) { return oracle.getFieldClassName(lhsBoundField.getFactType(), lhsBoundField.getFieldName()); } else { return null; } }
@Override public void callback(Boolean result) { if (result) { callback.callback(true); } else { SingleFieldConstraint lhsBoundField = model.getLHSBoundField(boundVariable); if (lhsBoundField != null) { final String boundClassName = oracle.getFieldClassName(lhsBoundField.getFactType(), lhsBoundField.getFieldName()); if (Objects.equals(getFieldTypeClazz(), boundClassName)) { callback.callback(true); return; } oracle.getSuperTypes(boundClassName, new Callback<List<String>>() { @Override public void callback(List<String> superTypes) { callback.callback(checkSuperTypes(superTypes)); return; } }); } else { callback.callback(false); } } } });
@Override public void callback(Boolean result) { if (result) { callback.callback(true); } else { SingleFieldConstraint lhsBoundField = model.getLHSBoundField(boundVariable); if (lhsBoundField != null) { final String boundClassName = oracle.getFieldClassName(lhsBoundField.getFactType(), lhsBoundField.getFieldName()); if (Objects.equals(getFieldTypeClazz(), boundClassName)) { callback.callback(true); return; } oracle.getSuperTypes(boundClassName, new Callback<List<String>>() { @Override public void callback(List<String> superTypes) { callback.callback(checkSuperTypes(superTypes)); return; } }); } else { callback.callback(false); } } } });
final String factType = "Person"; final String fieldName = "age"; when(constraint.getFactType()).thenReturn(factType); when(constraint.getFieldName()).thenReturn(fieldName); when(constraint.getOperator()).thenReturn(originalOperator);
final String factType = "Person"; final String fieldName = "age"; when(constraint.getFactType()).thenReturn(factType); when(constraint.getFieldName()).thenReturn(fieldName); when(constraint.getOperator()).thenReturn(originalOperator);
private void visitSingleFieldConstraint(final SingleFieldConstraint sfc) { ResourceReference resRef = addResourceReference(getFullyQualifiedClassName(sfc.getFactType()), ResourceType.JAVA); resRef.addPartReference(sfc.getFieldName(), PartType.FIELD); addResourceReference(getFullyQualifiedClassName(sfc.getFieldType()), ResourceType.JAVA); if (sfc.getConnectives() != null) { for (int i = 0; i < sfc.getConnectives().length; i++) { visit(sfc.getConnectives()[i]); } } }
private void visitSingleFieldConstraint(final SingleFieldConstraint sfc) { ResourceReference resRef = addResourceReference(getFullyQualifiedClassName(sfc.getFactType()), ResourceType.JAVA); resRef.addPartReference(sfc.getFieldName(), PartType.FIELD); addResourceReference(getFullyQualifiedClassName(sfc.getFieldType()), ResourceType.JAVA); if (sfc.getConnectives() != null) { for (int i = 0; i < sfc.getConnectives().length; i++) { visit(sfc.getConnectives()[i]); } } }
final String className = sfc.getFactType(); final String fieldName = sfc.getFieldName();
private SingleFieldConstraint visitSingleFieldConstraint(SingleFieldConstraint sfc) { SingleFieldConstraint clone = new SingleFieldConstraint(); clone.setConstraintValueType(sfc.getConstraintValueType()); clone.setExpressionValue((ExpressionFormLine) visit(sfc.getExpressionValue())); clone.setFieldBinding(sfc.getFieldBinding()); clone.setFactType(sfc.getFactType()); clone.setFieldName(sfc.getFieldName()); clone.setFieldType(sfc.getFieldType()); clone.setId(sfc.getId()); clone.setOperator(sfc.getOperator()); clone.setParent((FieldConstraint) visit(sfc.getParent())); for (Map.Entry<String, String> entry : sfc.getParameters().entrySet()) { clone.setParameter(entry.getKey(), entry.getValue()); } clone.setValue(sfc.getValue()); if (sfc.getConnectives() != null) { clone.setConnectives(new ConnectiveConstraint[sfc.getConnectives().length]); for (int i = 0; i < sfc.getConnectives().length; i++) { clone.getConnectives()[i] = (ConnectiveConstraint) visit(sfc.getConnectives()[i]); } } return clone; }
private SingleFieldConstraint visitSingleFieldConstraint(SingleFieldConstraint sfc) { SingleFieldConstraint clone = new SingleFieldConstraint(); clone.setConstraintValueType(sfc.getConstraintValueType()); clone.setExpressionValue((ExpressionFormLine) visit(sfc.getExpressionValue())); clone.setFieldBinding(sfc.getFieldBinding()); clone.setFactType(sfc.getFactType()); clone.setFieldName(sfc.getFieldName()); clone.setFieldType(sfc.getFieldType()); clone.setId(sfc.getId()); clone.setOperator(sfc.getOperator()); clone.setParent((FieldConstraint) visit(sfc.getParent())); for (Map.Entry<String, String> entry : sfc.getParameters().entrySet()) { clone.setParameter(entry.getKey(), entry.getValue()); } clone.setValue(sfc.getValue()); if (sfc.getConnectives() != null) { clone.setConnectives(new ConnectiveConstraint[sfc.getConnectives().length]); for (int i = 0; i < sfc.getConnectives().length; i++) { clone.getConnectives()[i] = (ConnectiveConstraint) visit(sfc.getConnectives()[i]); } } return clone; }
factType = constraint.getFactType(); fieldName = constraint.getFieldName();
factType = constraint.getFactType(); fieldName = constraint.getFieldName();