Examples of EntityType


Examples of org.apache.ivory.entity.v0.EntityType

        for (int index = 2; index < args.length; index++) {
            entity = args[index];
            String[] deps = client.getDependency(type, entity).split("\n");
            for (String line : deps) {
                String[] fields = line.replace("(", "").replace(")", "").split(" ");
                EntityType eType = EntityType.valueOf(fields[0].toUpperCase());
                if (ConfigurationStore.get().get(eType, fields[1]) != null) continue;
                String xml = client.getDefinition(eType.name().toLowerCase(), fields[1]);
                System.out.println(xml);
                store(eType, xml);
            }
            String xml = client.getDefinition(type.toLowerCase(), entity);
            System.out.println(xml);
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.EntityType

   * EDM Entity Type Name - RULES
   * ************************************************************************
   */
  public static void build(final JPAEdmEntityTypeView view) {

    EntityType edmEntityType = view.getEdmEntityType();
    String jpaEntityName = view.getJPAEntityType().getName();
    JPAEdmMappingModelAccess mappingModelAccess = view.getJPAEdmMappingModelAccess();
    String edmEntityTypeName = null;
    if (mappingModelAccess != null && mappingModelAccess.isMappingModelExists()) {
      edmEntityTypeName = mappingModelAccess.mapJPAEntityType(jpaEntityName);
    }

    JPAEdmMapping mapping = new JPAEdmMappingImpl();
    mapping.setJPAType(view.getJPAEntityType().getJavaType());

    if (edmEntityTypeName == null) {
      edmEntityTypeName = jpaEntityName;
    }
    // Setting the mapping object
    edmEntityType.setMapping(((Mapping) mapping).setInternalName(jpaEntityName));

    edmEntityType.setName(edmEntityTypeName);

  }
View Full Code Here

Examples of org.beangle.model.entity.types.EntityType

    return getEntityType(attr).getEntityClass();
  }

  protected EntityType getEntityType(String attr) {
    String alias = StringUtils.substringBefore(attr, ".");
    EntityType entityType = (EntityType) entityTypes.get(alias);
    if (null == entityType) {
      entityType = (EntityType) entityTypes.get(attr);
    }
    return entityType;
  }
View Full Code Here

Examples of org.beangle.model.entity.types.EntityType

    }
    return entityType;
  }

  public void addEntity(String alias, Class<?> entityClass) {
    EntityType entityType = Model.getEntityType(entityClass);
    if (null == entityType) { throw new RuntimeException("cannot find entity type for " + entityClass); }
    entityTypes.put(alias, entityType);
  }
View Full Code Here

Examples of org.beangle.model.entity.types.EntityType

    if (null == entityType) { throw new RuntimeException("cannot find entity type for " + entityClass); }
    entityTypes.put(alias, entityType);
  }

  public void addEntity(String alias, String entityName) {
    EntityType entityType = Model.getEntityType(entityName);
    if (null == entityType) { throw new RuntimeException("cannot find entity type for " + entityName); }
    entityTypes.put(alias, entityType);
  }
View Full Code Here

Examples of org.beangle.model.entity.types.EntityType

  public Object getCurrent(String attr) {
    String alias = StringUtils.substringBefore(attr, ".");
    Object entity = current.get(alias);
    if (null == entity) {
      EntityType entityType = (EntityType) entityTypes.get(alias);
      if (null == entityType) {
        logger.error("Not register entity type for {}", alias);
        throw new RuntimeException("Not register entity type for " + alias);
      } else {
        entity = entityType.newInstance();
        current.put(alias, entity);
        return entity;
      }
    }
    return entity;
View Full Code Here

Examples of org.beangle.model.entity.types.EntityType

    for (int i = 0; i < attrs.length; i++) {
      if (StringUtils.isBlank(attrs[i])) {
        continue;
      }
      try {
        EntityType entityType = getEntityType(attrs[i]);
        Entity<?> example = (Entity<?>) entityType.newInstance();
        String entityName = entityType.getEntityName();
        String attr = processAttr(attrs[i]);
        if (attr.indexOf('.') > -1) {
          populator.initProperty(example, entityName, StringUtils.substringBeforeLast(attr, "."));
        }
        rightAttrs.add(attrs[i]);
View Full Code Here

Examples of org.beangle.model.entity.types.EntityType

  public DefaultEntityImporter() {
    super();
  }

  public DefaultEntityImporter(Class<?> entityClass) {
    EntityType type = null;
    if (entityClass.isInterface()) {
      type = Model.getEntityType(entityClass.getName());
    } else {
      type = Model.getEntityType(entityClass);
    }
View Full Code Here

Examples of org.beangle.model.entity.types.EntityType

        clazz = Class.forName(field.getType());
      } catch (ClassNotFoundException e) {
        e.printStackTrace();
        throw new RuntimeException(e);
      }
      EntityType myType=Model.getEntityType(clazz);
      OqlBuilder<T> builder=OqlBuilder.from(myType.getEntityName(), "restrictField");
     
      String[] ids=StringUtils.split(text,",");
      PropertyDescriptor pd=BeanUtils.getPropertyDescriptor(clazz, field.getKeyName());
      Class<?> propertyType=pd.getReadMethod().getReturnType();
      List<Object> realIds=CollectUtils.newArrayList(ids.length);
View Full Code Here

Examples of org.beangle.model.entity.types.EntityType

   * @param name
   * @return
   */
  @SuppressWarnings("unchecked")
  public static <T> T populate(Class<T> clazz, String name) {
    EntityType type = null;
    if (clazz.isInterface()) {
      type = Model.getEntityType(clazz.getName());
    } else {
      type = Model.getEntityType(clazz);
    }
    return (T) populate(type.newInstance(), type.getEntityName(), name);
  }
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.