Package org.lilyproject.repository.api

Examples of org.lilyproject.repository.api.FieldTypeUpdateException


            checkImmutableFieldsCorrespond(newFieldType, latestFieldType);
            if (!newFieldType.getName().equals(latestFieldType.getName())) {
                try {
                    // TODO FIXME: doesn't this rely on the field type cache being up to date?
                    getFieldTypeByName(newFieldType.getName());
                    throw new FieldTypeUpdateException("Changing the name '" + newFieldType.getName()
                            + "' of a fieldType '" + newFieldType.getId()
                            + "' to a name that already exists is not allowed; old '" + latestFieldType.getName()
                            + "' new '" + newFieldType.getName() + "'");
                } catch (FieldTypeNotFoundException allowed) {
                }
View Full Code Here


    private void checkImmutableFieldsCorrespond(FieldType userFieldType, FieldType latestFieldType)
            throws FieldTypeUpdateException {

        if (!userFieldType.getValueType().equals(latestFieldType.getValueType())) {
            throw new FieldTypeUpdateException("Changing the valueType of a fieldType '" + latestFieldType.getId() +
                    "' (current name: " + latestFieldType.getName() + ") is not allowed; old '" +
                    latestFieldType.getValueType() + "' new '" + userFieldType.getValueType() + "'");
        }

        if (!userFieldType.getScope().equals(latestFieldType.getScope())) {
            throw new FieldTypeUpdateException("Changing the scope of a fieldType '" + latestFieldType.getId() +
                    "' (current name: " + latestFieldType.getName() + ") is not allowed; old '" +
                    latestFieldType.getScope() + "' new '" + userFieldType.getScope() + "'");
        }
    }
View Full Code Here

TOP

Related Classes of org.lilyproject.repository.api.FieldTypeUpdateException

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.