Examples of InvalidRecordException


Examples of org.lilyproject.repository.api.InvalidRecordException

    }

    private void checkCreatePreconditions(Record record) throws InvalidRecordException {
        ArgumentValidator.notNull(record, "record");
        if (record.getRecordTypeName() == null) {
            throw new InvalidRecordException("The recordType cannot be null for a record to be created.",
                    record.getId());
        }
        if (record.getFields().isEmpty()) {
            throw new InvalidRecordException("Creating an empty record is not allowed", record.getId());
        }
    }
View Full Code Here

Examples of org.lilyproject.repository.api.InvalidRecordException

        long before = System.currentTimeMillis();
        RecordId recordId = record.getId();
        try {
            if (recordId == null) {
                throw new InvalidRecordException("The recordId cannot be null for a record to be updated.",
                        record.getId());
            }

            FieldTypes fieldTypes = typeManager.getFieldTypesSnapshot();
View Full Code Here

Examples of org.lilyproject.repository.api.InvalidRecordException

        for (FieldTypeEntry fieldTypeEntry : fieldTypeEntries) {
            if (fieldTypeEntry.isMandatory()) {
                FieldType fieldType = fieldTypes.getFieldType(fieldTypeEntry.getFieldTypeId());
                QName fieldName = fieldType.getName();
                if (fieldsToDelete.contains(fieldName)) {
                    throw new InvalidRecordException("Field: '" + fieldName + "' is mandatory.", record.getId());
                }
                if (!record.hasField(fieldName) && !originalRecord.hasField(fieldName)) {
                    throw new InvalidRecordException("Field: '" + fieldName + "' is mandatory.", record.getId());
                }
            }
        }
    }
View Full Code Here

Examples of org.lilyproject.repository.api.InvalidRecordException

        RecordId recordId = record.getId();

        Long version = record.getVersion();
        if (version == null) {
            throw new InvalidRecordException("The version of the record cannot be null to update mutable fields",
                    record.getId());
        }

        try {
            Map<QName, Object> fields = getFieldsToUpdate(record);
View Full Code Here

Examples of org.lilyproject.repository.api.InvalidRecordException

            // Check if the blob is newly uploaded
            Set<BlobReference> failedReservations = blobManager.reserveBlobs(referencedBlobs);
            // If not, filter those that are already used by the record
            failedReservations = filterReferencedBlobs(recordId, failedReservations, null);
            if (!failedReservations.isEmpty()) {
                throw new InvalidRecordException("Record references blobs which are not available for use", recordId);
            }
        }
    }
View Full Code Here

Examples of org.lilyproject.repository.api.InvalidRecordException

        for (FieldTypeEntry fieldTypeEntry : fieldTypeEntries) {
            if (fieldTypeEntry.isMandatory()) {
                FieldType fieldType = getTypeManager().getFieldTypeById(fieldTypeEntry.getFieldTypeId());
                QName fieldName = fieldType.getName();
                if (fieldsToDelete.contains(fieldName)) {
                    throw new InvalidRecordException("Field: '" + fieldName + "' is mandatory.", record.getId());
                }
                if (!record.hasField(fieldName) && !originalRecord.hasField(fieldName)) {
                    throw new InvalidRecordException("Field: '" + fieldName + "' is mandatory.", record.getId());
                }
            }
        }
    }
View Full Code Here

Examples of org.lilyproject.repository.api.InvalidRecordException

            }
        }

        // Check if the record does contain fields that are not defined in the record type
        if (!expectedFields.containsAll(recordFields.keySet())) {
            throw new InvalidRecordException("Record contains fields not part of the record type '" +
                    recordType.getName() + "'", record.getId());
        }
    }
View Full Code Here

Examples of org.neo4j.kernel.impl.nioneo.store.InvalidRecordException

                nextRel.setSecondPrevRel( rel.getId() );
                changed = true;
            }
            if ( !changed )
            {
                throw new InvalidRecordException( node + " dont match " + nextRel );
            }
            getRelationshipStore().updateRecord( nextRel );
        }
    }
View Full Code Here

Examples of org.neo4j.kernel.impl.nioneo.store.InvalidRecordException

            {
                nextRel = relRecord.getSecondNextRel();
            }
            else
            {
                throw new InvalidRecordException( "Node[" + nodeId +
                        "] not part of firstNode[" + firstNode +
                        "] or secondNode[" + secondNode + "]" );
            }
        }
        return ids;
View Full Code Here

Examples of org.neo4j.kernel.impl.nioneo.store.InvalidRecordException

            {
                nextRel = relRecord.getSecondNextRel();
            }
            else
            {
                throw new InvalidRecordException( "Node[" + nodeId +
                        "] not part of firstNode[" + firstNode +
                        "] or secondNode[" + secondNode + "]" );
            }
        }
        return rels;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.