Uses:
- MySQL 8.0.34
- MySQL Workbench 8.0.34
- IntelliJ IDEA 2023.3.2 (Community Edition)
- openjdk 11.0.21 2023-10-17
- mac os x aarch64
- mac os x x86_64
- Apache Maven 3.9.6
Dependencies:
- org.apache.logging.log4j/log4j-api v2.21.1
- org.apache.logging.log4j/log4j-core v2.21.1
- org.apache.commons/commons-lang3 v3.12.0
- org.apache.commons/commons-csv v1.10.0
- commons-io/commons-io v2.15.0
- org.glassfish.jaxb/jackson-core v4.04
- org.glassfish.jaxb/jackson-runtime v4.04
- com.fasterxml.jackson.core/jackson-core v.2.16.1
- com.fasterxml.jackson.core/jackson-databind v.2.16.1
- com.googlecode.libphonenumber/libphonenumber v8.13.27
- org.mybatis/mybatis v3.5.15
- com.mysql/mysql-connector-j v8.2.0
- org.jooq/jooq v3.15.12
Plugins:
- org.apache.maven.plugins:maven-compiler-plugin v3.11.0
- org.codehaus.mojo:exec-maven-plugin v3.1.0
- Rename
example.config.properties
toconfig.properties
or create your ownconfig.properties
file in thesrc/main/resources
directory. - Look below. Replace
jdbc.url
,jdbc.user
, andjdbc.password
with those respective to your environment for connecting to your MySQL server. - The
persistence.mybatis
package will be used ifdatabase.implementation=mybatis
. Ifdatabase.implementation
has any other value besidesmybatis
, then it will use thepersistence.jdbc.*JDBCImpl
package.
jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://{{domain}}:{{port}}/{{database_name}}
jdbc.user={{username}}
jdbc.password={{password}}
database.implementation=mybatis
Note: the database must be named airport
.
# 1. Drop `airport` database in case it exists. Will be dropped if it exists.
mysql -u {{username}} -p{{password}} < src/resources/sql/airport_database_drop.sql
# 2. Create `airport` database.
mysql -u {{username}} -p{{password}} < src/resources/sql/airport_database_creation.sql
# 3. Create `airport` schema.
mysql -u {{username}} -p{{password}} -D airport < src/resources/sql/airport_schema.sql
# 4. Load preset `airport` data.
mysql -u {{username}} -p{{password}} -D airport < src/resources/sql/load_base_data.sql
# Clean install dependencies
mvn clean install
# Run the `base-data-loader` profile and load all of the data
mvn exec:java -P base-data-loader
Select [1]
=== Airport Base Data Loading Tools: ===
[0] Exit
[1] Execute all 'Load' options
[2] Load Country ISO Codes and Country Names Data
[3] Load Timezones Data
[4] Load Airports Data
[5] Load Airlines Data
[6] Load Terminals Data
[7] Load Gates Data
[8] Load Bookings Data
Enter your choice:
...
# Run `clean install`
mvn clean install
# Run the primary profile to run the services
mvn exec:java
=== Airport Check-in System: ===
[0] Exit
[1] Register Passport Holder
[2] Perform Check-In
[3] Board Passengers
[4] Change Departure Gate for Flight
Enter your choice:
1
=== Register Passport Holder: ===
Enter Surname:
Doe
Enter Given Name:
John
Enter Middle Name (or type 'none' if not applicable):
none
Enter Birthdate (YYYY-MM-DD):
1990-12-12
Enter Sex (M/F):
m
Enter Passport Number:
USA312414
Enter Passport Issue Date (YYYY-MM-DD):
2023-12-12
Enter Passport Expiry Date (YYYY-MM-DD):
2033-12-12
Enter Street Address:
123 good street
Enter City:
lovelytown
Enter Postal Code
849516
Enter Country Code (e.g., US, JP):
US
Enter Phone Number (include country code, e.g., +15551234567):
+13105558888
Enter Email Address:
[email protected]
Registering passport holder info
=== Registered Person Information: ===
Name: JOHN DOE
Birthdate: 1990-12-12
Sex: M
= Passport Information =
Passport Number: USA312414
Issue Date: 2023-12-12
Expiration Date: 2033-12-12
= Address =
Street: 123 GOOD STREET
City: LOVELYTOWN
Postal Code: 849516
Country: US
= Phone Number =
Phone Number: +13105558888
= Email Address =
Email Address: [email protected]
Registration completed successfully.
=== Airport Check-in System: ===
[0] Exit
[1] Register Passport Holder
[2] Perform Check-In
[3] Board Passengers
Enter your choice:
2
Enter Airline Staff Email:
[email protected]
Enter Booking Number:
KAYAK654321
Does the passenger have baggage? Y/N
y
How much does the baggage weigh? Type in the weight (e.g., 23 or 23.00)
23.00
=== Boarding Information ===
Boarding Group: Group B
Boarding Time: 2024-12-24T10:30:00.000-0800
Flight Code: NQ456
Gate: 149
Baggage Code: NQ456-HND-KAYAK654321
Check-In completed successfully.
=== Airport Check-in System: ===
[0] Exit
[1] Register Passport Holder
[2] Perform Check-In
[3] Board Passengers
Enter your choice:
3
=== Board Passenger onto Plane ===
Enter Booking Number for Boarding:
KAYAK654321
Boarding Successful for Booking Number: KAYAK654321
Flight Code: NQ456
Status: Boarded
Boarded: Yes
Boarding completed successfully.
=== Airport Check-in System: ===
[0] Exit
[1] Register Passport Holder
[2] Perform Check-In
[3] Board Passengers
[4] Change Departure Gate for Flight
Enter your choice:
4
=== Update Departure Gate for Flight ===
Enter Flight Code:
DL123
Enter Airport Code (i.e. LAX):
LAX
Enter Gate Code (i.e. 130-159, 201A, 201B, 202-204):
210A
Flight DL123 gate updated successfully to: 210A
=== Airport Check-in System: ===
[0] Exit
[1] Register Passport Holder
[2] Perform Check-In
[3] Board Passengers
Enter your choice:
0
Exiting...
# Run the test
mvn test
- N/A
- Use your database project (this project)
- Create Google Sheet with 10 test cases. The testing target is your
service
layer. - Test cases should test all operations which your service layer performs.
- Create 10 java tests in the
test
folder of the project structure. - Create an
xml
suite file and run your tests in parallel. There should be 10 threads.
- N/A
- Use 2
xml
files to represent 2 tables which have not been used from your database and are not used their 2 java representation. - Create DOM or SAX or STAX parser for the 1st
xml
file and include this into your project logic to get and record data from the 1stxml
. - Create a
JAXB
utility for the 2ndxml
file to get and record data from xml file - For
JAXB
also usexml
schema validation - Represent 1 other table which was not used in the project and corresponding Java
class
with ajson
file - Create a utility with Jackson to read and record data from and to the
json
file by javaclass
.
- Database Schema:
- Remove redundant relationships in schema and remove or collapse tables into others where possible
- Simplify relationships between tables, thereby reducing unnecessary complexity. A closed table
relationship path should exist.
- For example, one person can have many addresses, one person can have many email addresses, phone numbers, etc.
- Resolve circular relationships. A strategy, for example, is to create another table that sets a relationship between.
- Try not to have more than two relationships per table.
- Automate same business logic but using MyBatis and provide ability to switch between implementations from properties file
- N/A
- Create new GitHub repo
- Use
maven
as build tool andlog4j2
as logger - Create project structure with
bin/
folder,dao/
folder andservice/
folder - Create connection pool
- Create
Main
class where you will use only service layer to perform core logic of application - DAO layer should work only with DB
- Service layer should have more business logic, all assertions and more difficult actions not related to database requests should be there
- N/A
- Create 1 sql script file which should contain full data base creation based on schema(manually)
This file for your data base additionally should include:
- 10 statements for insertion. (
INSERT INTO
) - 10 statements for updating. (
UPDATE
) - 10 statements for deletions. (
DELETE
) - 5
ALTER TABLE
. - 1 big statement to join all tables in the database.
- 5 statements with
LEFT JOIN
,RIGHT JOIN
,INNER JOIN
, outer joins. - 7 statements with aggregate functions and
GROUP BY
and withoutHAVING
. - 7 statements with aggregate functions and
GROUP BY
and withHAVING
.
- 10 statements for insertion. (
- N/A
- Install MySQL Workbench
- Using assigned topic create schema with 15 tables with all types of relations used
- save
.mwb
file of schema and upload it as result of your homework on this assignment - Topics: ... Dana Tolman - Airport (simulate process of traveling from one country to another) ...