Sha256: 5d3100cf80985323c5e1cec04f53dfecf19df6158aaaf9c554556edebd7a2384

Contents?: true

Size: 675 Bytes

Versions: 4

Compression:

Stored size: 675 Bytes

Contents

package <%=@package%>.integration.<%=@model_name.downcase%>;

<%=@licence%>

import <%=@package%>.model.<%=@model_name%>;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.stereotype.Component;



@Component
public class <%=@model_name%>SampleData {

  @Autowired
  MongoOperations mongoOperations;

  public void seed() {

    for (int i = 0; i < 10; i++) {
      <%=@model_name%> b = new <%=@model_name%>();
      b.setId(String.valueOf(i));
      mongoOperations.save(b);
    }
  }

  public void destroy() {
    mongoOperations.dropCollection("<%=@model_name%>");
  }
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
spring-gen-0.2.3 lib/templates/src/test/java/integration/mongodb/SampleData.java.erb
spring-gen-0.2.2 lib/templates/src/test/java/integration/mongodb/SampleData.java.erb
spring-gen-0.2.1 lib/templates/resource/test/integration/mongodb/SampleData.java.erb
spring-gen-0.2.0 lib/templates/resource/test/integration/mongodb/SampleData.java.erb