简体   繁体   中英

What is the right way to operate on a newly created MySQL DB within Java Play Framework (2.5.x)?

I have already created the DB which has no tables so far & have successfully connected it with Play. But what is the right way to create the tables from within Play? I was going to proceed with Evolutions script but their documentation mentions that evolutions is to be used while updating the DB.

In Django I have seen people defining their tables in a models file. Is there any similar mechanism in Play. If so, how?

Does JPA have anything to do with all this? Again, I have read their documentation on this. It explains it in connection with Hibernate. Is an ORM layer absolutely necessary? Help me out here!

So a user answered this question and then removed it. Nevertheless he suggested to use Ebean which manages the database through evolutions.

The github link posted was: https://github.com/playframework/play-ebean-example

It cleared up a few things and if someone faces the same problem, I hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM