Package org.apache.chemistry.opencmis.commons.enums

Examples of org.apache.chemistry.opencmis.commons.enums.PropertyType


                    if (null != propertyId && null != val) {
                        if (td != null) {
                            PropertyDefinition<?> propDef = td.getPropertyDefinitions().get(propertyId);
                            if (null == propDef)
                                throw new MapperException("Mapping error: unknown property "+ propertyId + " in type definition " + td.getId());
                            PropertyType propertyType = propDef.getPropertyType();
                            Object convVal = mapper.convertValue(propertyId, propDef, val);
                            if (null != convVal)
                                cmisProperties.put(propertyId, convVal);
                        } else
                            cmisProperties.put(propertyId, val); // omit conversion if no type definition is available
View Full Code Here


            Object propertyValue = property.getValue();
            if (propertyId.endsWith(Constants.PARAM_OBJECT_ID))
              id = (String) propertyValue;

            if (propertyValue != null) {
              PropertyType propertyType = property.getType();

              switch (propertyType) {

              case STRING:
              case ID:
View Full Code Here

            if (propertyId.endsWith(Constants.PARAM_OBJECT_ID))
              id = (String) property.getValue();

            if (property.getValue() !=null
                || property.getValues() != null) {
              PropertyType propertyType = property.getType();

              switch (propertyType) {

              case STRING:
              case ID:
View Full Code Here

            if (propertyId.endsWith(Constants.PARAM_OBJECT_ID))
              id = (String) property.getValue();

            if (property.getValue() !=null
                || property.getValues() != null) {
              PropertyType propertyType = property.getType();

              switch (propertyType) {

              case STRING:
              case ID:
View Full Code Here

                throw new RuntimeException("LIKE operator requires String literal on right hand side.");
       
        ColumnReference colRef = getColumnReference(colNode);
        TypeDefinition td = colRef.getTypeDefinition();
        PropertyDefinition<?> pd = td.getPropertyDefinitions().get(colRef.getPropertyId());
        PropertyType propType = pd.getPropertyType();
        if (propType != PropertyType.STRING && propType != PropertyType.HTML &&  propType != PropertyType.ID &&
                propType != PropertyType.URI)
            throw new RuntimeException("Property type "+ propType.value() + " is not allowed FOR LIKE");
        if (pd.getCardinality() != Cardinality.SINGLE)
            throw new RuntimeException("LIKE is not allowed for multi-value properties ");
       
        String propVal = (String) so.getProperties().get(colRef.getPropertyId()).getFirstValue();
        String pattern = translatePattern((String) rVal); // SQL to Java regex syntax
View Full Code Here

                throw new IllegalStateException("LIKE operator requires String literal on right hand side.");
            }

            ColumnReference colRef = getColumnReference(colNode);
            PropertyDefinition<?> pd = colRef.getPropertyDefinition();
            PropertyType propType = pd.getPropertyType();
            if (propType != PropertyType.STRING && propType != PropertyType.HTML && propType != PropertyType.ID
                    && propType != PropertyType.URI) {
                throw new IllegalStateException("Property type " + propType.value() + " is not allowed FOR LIKE");
            }
            if (pd.getCardinality() != Cardinality.SINGLE) {
                throw new IllegalStateException("LIKE is not allowed for multi-value properties ");
            }
View Full Code Here

            if (propertyId.endsWith(Constants.PARAM_OBJECT_ID))
              id = (String) property.getValue();

            if (property.getValue() !=null
                || property.getValues() != null) {
              PropertyType propertyType = property.getType();

              switch (propertyType) {

              case STRING:
              case ID:
View Full Code Here

        Assert.assertEquals(false, l.isEmpty());
        Iterator<Property<?>> i = l.iterator();
        while (i.hasNext()) {
            Property<?> p = i.next();
            Object value = p.getFirstValue();
            PropertyType t = p.getType();

            Assert.assertNotNull(p);
            Assert.assertNotNull(t);

            switch (t) {
View Full Code Here

        Assert.assertEquals(false, l.isEmpty());
        Iterator<Property<?>> i = l.iterator();
        while (i.hasNext()) {
            Property<?> p = i.next();
            Object value = p.getFirstValue();
            PropertyType t = p.getType();

            Assert.assertNotNull(p);
            Assert.assertNotNull(t);

            switch (t) {
View Full Code Here

            if (!(rVal instanceof String))
                throw new RuntimeException("LIKE operator requires String literal on right hand side.");

            ColumnReference colRef = getColumnReference(colNode);
            PropertyDefinition<?> pd = colRef.getPropertyDefinition();
            PropertyType propType = pd.getPropertyType();
            if (propType != PropertyType.STRING && propType != PropertyType.HTML && propType != PropertyType.ID
                    && propType != PropertyType.URI)
                throw new RuntimeException("Property type " + propType.value() + " is not allowed FOR LIKE");
            if (pd.getCardinality() != Cardinality.SINGLE)
                throw new RuntimeException("LIKE is not allowed for multi-value properties ");

            String propVal = (String) so.getProperties().get(colRef.getPropertyId()).getFirstValue();
            String pattern = translatePattern((String) rVal); // SQL to Java
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.commons.enums.PropertyType

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.