Hi,
I've developped an application with Play Framework successfully (and
thank you for this great tool!).
I'm trying now to develop a batch program (i.e. a simple class with a
main method), in which I would like to use the Play persistence stack.
I've created a simple class in my project with a main method as
follow :
public static void main(String[] args) {
File root = new File(System.getProperty("application.path"));
Play.init(root, System.getProperty("
play.id", ""));
System.out.println("users = " + User.count());
}
When I launch this class, I got the following error :
Please annotate your JPA model with @javax.persistence.Entity
annotation.
Of course my User class is correctly annotated ;)
I've checked out Play source code. Play.init() lauches
DBPlugin.onApplicationStart(), which do all the db setup stuff.
Do I miss something?
Thanks in advance.
PS : I know about Play jobs, but my problem is that this kind of batch
program should run out of a web application.