September 2018
Intermediate to advanced
398 pages
9h 43m
English
Before discussing Futures, we were writing tests to check Cart and the Product behavior. But, as the classes were not defined, the code was not even compiling. Let's start to create the database and then implement the DAO.
We can use Evolution to automatically create the database each time the server starts for the first time.
To do so, we need to add a script named 1.sql in conf/evolutions/default/, where default is the database name used in the configuration file. This file is an SQL file, with a couple of tags to handle the creation and destruction of the database upon application start and stop, respectively.
We will start with the creation of the product table; the script is as follows:
# --- !Ups CREATE TABLE IF NOT ...
Read now
Unlock full access