/** * Creates EntityManager field. * * @return {@link FieldMetadataBuilder} for building field into ITD. */ private FieldMetadataBuilder getEntityManagerField() { // Create field FieldMetadataBuilder entityManagerField = new FieldMetadataBuilder(getId(), Modifier.PRIVATE, new ArrayList<AnnotationMetadataBuilder>(), new JavaSymbolName(ENTITY_MANAGER_VAR), JpaJavaType.ENTITY_MANAGER); CommentStructure comment = new CommentStructure(); comment.addComment(new JavadocComment("EntityManager to persist the entities."), CommentLocation.BEGINNING); entityManagerField.setCommentStructure(comment); return entityManagerField; }
/** * Creates size field. * * @return {@link FieldMetadataBuilder} for building field into ITD. */ private FieldMetadata getSizeField() { // Create field FieldMetadataBuilder sizeField = new FieldMetadataBuilder(getId(), Modifier.PRIVATE, new ArrayList<AnnotationMetadataBuilder>(), new JavaSymbolName(SIZE_VAR), JavaType.INT_PRIMITIVE); CommentStructure comment = new CommentStructure(); comment.addComment(new JavadocComment("Number of elements to create and persist."), CommentLocation.BEGINNING); sizeField.setCommentStructure(comment); return sizeField.build(); }
/** * Creates an EntityFactory field related to this entity. * * @return {@link FieldMetadataBuilder} for building field into ITD. */ private FieldMetadataBuilder getEntityFactoryField() { // Create field FieldMetadataBuilder entityFactoryField = new FieldMetadataBuilder(getId(), Modifier.PRIVATE, new ArrayList<AnnotationMetadataBuilder>(), new JavaSymbolName(FACTORY_VAR), this.entityFactoryMetadata.getGovernorType()); entityFactoryField.setFieldInitializer(String.format("new %s()", getNameOfJavaType(this.entityFactoryMetadata.getGovernorType()))); CommentStructure comment = new CommentStructure(); comment.addComment(new JavadocComment("Factory to create entity instances."), CommentLocation.BEGINNING); entityFactoryField.setCommentStructure(comment); return entityFactoryField; }
comment .addComment(new JavadocComment("List of created entities."), CommentLocation.BEGINNING); fieldBuilder.setCommentStructure(comment); return fieldBuilder;
comment.addComment(new JavadocComment("Random generator for the entities index."), CommentLocation.BEGINNING); fieldBuilder.setCommentStructure(comment);
/** * Creates EntityManager field. * * @return {@link FieldMetadataBuilder} for building field into ITD. */ private FieldMetadataBuilder getEntityManagerField() { // Create field FieldMetadataBuilder entityManagerField = new FieldMetadataBuilder(getId(), Modifier.PRIVATE, new ArrayList<AnnotationMetadataBuilder>(), new JavaSymbolName(ENTITY_MANAGER_VAR), JpaJavaType.ENTITY_MANAGER); CommentStructure comment = new CommentStructure(); comment.addComment(new JavadocComment("EntityManager to persist the entities."), CommentLocation.BEGINNING); entityManagerField.setCommentStructure(comment); return entityManagerField; }
/** * Creates size field. * * @return {@link FieldMetadataBuilder} for building field into ITD. */ private FieldMetadata getSizeField() { // Create field FieldMetadataBuilder sizeField = new FieldMetadataBuilder(getId(), Modifier.PRIVATE, new ArrayList<AnnotationMetadataBuilder>(), new JavaSymbolName(SIZE_VAR), JavaType.INT_PRIMITIVE); CommentStructure comment = new CommentStructure(); comment.addComment(new JavadocComment("Number of elements to create and persist."), CommentLocation.BEGINNING); sizeField.setCommentStructure(comment); return sizeField.build(); }
/** * Creates an EntityFactory field related to this entity. * * @return {@link FieldMetadataBuilder} for building field into ITD. */ private FieldMetadataBuilder getEntityFactoryField() { // Create field FieldMetadataBuilder entityFactoryField = new FieldMetadataBuilder(getId(), Modifier.PRIVATE, new ArrayList<AnnotationMetadataBuilder>(), new JavaSymbolName(FACTORY_VAR), this.entityFactoryMetadata.getGovernorType()); entityFactoryField.setFieldInitializer(String.format("new %s()", getNameOfJavaType(this.entityFactoryMetadata.getGovernorType()))); CommentStructure comment = new CommentStructure(); comment.addComment(new JavadocComment("Factory to create entity instances."), CommentLocation.BEGINNING); entityFactoryField.setCommentStructure(comment); return entityFactoryField; }
comment .addComment(new JavadocComment("List of created entities."), CommentLocation.BEGINNING); fieldBuilder.setCommentStructure(comment); return fieldBuilder;
comment.addComment(new JavadocComment("Random generator for the entities index."), CommentLocation.BEGINNING); fieldBuilder.setCommentStructure(comment);