Package org.lilyproject.util.repo

Examples of org.lilyproject.util.repo.SystemFields$SystemField


        // TODO should we check with the typemanager that the supplied value types are
        // of the correct type? this is not necessary for us, but might be helpful to the
        // user. OTOH, since users most of the time will go through a remote itf, such checks
        // will likely already have happened as part of serialization/deserialization code.

        SystemFields systemFields = SystemFields.getInstance(repository.getTypeManager(), repository.getIdGenerator());

        for (MutationCondition condition : conditions) {
            Object value = systemFields.softEval(record, condition.getField(), repository.getTypeManager());

            // Compare with null value is special case, handle this first
            if (condition.getValue() == null) {
                if (condition.getOp() == CompareOp.EQUAL) {
                    if (value == null) {
View Full Code Here


            return null;
        }

        List<AvroMutationCondition> avroConditions = new ArrayList<AvroMutationCondition>(conditions.size());

        SystemFields systemFields = SystemFields.getInstance(repository.getTypeManager(), repository.getIdGenerator());

        IdentityRecordStack parentRecords = new IdentityRecordStack(parentRecord);

        for (MutationCondition condition : conditions) {
            FieldType fieldType;
            try {
                if (systemFields.isSystemField(condition.getField())) {
                    fieldType = systemFields.get(condition.getField());
                } else {
                    fieldType = repository.getTypeManager().getFieldTypeByName(condition.getField());
                }

                AvroMutationCondition avroCond = new AvroMutationCondition();
View Full Code Here

        // Multiple repositories: ok to use public repo since only non-repository-specific things are needed
        LRepository repository = repositoryMgr.getDefaultRepository();

        List<MutationCondition> result = new ArrayList<MutationCondition>();
        SystemFields systemFields = SystemFields.getInstance(repository.getTypeManager(), repository.getIdGenerator());

        for (int i = 0; i < conditions.size(); i++) {
            JsonNode conditionNode = conditions.get(i);
            if (!conditionNode.isObject()) {
                throw new JsonFormatException("Each element in the conditions array should be an object.");
            }

            QName fieldName = QNameConverter.fromJson(JsonUtil.getString(conditionNode, "field"), namespaces);

            JsonNode valueNode = conditionNode.get("value");
            Object value = null;
            if (!valueNode.isNull()) {
                FieldType fieldType = systemFields.isSystemField(fieldName) ? systemFields.get(fieldName) :
                        repository.getTypeManager().getFieldTypeByName(fieldName);
                value = RecordReader.INSTANCE.readValue(
                        new RecordReader.ValueHandle(valueNode, "value", fieldType.getValueType()),
                        new RecordReader.ReadContext(repositoryMgr.getDefaultRepository(), namespaces,linkTransformer));
            }
View Full Code Here

TOP

Related Classes of org.lilyproject.util.repo.SystemFields$SystemField

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.