Package org.jboss.dna.graph.query.validate.Schemata

Examples of org.jboss.dna.graph.query.validate.Schemata.Table


        return table;
    }

    protected Schemata.Column verify( SelectorName selectorName,
                                      String propertyName ) {
        Table table = tableWithNameOrAlias(selectorName);
        if (table == null) {
            problems.addError(GraphI18n.tableDoesNotExist, selectorName.getName());
            return null;
        }
        Schemata.Column column = table.getColumn(propertyName);
        if (column == null) {
            // Maybe the supplied property name is really an alias ...
            column = this.columnsByAlias.get(propertyName);
            if (column == null) {
                problems.addError(GraphI18n.columnDoesNotExistOnTable, propertyName, selectorName.getName());
View Full Code Here


            PropertyValue propValue = (PropertyValue)operand;
            String propertyName = propValue.getPropertyName();
            String selectorName = propValue.getSelectorName().getName();
            final int index = columns.getColumnIndexForProperty(selectorName, propertyName);
            // Find the expected property type of the value ...
            Table table = schemata.getTable(propValue.getSelectorName());
            Column schemaColumn = table.getColumn(propertyName);
            final String expectedType = schemaColumn.getPropertyType();
            final TypeFactory<?> typeFactory = typeSystem.getTypeFactory(expectedType);
            return new DynamicOperation() {
                public String getExpectedType() {
                    return expectedType;
                }

                public Object evaluate( Object[] tuple ) {
                    return typeFactory.create(tuple[index]);
                }
            };
        }
        final TypeFactory<String> stringFactory = typeSystem.getStringFactory();
        if (operand instanceof Length) {
            Length length = (Length)operand;
            PropertyValue value = length.getPropertyValue();
            String propertyName = value.getPropertyName();
            String selectorName = value.getSelectorName().getName();
            final int index = columns.getColumnIndexForProperty(selectorName, propertyName);
            // Find the expected property type of the value ...
            Table table = context.getSchemata().getTable(value.getSelectorName());
            Column schemaColumn = table.getColumn(propertyName);
            final String expectedType = schemaColumn.getPropertyType();
            final TypeFactory<?> typeFactory = typeSystem.getTypeFactory(expectedType);
            final TypeFactory<Long> longFactory = typeSystem.getLongFactory();
            return new DynamicOperation() {
                public String getExpectedType() {
View Full Code Here

TOP

Related Classes of org.jboss.dna.graph.query.validate.Schemata.Table

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.