Projects which are expected to use this start-code are projects that require all, or most of the following technologies:
- JPA and REST
- Testing, including database test
- Testing, including tests of REST-API's
- CI and CONTINUOUS DELIVERY
In order to use this code, you should have a local developer setup + a "matching" droplet on Digital Ocean as described in the 3. semester guidelines
This document explains how to use this code (build, test and deploy), locally with maven, and remotely with maven controlled by Github actions
- Passwords are encrypted using Bcrypt
- catRousource enpoint /api/cat/facts and /api/cat/cats
- DemoResource contains user authentication for 'User' and 'Admin' roles /api/info/user and /api/info/admin
- open view->too windows->persistence
- open the Database tab and create a new data source (remember to point to a database event though this is already written in the persistence unit. This is necessary in order to use the JPQL console)
- in the persistence window right click the pu or an entity and choose "console"
- write a jpql query in the console and execute it.
- From inside the Persistence window:
- Right-click a persistence unit, point to Generate Persistence Mapping and select By Database Schema.
- Select the
- data source
- package
- tick tables to include
- open tables to see columns and add the ones with mapped type: Collection and SomeEntity
- click OK.
- Right click project name -> new -> persistence -> Entity classes From Database -> choose database connection from list -> add the tables you need -> Finish