Java API, JPA and Hibernate Part 2 Workshop - Core Criteria (0.2.3)

Download OpenAPI specification:Download

Core Criteria for Java API, JPA and Hibernate Part 2 Workshop

employees

Create a new employee

Create a new employee

Request Body schema: application/json
first_name
required
string
last_name
required
string
department_id
required
integer

Responses

Request samples

Content type
application/json
{
  • "first_name": "Ada",
  • "last_name": "Lovelace",
  • "department_id": 1
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "first_name": "Ada",
  • "last_name": "lovelace",
  • "department_id": 1
}

Get Employees

Get all employees

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get an employee

Get a single employee by their id

path Parameters
id
required
integer

The ID of the employee to retrieve

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "first_name": "Ada",
  • "last_name": "lovelace",
  • "department_id": 1
}

Update Employee

Update the employee specified by the ID

path Parameters
id
required
integer

The ID of the employee to update

Request Body schema: application/json
first_name
required
string
last_name
required
string
department_id
required
integer

Responses

Request samples

Content type
application/json
{
  • "first_name": "Ada",
  • "last_name": "Lovelace",
  • "department_id": 1
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "first_name": "Ada",
  • "last_name": "lovelace",
  • "department_id": 1
}

Delete Employee

Delete the specified employee

path Parameters
id
required
integer

The ID of the employee to delete

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "first_name": "Ada",
  • "last_name": "lovelace",
  • "department_id": 1
}

departments

Create a department

Create a new department

Request Body schema: application/json
name
required
string
location
required
string

Responses

Request samples

Content type
application/json
{
  • "name": "Accounts",
  • "location": "Amsterdam"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Accounts",
  • "location": "Amsterdam"
}

Get Department

Get all departments

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get a department

Get a single department by their id

path Parameters
id
required
integer

The ID of the department to retrieve

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Accounts",
  • "location": "Amsterdam"
}

Update Department

Update the department specified by the ID

path Parameters
id
required
integer

The ID of the department to update

Request Body schema: application/json
name
required
string
location
required
string

Responses

Request samples

Content type
application/json
{
  • "name": "Accounts",
  • "location": "Amsterdam"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Accounts",
  • "location": "Amsterdam"
}

Delete Department

Delete the specified department

path Parameters
id
required
integer

The ID of the department to delete

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Accounts",
  • "location": "Amsterdam"
}