Package org.jboss.forge.parser.java

Examples of org.jboss.forge.parser.java.JavaClass.addImport()


         if (!Strings.isNullOrEmpty(inverseFieldName))
         {
            annotation.setStringValue("mappedBy", inverseFieldName);

            otherEntity.addImport(Set.class);
            otherEntity.addImport(HashSet.class);
            if (!otherEntity.getCanonicalName().equals(entity.getCanonicalName()))
            {
               otherEntity.addImport(entity.getQualifiedName());
            }
View Full Code Here


      map.put("orderClause", orderClause);
      map.put("resourcePath", resourcePath);

      String output = processor.processTemplate(map, "org/jboss/forge/rest/Endpoint.jv");
      JavaClass resource = JavaParser.parse(JavaClass.class, output);
      resource.addImport(entity.getQualifiedName());
      resource.setPackage(utility.getPackageName());
      return resource;
   }

}
View Full Code Here

         if (!Strings.isNullOrEmpty(inverseFieldName))
         {
            annotation.setStringValue("mappedBy", inverseFieldName);

            otherEntity.addImport(Set.class);
            otherEntity.addImport(HashSet.class);
            if (!otherEntity.getCanonicalName().equals(entity.getCanonicalName()))
            {
               otherEntity.addImport(entity.getQualifiedName());
            }
View Full Code Here

         if (!Strings.isNullOrEmpty(inverseFieldName))
         {
            annotation.setStringValue("mappedBy", inverseFieldName);

            otherEntity.addImport(Set.class);
            otherEntity.addImport(HashSet.class);
            if (!otherEntity.getCanonicalName().equals(entity.getCanonicalName()))
            {
               otherEntity.addImport(entity.getQualifiedName());
            }
            Field<JavaClass> otherField = otherEntity.addField("private Set<" + entity.getName() + "> "
View Full Code Here

            otherEntity.addImport(Set.class);
            otherEntity.addImport(HashSet.class);
            if (!otherEntity.getCanonicalName().equals(entity.getCanonicalName()))
            {
               otherEntity.addImport(entity.getQualifiedName());
            }
            Field<JavaClass> otherField = otherEntity.addField("private Set<" + entity.getName() + "> "
                     + inverseFieldName
                     + "= new HashSet<" + entity.getName() + ">();");
            otherField.addAnnotation(ManyToMany.class);
View Full Code Here

            annotation.setLiteralValue("cascade", "CascadeType.ALL");
            annotation.getOrigin().addImport(CascadeType.class);
            annotation.setLiteralValue("orphanRemoval", "true");
            if (!many.getCanonicalName().equals(one.getCanonicalName()))
            {
               many.addImport(one);
            }
            Field<JavaClass> manyField = many.addField("private " + one.getName() + " " + inverseFieldName + ";");
            manyField.addAnnotation(ManyToOne.class);
            Refactory.createGetterAndSetter(many, manyField);
            java.saveJavaSource(many);
View Full Code Here

         Annotation<JavaClass> manyAnnotation = manyField.addAnnotation(ManyToOne.class);
         Refactory.createGetterAndSetter(many, manyField);

         if (!Strings.isNullOrEmpty(inverseFieldName))
         {
            one.addImport(Set.class);
            one.addImport(HashSet.class);
            if (!one.getCanonicalName().equals(many.getCanonicalName()))
            {
               one.addImport(many.getQualifiedName());
            }
View Full Code Here

         Refactory.createGetterAndSetter(many, manyField);

         if (!Strings.isNullOrEmpty(inverseFieldName))
         {
            one.addImport(Set.class);
            one.addImport(HashSet.class);
            if (!one.getCanonicalName().equals(many.getCanonicalName()))
            {
               one.addImport(many.getQualifiedName());
            }
            Field<JavaClass> oneField = one.addField("private Set<" + many.getName() + "> " + inverseFieldName
View Full Code Here

         {
            one.addImport(Set.class);
            one.addImport(HashSet.class);
            if (!one.getCanonicalName().equals(many.getCanonicalName()))
            {
               one.addImport(many.getQualifiedName());
            }
            Field<JavaClass> oneField = one.addField("private Set<" + many.getName() + "> " + inverseFieldName
                     + "= new HashSet<"
                     + many.getName() + ">();");
            Annotation<JavaClass> oneAnnotation = oneField.addAnnotation(OneToMany.class).setStringValue("mappedBy",
View Full Code Here

         String entityTable = getEntityTable(entity);
         map.put("entityTable", entityTable);
         map.put("resourcePath", entityTable.toLowerCase() + "s");

         JavaClass resource = JavaParser.parse(JavaClass.class, template.render(map));
         resource.addImport(entity.getQualifiedName());
         resource.setPackage(java.getBasePackage() + ".rest");

         /*
          * Save the sources
          */
 
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.