Package org.jboss.forge.project.facets

Examples of org.jboss.forge.project.facets.JavaSourceFacet.saveJavaSource()


      field.setName(fieldName).setPrivate().setType(fieldEntity.getName()).addAnnotation(annotation);
      targetEntity.addImport(fieldEntity.getQualifiedName());
      Refactory.createGetterAndSetter(targetEntity, field);
      updateToString(targetEntity);

      java.saveJavaSource(targetEntity);
      shell.println("Added field to " + targetEntity.getQualifiedName() + ": " + field);

      return field;
   }
View Full Code Here


      field.setName(fieldName).setPrivate().setType(Types.toSimpleName(fieldType)).addAnnotation(annotation);
      targetEntity.addImport(fieldType);
      Refactory.createGetterAndSetter(targetEntity, field);

      updateToString(targetEntity);
      java.saveJavaSource(targetEntity);
      shell.println("Added field to " + targetEntity.getQualifiedName() + ": " + field);

      return field;
   }
View Full Code Here

      {
         targetEntity.addImport(fieldType);
      }
      Refactory.createGetterAndSetter(targetEntity, field);
      updateToString(targetEntity);
      java.saveJavaSource(targetEntity);
      shell.println("Added field to " + targetEntity.getQualifiedName() + ": " + field);

      return field;
   }
View Full Code Here

      {
         targetEntity.addImport(fieldType);
      }
      Refactory.createGetterAndSetter(targetEntity, field);
      updateToString(targetEntity);
      java.saveJavaSource(targetEntity);
      shell.println("Added field to " + targetEntity.getQualifiedName() + ": " + field);

      return field;
   }
View Full Code Here

      Refactory.createGetterAndSetter(javaClass, id);
      Refactory.createGetterAndSetter(javaClass, version);
      Refactory.createToStringFromFields(javaClass, id);
      Refactory.createHashCodeAndEquals(javaClass);

      JavaResource javaFileLocation = java.saveJavaSource(javaClass);

      shell.println("Created @Entity [" + javaClass.getQualifiedName() + "]");

      /**
       * Pick up the generated resource.
View Full Code Here

         Annotation<JavaClass> annotation = localField.getAnnotation(OneToOne.class);
         if ((inverseFieldName != null) && !inverseFieldName.isEmpty())
         {
            Field<JavaClass> inverseField = addFieldTo(fieldEntityClass, entityClass, inverseFieldName, OneToOne.class);
            inverseField.getAnnotation(OneToOne.class).setStringValue("mappedBy", localField.getName());
            java.saveJavaSource(fieldEntityClass);
         }
        
         if (fetchType != null)
         {
            annotation.setEnumValue("fetch", fetchType);
View Full Code Here

         }
         if(cascadeTypes !=null && cascadeTypes.length > 0)
         {
            annotation.setEnumArrayValue("cascade", cascadeTypes);
         }
         java.saveJavaSource(entityClass);
      }
      catch (FileNotFoundException e)
      {
         shell.println("Could not locate the @Entity requested. No update was made.");
      }
View Full Code Here

                     + inverseFieldName
                     + "= new HashSet<" + entity.getName() + ">();");
            otherField.addAnnotation(ManyToMany.class);
            Refactory.createGetterAndSetter(otherEntity, otherField);

            java.saveJavaSource(otherEntity);
         }
        
         if (fetchType != null)
         {
            annotation.setEnumValue("fetch", fetchType);
View Full Code Here

         }
         if(cascadeTypes !=null && cascadeTypes.length > 0)
         {
            annotation.setEnumArrayValue("cascade", cascadeTypes);
         }
         java.saveJavaSource(entity);
      }
      catch (FileNotFoundException e)
      {
         shell.println("Could not locate the @Entity requested. No update was made.");
      }
View Full Code Here

               many.addImport(one);
            }
            Field<JavaClass> manyField = many.addField("private " + one.getName() + " " + inverseFieldName + ";");
            manyField.addAnnotation(ManyToOne.class);
            Refactory.createGetterAndSetter(many, manyField);
            java.saveJavaSource(many);
         }
        
         if (fetchType != null)
         {
            annotation.setEnumValue("fetch", fetchType);
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.