Package org.dmlite.model.meta

Examples of org.dmlite.model.meta.ModelMeta


      IEntity parentEntity = childModelContext.getEntity();
      childModelContext.setContextEntity(parentEntity);
      String childNeighbor = (String) modelContext.getMoreArgs().get(
          "childNeighbor");
      IDomainModel domainModel = childModelContext.getDomainModel();
      ModelMeta modelMeta = domainModel.getModelMeta();
      IEntities childEntities = modelMeta.getNeighborEntities(
          parentEntity, childNeighbor);
      childModelContext.setEntities(childEntities);

      ViewContext childViewContext = new ViewContext(viewContext, true);
      childViewContext.setWicketId("childPropertyList");
View Full Code Here


    String entitiesClass = getConceptConfig().getEntitiesClass();
    try {
      IDomainModel domainModel = getDomainModel();
      if (domainModel != null) {
        Collection<T> collection = getCollection(orderCriteria);
        ModelMeta modelMeta = domainModel.getModelMeta();
        destinationEntities = (OrderedEntities<T>) modelMeta
            .createEntities(entitiesClass);
        destinationEntities.add(collection);
        modelMeta.setParents(destinationEntities, this);
        destinationEntities.setSourceEntities(this);
      } else {
        String error = "There is no domain model.";
        throw new OrderException(error);
      }
View Full Code Here

   *            property code
   * @return list of property not null values
   */
  public List getPropertyList(String propertyCode) {
    List propertyList = new ArrayList();
    ModelMeta modelMeta = getDomainModel().getModelMeta();
    if (modelMeta != null) {
      propertyList = modelMeta.getPropertyList(this, propertyCode);
    }
    return propertyList;
  }
View Full Code Here

    Entities<T> destinationEntities = null;
    try {
      IDomainModel domainModel = getDomainModel();
      if (domainModel != null) {
        Collection collection = getCollection(selectionCriteria);
        ModelMeta modelMeta = domainModel.getModelMeta();
        destinationEntities = (Entities<T>) modelMeta
            .createEntities(getConceptConfig().getEntitiesClass());
        destinationEntities.add(collection);
        modelMeta.setParents(destinationEntities, this);
        destinationEntities.setSourceEntities(this);
      } else {
        String error = "There is no domain model.";
        throw new SelectionException(error);
      }
View Full Code Here

          String error = "Union input entities must be of the same type.";
          throw new SelectionException(error);
        }

        Collection<T> collection = getCollection();
        ModelMeta modelMeta = domainModel.getModelMeta();
        union = (Entities<T>) modelMeta.createEntities(getConceptConfig()
            .getEntitiesClass());
        union.setPropagateToSource(false);
        union.add(collection);

        for (T entity : entities) {
          if (!union.contain(entity)) {
            union.add(entity);
          }
        }

        modelMeta.setParents(union, this);
        if (getSourceEntities() != null
            && entities.getSourceEntities() != null
            && getSourceEntities() == entities.getSourceEntities()) {
          union.setSourceEntities(getSourceEntities());
          union.setPropagateToSource(true);
View Full Code Here

        if (!entitiesArgumentClass.equals(thisEntitiesClass)) {
          String error = "Intersection input entities must be of the same type.";
          throw new SelectionException(error);
        }

        ModelMeta modelMeta = domainModel.getModelMeta();
        intersection = (Entities<T>) modelMeta
            .createEntities(getConceptConfig().getEntitiesClass());
        intersection.setPropagateToSource(false);

        for (T entity : this) {
          if (entities.contain(entity)) {
            intersection.add(entity);
          }
        }
        for (T entity : entities) {
          if (!intersection.contain(entity) && this.contain(entity)) {
            intersection.add(entity);
          }
        }

        modelMeta.setParents(intersection, this);
        if (getSourceEntities() != null
            && entities.getSourceEntities() != null
            && getSourceEntities() == entities.getSourceEntities()) {
          intersection.setSourceEntities(getSourceEntities());
          intersection.setPropagateToSource(true);
View Full Code Here

        if (validation) {
          ConceptConfig conceptConfig = entity.getConceptConfig();
          if (conceptConfig != null) {
            validation = validMaxCardinality(1);
            if (validation) {
              ModelMeta modelMeta = domainModel.getModelMeta();
              PropertiesConfig propertiesConfig = conceptConfig
                  .getPropertiesConfig();
              for (IEntity config : propertiesConfig) {
                PropertyConfig propertyConfig = (PropertyConfig) config;
                String propertyCode = propertyConfig.getCode();
                Object property = entity
                    .getProperty(propertyCode);
                if (propertyConfig.isRequired()) {
                  if (property != null) {
                    if (propertyConfig.isValidateType()) {
                      validation = modelMeta
                          .validPropertyType(this,
                              entity,
                              propertyConfig,
                              property)
                          && validation;
                    }
                    if (propertyConfig.getPropertyClass()
                        .equals("java.lang.String")) {
                      validation = modelMeta
                          .validMaxLength(this,
                              entity,
                              propertyConfig,
                              property)
                          && validation;
                    }
                  } else { // property is null
                    if (propertyConfig.getDefaultValue() != null) {
                      if (!modelMeta
                          .setPropertyDefaultValue(
                              entity,
                              propertyConfig,
                              property)) {
                        modelMeta
                            .addRequiredPropertyError(
                                this, entity,
                                propertyConfig);
                        validation = false;
                      }
                    } else {
                      modelMeta.addRequiredPropertyError(
                          this, entity,
                          propertyConfig);
                      validation = false;
                    }
                  }
                } else { // property is not required
                  if (property != null) {
                    if (propertyConfig.isValidateType()) {
                      validation = modelMeta
                          .validPropertyType(this,
                              entity,
                              propertyConfig,
                              property)
                          && validation;
                    }
                    if (propertyConfig.getPropertyClass()
                        .equals("java.lang.String")) {
                      validation = modelMeta
                          .validMaxLength(this,
                              entity,
                              propertyConfig,
                              property)
                          && validation;
                    }
                  } else { // property is null
                    if (propertyConfig.getDefaultValue() != null) {
                      modelMeta.setPropertyDefaultValue(
                          entity, propertyConfig,
                          property);
                    }
                  } // if
                } // if
View Full Code Here

    IDomainModel domainModel = getDomainModel();
    if (domainModel != null) {
      if (domainModel.isInitialized()) {
        ConceptConfig conceptConfig = entity.getConceptConfig();
        if (conceptConfig != null) {
          ModelMeta modelMeta = domainModel.getModelMeta();
          if (!conceptConfig.getIdConfig().isEmpty()) {
            validation = modelMeta.uniqueId(this, entity)
                && validation;
          }
        }
      }
    }
View Full Code Here

        entity.setOid(oid);
      }

      IDomainModel domainModel = getDomainModel();
      if (domainModel != null) {
        ModelMeta modelMeta = domainModel.getModelMeta();
        modelMeta.setParents(entity, this);
      }

      boolean added = false;
      added = collectionOfEntities.add(entity);
      if (added) {
View Full Code Here

    if (conceptConfig != null) {
      PropertiesConfig propertiesConfig = conceptConfig
          .getPropertiesConfig();
      IDomainModel domainModel = getDomainModel();
      if (domainModel != null) {
        ModelMeta modelMeta = domainModel.getModelMeta();
        for (PropertyConfig config : propertiesConfig) {
          PropertyConfig propertyConfig = (PropertyConfig) config;
          String propertyCode = propertyConfig.getCode();
          Object afterProperty = updateEntity
              .getProperty(propertyCode);
          if (propertyConfig.isRequired()) {
            if (afterProperty != null) {
              if (propertyConfig.isValidateType()) {
                validation = modelMeta.validPropertyType(this,
                    updateEntity, propertyConfig,
                    afterProperty)
                    && validation;
              }
            } else {
              modelMeta.addRequiredPropertyError(this, entity,
                  propertyConfig);
              validation = false;
            }
          } else if (afterProperty != null) {
            if (propertyConfig.isValidateType()) {
              validation = modelMeta
                  .validPropertyType(this, updateEntity,
                      propertyConfig, afterProperty)
                  && validation;
            }
          } // if
View Full Code Here

TOP

Related Classes of org.dmlite.model.meta.ModelMeta

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.