- Setup Postgres Database driver:
- Get the correct JDBC driver JAR for your PostgreSQL version from https://jdbc.postgresql.org/.
- Copy
resources/postgresql-*.*.****.jar
inside[GlassFish directory]/glassfish/domains/[domain dir]/lib/
- Setup of Postgres Database:
- Run
[PostGres directory]/pgAdmin4/bin/pgAdmin4.exe
(default password:admin
). - Add new login role (you have to use a password as GlassFish JDBC Resources will require one) [Name:
tester
, Password:tester
, Privileges:can_login: true
]
- Run
- Add new database with [Name:
BeverageStore
, Owner:tester
] - In the file
persistence.xml
all file tables and columns from entities are created automatically using<property name="eclipselink.ddl-generation" value="create-tables"/>
, thus no additional sql script is necessary.
- Check the settings in
gradle.properties
, especially the path to the glassfish folder - In the projects root folder:
- Run target
gradlew startGlassfish
- Run target
gradlew initServer
- Run target
gradlew build
- Run target
gradlew deploy
- Run target
- For subsequent builds, the Server does not have to be initialized again!
Please see manual glassfish configuration if there are problems with one of the before mentioned gradle tasks (startGlassfish
, initServer
, deploy
).
The front end with links to all pages is at: http://localhost:8080/frontend/, from this webpage all different tasks can be reached.
- In the Beverage Management Window, an error icon is shown if the quantity is zero. Because the beverage still exists in the database, new quantities can be added by increasing it in the edit page, no "new" beverage has to get created.
NamedQueries
are used used inorm.xml
- Validation tasks happen both in the frontend (using
required
as well asmax
andmin
for numbers) and in the backend, where an Error is thrown and gets Logged in the corresponding Servlet.