This is a minimum sample project to demonstrate what is explained in the corresponding blog post on the innoQ site.
Compared to what is described in the blog post it adds some details and other things that are useful for demonstrating, but not relevant to the message from the post, e.g. this sample uses a h2 database instead of an Oracle one (for obvious reasons) and adds some minor sample data.
You should be able to run the sample out of the box by running
activator run
from the command line. This should start a server listening on localhost:9000
.
This project has SBT Groll included, meaning you can step through the steps. For this to work you need to be inside the activator shell, so you must first run
activator
on the shell and enter it.
From there you can enter groll show
, groll next
or groll prev
(for a full list see Groll Arguments) to navigate through the steps.
Create a new project with
activator new
choosing option (5
), a play-java
project and choose whatever name you want the project to have.
Added a MyBatis Module and the configuration for it. Also included a database file (H2 not Oracle) and the necessary configuration for it.
Added the MyBatis mapper and XML configuration to the project. Used the layout provided by inoio and AlexKlibisz.
Also changed the routing to provide data from the database instead of the welcome page.
Moved app/service/UserMapper.xml
to conf/service/UserMapper.xml
and removed the now superfluous entries from the build.sbt
file.