java Playframework GlobalSettings deprecation for onStart
<p>I have annoying issue with Playframwork deprecated <code>GlobalSettings</code> issue, I want to move my conde inside <code>onStart</code> to suggested way, but Actually I can't get this done, the documentation make no sense, and I have no idea how to solve this, I spent days and days trying to make it with no luck ! </p>

<p><a href="https://www.playframework.com/documentation/2.5.x/GlobalSettings" rel="nofollow">https://www.playframework.com/documentation/2.5.x/GlobalSettings</a> </p>

<p>Simply I want to run initial database method </p>

<pre><code>private void initialDB() {
        UserService userService = play.Play.application().injector().instanceOf(UserService.class);
        if (userService.findUserByEmail("email@company.com") == null) {
            String email = "email@company.com";
            String password = "1234";
            String fullName = "My Name";
            User user = new User();
            user.password = BCrypt.hashpw(password, BCrypt.gensalt());
            user.full_name = fullName;
            user.email = email;
            user.save();
        }
}
</code></pre>

<p>This was inside <code>onStart</code> method in <code>Global extends GlobalSettings</code> java file, I tried to extract it to external module but no luck.</p>

<pre><code>public class GlobalModule extends AbstractModule {

    protected void configure() {
        initialDB();
    }
}
</code></pre>

<p>I found some solutions in Scala and no idea how this can be in java, but I have no time to learn it, beside that I don't like it too.</p>