All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jarbframework.sample.PostPopulator Maven / Gradle / Ivy

There is a newer version: 2.4.3
Show newest version
package org.jarbframework.sample;

import org.jarbframework.populator.DatabasePopulator;
import org.springframework.beans.factory.annotation.Autowired;

public class PostPopulator implements DatabasePopulator {

    @Autowired
    private PostRepository postRepository;

    @Override
    public void populate() {
        Post post = new Post();
        post.setAuthor("[email protected]");
        post.setTitle("inserted via java");
        post.setMessage("some message");
        postRepository.save(post);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy