Package org.beangle.model.entity

Examples of org.beangle.model.entity.ObjectAndType


          boolean isForeigner = isForeigner(attr);
          // 如果是个外键,先根据parentPath生成新的外键实体。
          // 因此导入的是外键,只能有一个属性导入.
          if (isForeigner) {
            String parentPath = StringUtils.substringBeforeLast(attr, ".");
            ObjectAndType propertyType = populator.initProperty(entity, entityName, parentPath);
            Object property = propertyType.getObj();
            if (property instanceof Entity<?>) {
              if (((Entity<?>) property).isPersisted()) {
                populator.populateValue(entity, parentPath, null);
                populator.initProperty(entity, entityName, parentPath);
              }
View Full Code Here


        type = propertyType;
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return new ObjectAndType(property, type);
  }
View Full Code Here

      if (-1 == attr.indexOf('.')) {
        setValue(attr, value, entity);
      } else {
        String parentAttr = StringUtils.substring(attr, 0, attr.lastIndexOf('.'));
        try {
          ObjectAndType ot = initProperty(entity, entityName, parentAttr);
          if (null == ot) {
            logger.error("error attr:[" + attr + "] value:[" + value + "]");
            continue;
          }
          // 属性也是实体类对象
          if (ot.getType().isEntityType()) {
            String foreignKey = ((EntityType) ot.getType()).getIdPropertyName();
            if (attr.endsWith("." + foreignKey)) {
              if (null == value) {
                setValue(parentAttr, null, entity);
              } else {
                Object foreignValue = PropertyUtils.getProperty(entity, attr);
View Full Code Here

        type = propertyType;
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return new ObjectAndType(property, type);
  }
View Full Code Here

      if (-1 == attr.indexOf('.')) {
        setValue(attr, value, entity);
      } else {
        String parentAttr = StringUtils.substring(attr, 0, attr.lastIndexOf('.'));
        try {
          ObjectAndType ot = initProperty(entity, entityName, parentAttr);
          if (null == ot) {
            logger.error("error attr:[" + attr + "] value:[" + value + "]");
            continue;
          }
          // 属性也是实体类对象
          if (ot.getType().isEntityType()) {
            String foreignKey = ((EntityType) ot.getType()).getIdPropertyName();
            if (attr.endsWith("." + foreignKey)) {
              if (null == value) {
                setValue(parentAttr, null, entity);
              } else {
                Object foreignValue = PropertyUtils.getProperty(entity, attr);
View Full Code Here

          boolean isForeigner = isForeigner(attr);
          // 如果是个外键,先根据parentPath生成新的外键实体。
          // 因此导入的是外键,只能有一个属性导入.
          if (isForeigner) {
            String parentPath = StringUtils.substringBeforeLast(attr, ".");
            ObjectAndType propertyType = populator.initProperty(entity, entityName,
                parentPath);
            Object property = propertyType.getObj();
            if (property instanceof Entity<?>) {
              if (((Entity<?>) property).isPersisted()) {
                populator.populateValue(entity, parentPath, null);
                populator.initProperty(entity, entityName, parentPath);
              }
View Full Code Here

          boolean isForeigner = isForeigner(attr);
          // 如果是个外键,先根据parentPath生成新的外键实体。
          // 因此导入的是外键,只能有一个属性导入.
          if (isForeigner) {
            String parentPath = StringUtils.substringBeforeLast(attr, ".");
            ObjectAndType propertyType = populator.initProperty(entity, entityName, parentPath);
            Object property = propertyType.getObj();
            if (property instanceof Entity<?>) {
              if (((Entity<?>) property).isPersisted()) {
                populator.populateValue(entity, parentPath, null);
                populator.initProperty(entity, entityName, parentPath);
              }
View Full Code Here

        type = propertyType;
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return new ObjectAndType(property, type);
  }
View Full Code Here

      if (-1 == attr.indexOf('.')) {
        setValue(attr, value, entity);
      } else {
        String parentAttr = StringUtils.substring(attr, 0, attr.lastIndexOf('.'));
        try {
          ObjectAndType ot = initProperty(entity, entityName, parentAttr);
          if (null == ot) {
            logger.error("error attr:[" + attr + "] value:[" + value + "]");
            continue;
          }
          // 属性也是实体类对象
          if (ot.getType().isEntityType()) {
            String foreignKey = ((EntityType) ot.getType()).getIdPropertyName();
            if (attr.endsWith("." + foreignKey)) {
              if (null == value) {
                setValue(parentAttr, null, entity);
              } else {
                Object foreignValue = PropertyUtils.getProperty(entity, attr);
View Full Code Here

TOP

Related Classes of org.beangle.model.entity.ObjectAndType

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.