Examples of GrailsDomainClassProperty


Examples of grails.core.GrailsDomainClassProperty

        }
        if (o2.equals(domainClass.getIdentifier())) {
            return 1;
        }

        GrailsDomainClassProperty prop1 = (GrailsDomainClassProperty)o1;
        GrailsDomainClassProperty prop2 = (GrailsDomainClassProperty)o2;

        Constrained cp1 = (Constrained)constrainedProperties.get(prop1.getName());
        Constrained cp2 = (Constrained)constrainedProperties.get(prop2.getName());

        if (cp1 == null & cp2 == null) {
            return prop1.getName().compareTo(prop2.getName());
        }

        if (cp1 == null) {
            return 1;
        }
View Full Code Here

Examples of grails.core.GrailsDomainClassProperty

        final GrailsDomainClass domainClass = property.getDomainClass();
        // only apply default nullable to Groovy entities not legacy Java ones
        if (!GroovyObject.class.isAssignableFrom(domainClass.getClazz())) return false;

        final GrailsDomainClassProperty versionProperty = domainClass.getVersion();
        final boolean isVersion = versionProperty != null && versionProperty.equals(property);
        return !constrained.hasAppliedConstraint(ConstrainedProperty.NULLABLE_CONSTRAINT) &&
            isConstrainableProperty(property, propertyName) && !property.isIdentity() && !isVersion && !property.isDerived();
    }
View Full Code Here

Examples of grails.core.GrailsDomainClassProperty

        if (associatedDomainClass == null || !isOwningInstance(bean, associatedDomainClass) && !persistentProperty.isExplicitSaveUpdateCascade()) {
            return;
        }

        GrailsDomainClassProperty otherSide = null;
        if (persistentProperty.isBidirectional()) {
            otherSide = persistentProperty.getOtherSide();
        }

        Map associatedConstraintedProperties = associatedDomainClass.getConstrainedProperties();
View Full Code Here

Examples of org.codehaus.groovy.grails.commons.GrailsDomainClassProperty

    if (!StringUtils.hasLength(templateText)) {
      return;
    }

    GrailsDomainClassProperty multiPart = null;
    for (GrailsDomainClassProperty property : domainClass.getProperties()) {
      if (property.getType() == Byte[].class || property.getType() == byte[].class) {
        multiPart = property;
        break;
      }
View Full Code Here

Examples of org.codehaus.groovy.grails.commons.GrailsDomainClassProperty

    }
    if (o2.equals(domainClass.getIdentifier())) {
      return 1;
    }

    GrailsDomainClassProperty prop1 = (GrailsDomainClassProperty)o1;
    GrailsDomainClassProperty prop2 = (GrailsDomainClassProperty)o2;

    ConstrainedProperty cp1 = (ConstrainedProperty)constrainedProperties.get(prop1.getName());
    ConstrainedProperty cp2 = (ConstrainedProperty)constrainedProperties.get(prop2.getName());

    if (cp1 == null & cp2 == null) {
      return prop1.getName().compareTo(prop2.getName());
    }

    if (cp1 == null) {
      return 1;
    }
View Full Code Here

Examples of org.codehaus.groovy.grails.commons.GrailsDomainClassProperty

        }
        if (o2.equals(domainClass.getIdentifier())) {
            return 1;
        }

        GrailsDomainClassProperty prop1 = (GrailsDomainClassProperty)o1;
        GrailsDomainClassProperty prop2 = (GrailsDomainClassProperty)o2;

        ConstrainedProperty cp1 = (ConstrainedProperty)constrainedProperties.get(prop1.getName());
        ConstrainedProperty cp2 = (ConstrainedProperty)constrainedProperties.get(prop2.getName());

        if (cp1 == null & cp2 == null) {
            return prop1.getName().compareTo(prop2.getName());
        }

        if (cp1 == null) {
            return 1;
        }
View Full Code Here

Examples of org.codehaus.groovy.grails.commons.GrailsDomainClassProperty

        Class mappedClass = grailsDomainClass.getClazz();
        List properties = new ArrayList();
        GrailsDomainClassProperty[] domainClassProperties = grailsDomainClass.getProperties();
        for (int i = 0, max = domainClassProperties.length; i < max; i++) {
            GrailsDomainClassProperty property = domainClassProperties[i];
            String propertyName = property.getName();
            if (!GrailsDomainClassUtils.isIndentityProperty(property) && !SearchableUtils.isIncludedProperty(propertyName, searchableValue)) {
                LOG.debug(
                    "Not mapping [" + ClassUtils.getShortName(mappedClass) + "." + propertyName + "] because of " +
                    (defaultExcludes ? "default property exclusions" : "specified only/except rule")
                );
View Full Code Here

Examples of org.codehaus.groovy.grails.commons.GrailsDomainClassProperty

                CompassClassPropertyMapping propertyMapping = (CompassClassPropertyMapping) piter.next();
                if ((propertyMapping.isComponent() || propertyMapping.isReference()) && !propertyMapping.hasAttribute("refAlias")) {
                    Set aliases = new HashSet();
                    Class clazz = propertyMapping.getPropertyType();
                    aliases.add(((CompassClassMapping) mappingByClass.get(clazz)).getAlias());
                    GrailsDomainClassProperty domainClassProperty = GrailsDomainClassUtils.getGrailsDomainClassProperty(grailsDomainClasses, mappedClass, propertyMapping.getPropertyName());

                    GrailsDomainClass dc = domainClassProperty.getReferencedDomainClass();
                    if (dc == null) {
                        Class elementClass = SearchableUtils.getElementClass(domainClassProperty);
                        dc = GrailsDomainClassUtils.getGrailsDomainClass(elementClass, grailsDomainClasses);

                        if (dc == null) {
                            LOG.warn("Cannot find domain class for property '" + domainClassProperty.getName() +
                                    "' of class '" + domainClassProperty.getDomainClass().getFullName());
                            continue;
                        }
                    }
                    Collection clazzes = GrailsDomainClassUtils.getClazzes(dc.getSubClasses());
                    for (Iterator citer = clazzes.iterator(); citer.hasNext(); ) {
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.