0% found this document useful (0 votes)
7 views4 pages

Git and Maven Exercises for Java Development

The document outlines a series of exercises focused on Git, Maven, and Spring Boot applications, including tasks such as initializing a Git repository, creating and managing Maven projects in Eclipse, and developing applications using Hibernate for patient and appointment management. It includes specific instructions for creating, modifying, and querying databases, as well as handling dependencies and resolving merge conflicts. The final tasks involve implementing various database operations using HQL and submitting the completed project to GitHub.

Uploaded by

mvavinash2007
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views4 pages

Git and Maven Exercises for Java Development

The document outlines a series of exercises focused on Git, Maven, and Spring Boot applications, including tasks such as initializing a Git repository, creating and managing Maven projects in Eclipse, and developing applications using Hibernate for patient and appointment management. It includes specific instructions for creating, modifying, and querying databases, as well as handling dependencies and resolving merge conflicts. The final tasks involve implementing various database operations using HQL and submitting the completed project to GitHub.

Uploaded by

mvavinash2007
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

CO1-Self Practice/Assignment Questions

Exercise 1: Git Initialization and Basic Operations


Create a new folder and initialize it as a Git repository. Add a new file, commit it, connect
your local repository to a newly created GitHub repository, and push the changes. Then make
a small edit and pull updates to verify the remote connection.

Exercise 2: Branching, Pull, and Merge Workflow


Clone an existing repository, create a new feature branch, make changes and commit them.
Make a conflicting change on the main branch, then merge the feature branch into main,
resolve the merge conflict, and push the final merged version to GitHub.
Exercise 3: Creating and Running a Maven Project in Eclipse
Create a Maven Project in Eclipse IDE using the Quickstart archetype. Configure the project
with appropriate Group ID and Artifact ID. Write a Java program that prints “Welcome to
Maven using Eclipse IDE”.
Perform the following tasks:

Create the Maven project in Eclipse.


Identify and explain the purpose of key folders such as src/main/java, src/test/java, and
[Link].
Run the project using Maven goals and verify the output.
Modify the project to include a new class and re-run the application.

Exercise 4: Dependency Management Using Maven in Eclipse


Create a Maven project in Eclipse IDE and add an external dependency (for example, JUnit
or Apache Commons Lang) using the [Link] file.
Perform the following tasks:

Add the selected dependency in the [Link].


Update the Maven project to download the dependency.
Write a Java program that uses a class or method from the added dependency.
Demonstrate successful execution of the program and explain how Maven handles
dependency management.
Exercise 5: A hospital wants to maintain digital records of patients. Develop a Spring Boot
application using Hibernate to store patient details such as patient ID, name, age, and
diagnosis in a MySQL database.

Exercise 6: An online bookstore needs to fetch details of a specific book using its ISBN for
inventory verification. Create a Hibernate-based application in Eclipse to retrieve book
information from the database.

Exercise 7: A company’s HR department frequently updates employee roles and


designations. Implement a Spring Boot and Hibernate application that updates employee role
details based on employee ID.
A bank wants to remove inactive customer accounts from its system. Develop a Hibernate-
based Maven project in Eclipse to delete customer records from the database and ensure data
consistency.
Exercise 8 to 10:
A multi-specialty hospital aims to digitize its patient records and appointment scheduling
using a Java–Hibernate–based application. As part of this system, you are required to perform
various database operations using Hibernate Query Language (HQL).
Assume that the Hibernate project setup (configuration, session factory, mappings, and basic
CRUD operations) is already completed.
Entity Description
Use the following two entities (or equivalent entities already created in your project):
Patient
 patientId (Long / Integer) – Primary Key
 patientName (String)
 age (Integer)
 gender (String)
 disease (String)
Appointment
 appointmentId (Long / Integer) – Primary Key
 doctorName (String)
 department (String)
 appointmentDate (Date)
 consultationFee (Double)
 patient – Reference to Patient entity (Many-to-One)
Assignment Tasks
1. Entity Usage
Use the existing Patient and Appointment entities created in the previous
skill/module.
2. Data Insertion
Insert 8–10 patient records and 8–10 appointment records into the database with
warning:
o Different diseases
o Multiple hospital departments (Cardiology, Neurology, Orthopedics, etc.)
o Varying consultation fees
o Different appointment dates
3. Sorting Operations using HQL
Write HQL queries to retrieve all appointment records:
o a) Sorted by consultationFee in ascending order
o b) Sorted by consultationFee in descending order
4. Sorting by Quantity / Date
Write an HQL query to display appointments sorted by appointmentDate (latest
first).
5. Pagination using HQL
Implement pagination to display appointment records as follows:
o a) First 3 appointments
o b) Next 3 appointments
6. Aggregate Functions using HQL
Write HQL queries to:
o a) Count the total number of patients
o b) Count the total number of appointments
o c) Display the number of appointments per department
o d) Find the minimum and maximum consultation fee
7. GROUP BY Clause
Write an HQL query using GROUP BY to group appointments based on department.
8. Filtering using WHERE Clause
Write an HQL query to retrieve appointments whose consultation fee falls within a
given range (e.g., 500 to 1500).
9. Pattern Matching using LIKE Operator
Write HQL queries to find patients where the patientName:
o a) Starts with a specific letter
o b) Ends with a specific letter
o c) Contains a given substring anywhere in the name
o d) Has an exact character length (e.g., name length = 8)
10. Project Submission
o Push the complete Hibernate project to GitHub.

You might also like