Examples of DTOCollection


Examples of org.jboss.forge.addon.javaee.rest.generator.dto.DTOCollection

      String idClause = JPAEntityUtil.getIdClause(entity, entityTable);
      String orderClause = JPAEntityUtil.getOrderClause(entity,
               JPAEntityUtil.getJpqlEntityVariable(entityTable));
      String resourcePath = ResourceGeneratorUtil.getResourcePath(context);

      DTOCollection createdDtos = from(project, entity, context.getTargetPackageName() + ".dto");
      JavaClassSource rootDto = createdDtos.getDTOFor(entity, true);

      Map<Object, Object> map = new HashMap<>();
      map.put("entity", entity);
      map.put("dto", rootDto);
      map.put("idType", idType);
      map.put("getIdStatement", idGetterName);
      map.put("contentType", contentType);
      map.put("persistenceUnitName", persistenceUnitName);
      map.put("entityTable", entityTable);
      map.put("selectExpression", selectExpression);
      map.put("idClause", idClause);
      map.put("orderClause", orderClause);
      map.put("resourcePath", resourcePath);

      Resource<URL> templateResource = resourceFactory.create(getClass().getResource("EndpointWithDTO.jv"));
      Template processor = templateFactory.create(templateResource, FreemarkerTemplate.class);
      String output = processor.process(map);
      JavaClassSource resource = Roaster.parse(JavaClassSource.class, output);
      resource.addImport(rootDto.getQualifiedName());
      resource.addImport(entity.getQualifiedName());
      resource.setPackage(context.getTargetPackageName());
      result.add(resource);
      result.addAll(createdDtos.allResources());

      return result;
   }
View Full Code Here

Examples of org.jboss.forge.addon.javaee.rest.generator.dto.DTOCollection

    * @param dtoPackage The Java package in which the DTOs are to be created
    * @return The {@link DTOCollection} containing the DTOs created for the JPA entity.
    */
   public DTOCollection from(Project project, JavaClass<?> entity, String dtoPackage)
   {
      DTOCollection dtoCollection = new DTOCollection();
      if (entity == null)
      {
         throw new IllegalArgumentException("The argument entity was null.");
      }
      generatedDTOGraphForEntity(project, entity, dtoPackage, true, false, dtoCollection);
View Full Code Here

Examples of org.jboss.forge.addon.javaee.rest.generator.dto.DTOCollection

      String idClause = ResourceGeneratorUtil.getIdClause(entity, entityTable);
      String orderClause = ResourceGeneratorUtil.getOrderClause(entity,
               ResourceGeneratorUtil.getJpqlEntityVariable(entityTable));
      String resourcePath = ResourceGeneratorUtil.getResourcePath(context);

      DTOCollection createdDtos = from(project, entity, context.getTargetPackageName() + ".dto");
      JavaClassSource rootDto = createdDtos.getDTOFor(entity, true);

      Map<Object, Object> map = new HashMap<>();
      map.put("entity", entity);
      map.put("dto", rootDto);
      map.put("idType", idType);
      map.put("getIdStatement", idGetterName);
      map.put("contentType", contentType);
      map.put("persistenceUnitName", persistenceUnitName);
      map.put("entityTable", entityTable);
      map.put("selectExpression", selectExpression);
      map.put("idClause", idClause);
      map.put("orderClause", orderClause);
      map.put("resourcePath", resourcePath);

      Resource<URL> templateResource = resourceFactory.create(getClass().getResource("EndpointWithDTO.jv"));
      Template processor = templateFactory.create(templateResource, FreemarkerTemplate.class);
      String output = processor.process(map);
      JavaClassSource resource = Roaster.parse(JavaClassSource.class, output);
      resource.addImport(rootDto.getQualifiedName());
      resource.addImport(entity.getQualifiedName());
      resource.setPackage(context.getTargetPackageName());
      result.add(resource);
      result.addAll(createdDtos.allResources());

      return result;
   }
View Full Code Here

Examples of org.jboss.forge.addon.javaee.rest.generator.dto.DTOCollection

    * @param dtoPackage The Java package in which the DTOs are to be created
    * @return The {@link DTOCollection} containing the DTOs created for the JPA entity.
    */
   public DTOCollection from(Project project, JavaClass<?> entity, String dtoPackage)
   {
      DTOCollection dtoCollection = new DTOCollection();
      if (entity == null)
      {
         throw new IllegalArgumentException("The argument entity was null.");
      }
      generatedDTOGraphForEntity(project, entity, dtoPackage, true, false, dtoCollection);
View Full Code Here

Examples of org.jboss.forge.addon.javaee.rest.generator.dto.DTOCollection

      String idClause = ResourceGeneratorUtil.getIdClause(entity, entityTable);
      String orderClause = ResourceGeneratorUtil.getOrderClause(entity,
               ResourceGeneratorUtil.getJpqlEntityVariable(entityTable));
      String resourcePath = ResourceGeneratorUtil.getResourcePath(context);

      DTOCollection createdDtos = from(project, entity, context.getTargetPackageName() + ".dto");
      JavaClass rootDto = createdDtos.getDTOFor(entity, true);

      Map<Object, Object> map = new HashMap<Object, Object>();
      map.put("entity", entity);
      map.put("dto", rootDto);
      map.put("idType", idType);
      map.put("getIdStatement", idGetterName);
      map.put("contentType", contentType);
      map.put("persistenceUnitName", persistenceUnitName);
      map.put("entityTable", entityTable);
      map.put("selectExpression", selectExpression);
      map.put("idClause", idClause);
      map.put("orderClause", orderClause);
      map.put("resourcePath", resourcePath);

      Resource<URL> templateResource = resourceFactory.create(getClass().getResource("EndpointWithDTO.jv"));
      TemplateProcessor processor = processorFactory.fromTemplate(templateResource);
      String output = processor.process(map);
      JavaClass resource = JavaParser.parse(JavaClass.class, output);
      resource.addImport(rootDto.getQualifiedName());
      resource.addImport(entity.getQualifiedName());
      resource.setPackage(context.getTargetPackageName());
      result.add(resource);
      result.addAll(createdDtos.allResources());

      return result;
   }
View Full Code Here

Examples of org.jboss.forge.addon.javaee.rest.generator.dto.DTOCollection

    * @param dtoPackage The Java package in which the DTOs are to be created
    * @return The {@link DTOCollection} containing the DTOs created for the JPA entity.
    */
   public DTOCollection from(Project project, JavaClass entity, String dtoPackage)
   {
      DTOCollection dtoCollection = new DTOCollection();
      if (entity == null)
      {
         throw new IllegalArgumentException("The argument entity was null.");
      }
      generatedDTOGraphForEntity(project, entity, dtoPackage, true, false, dtoCollection);
View Full Code Here

Examples of org.jboss.forge.addon.javaee.rest.generator.dto.DTOCollection

      String idClause = ResourceGeneratorUtil.getIdClause(entity, entityTable);
      String orderClause = ResourceGeneratorUtil.getOrderClause(entity,
               ResourceGeneratorUtil.getJpqlEntityVariable(entityTable));
      String resourcePath = ResourceGeneratorUtil.getResourcePath(context);

      DTOCollection createdDtos = from(project, entity, context.getTargetPackageName() + ".dto");
      JavaClass rootDto = createdDtos.getDTOFor(entity, true);

      Map<Object, Object> map = new HashMap<>();
      map.put("entity", entity);
      map.put("dto", rootDto);
      map.put("idType", idType);
      map.put("getIdStatement", idGetterName);
      map.put("contentType", contentType);
      map.put("persistenceUnitName", persistenceUnitName);
      map.put("entityTable", entityTable);
      map.put("selectExpression", selectExpression);
      map.put("idClause", idClause);
      map.put("orderClause", orderClause);
      map.put("resourcePath", resourcePath);

      Resource<URL> templateResource = resourceFactory.create(getClass().getResource("EndpointWithDTO.jv"));
      TemplateProcessor processor = processorFactory.fromTemplate(templateResource);
      String output = processor.process(map);
      JavaClass resource = JavaParser.parse(JavaClass.class, output);
      resource.addImport(rootDto.getQualifiedName());
      resource.addImport(entity.getQualifiedName());
      resource.setPackage(context.getTargetPackageName());
      result.add(resource);
      result.addAll(createdDtos.allResources());

      return result;
   }
View Full Code Here

Examples of org.jboss.forge.addon.javaee.rest.generator.dto.DTOCollection

    * @param dtoPackage The Java package in which the DTOs are to be created
    * @return The {@link DTOCollection} containing the DTOs created for the JPA entity.
    */
   public DTOCollection from(Project project, JavaClass entity, String dtoPackage)
   {
      DTOCollection dtoCollection = new DTOCollection();
      if (entity == null)
      {
         throw new IllegalArgumentException("The argument entity was null.");
      }
      generatedDTOGraphForEntity(project, entity, dtoPackage, true, false, dtoCollection);
View Full Code Here

Examples of org.jboss.forge.addon.javaee.rest.generator.dto.DTOCollection

      String idClause = ResourceGeneratorUtil.getIdClause(entity, entityTable);
      String orderClause = ResourceGeneratorUtil.getOrderClause(entity,
               ResourceGeneratorUtil.getJpqlEntityVariable(entityTable));
      String resourcePath = ResourceGeneratorUtil.getResourcePath(context);

      DTOCollection createdDtos = from(project, entity, context.getTargetPackageName() + ".dto");
      JavaClassSource rootDto = createdDtos.getDTOFor(entity, true);

      Map<Object, Object> map = new HashMap<>();
      map.put("entity", entity);
      map.put("dto", rootDto);
      map.put("idType", idType);
      map.put("getIdStatement", idGetterName);
      map.put("contentType", contentType);
      map.put("persistenceUnitName", persistenceUnitName);
      map.put("entityTable", entityTable);
      map.put("selectExpression", selectExpression);
      map.put("idClause", idClause);
      map.put("orderClause", orderClause);
      map.put("resourcePath", resourcePath);

      Resource<URL> templateResource = resourceFactory.create(getClass().getResource("EndpointWithDTO.jv"));
      Template processor = templateFactory.create(templateResource, FreemarkerTemplate.class);
      String output = processor.process(map);
      JavaClassSource resource = Roaster.parse(JavaClassSource.class, output);
      resource.addImport(rootDto.getQualifiedName());
      resource.addImport(entity.getQualifiedName());
      resource.setPackage(context.getTargetPackageName());
      result.add(resource);
      result.addAll(createdDtos.allResources());

      return result;
   }
View Full Code Here

Examples of org.jboss.forge.addon.javaee.rest.generator.dto.DTOCollection

    * @param dtoPackage The Java package in which the DTOs are to be created
    * @return The {@link DTOCollection} containing the DTOs created for the JPA entity.
    */
   public DTOCollection from(Project project, JavaClass<?> entity, String dtoPackage)
   {
      DTOCollection dtoCollection = new DTOCollection();
      if (entity == null)
      {
         throw new IllegalArgumentException("The argument entity was null.");
      }
      generatedDTOGraphForEntity(project, entity, dtoPackage, true, false, dtoCollection);
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.