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

Download OpenAPI specification:Download

Core Criteria for Java API, JPA and Hibernate Part 2

authors

Create author

Create a new Author

Request Body schema: application/json
first_name
required
string
last_name
required
string
email
required
string
alive
required
boolean

Responses

Request samples

Content type
application/json
{
  • "first_name": "Isaac",
  • "last_name": "Asimov",
  • "email": "isaac@monlith.com",
  • "alive": false
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "first_name": "Isaac",
  • "last_name": "Asimov",
  • "email": "isaac@monlith.com",
  • "alive": false
}

Get Authors

Get all of the authors in the list

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get an author

Get a specific author by their id

path Parameters
id
required
integer

The ID of the author to retrieve

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "first_name": "Isaac",
  • "last_name": "Asimov",
  • "email": "isaac@monlith.com",
  • "alive": false
}

Update an author

Update the specified author

path Parameters
id
required
integer

The ID of the author to update

Request Body schema: application/json
first_name
required
string
last_name
required
string
email
required
string
alive
required
boolean

Responses

Request samples

Content type
application/json
{
  • "first_name": "Isaac",
  • "last_name": "Asimov",
  • "email": "isaac@monlith.com",
  • "alive": false
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "first_name": "Isaac",
  • "last_name": "Asimov",
  • "email": "isaac@monlith.com",
  • "alive": false
}

Delete an author

Delete the specified author

path Parameters
id
required
integer

The ID of the author to delete

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "first_name": "Isaac",
  • "last_name": "Asimov",
  • "email": "isaac@monlith.com",
  • "alive": false
}

publishers

Create publisher

Create a new Publisher

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

Responses

Request samples

Content type
application/json
{
  • "name": "Penguin",
  • "location": "London"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Penguin",
  • "location": "London"
}

Get Publishers

Get all of the publishers in the list

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get a Publisher

Get a specific publisher by their id

path Parameters
id
required
integer

The ID of the publisher to retrieve

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Penguin",
  • "location": "London"
}

Update a publisher

Update the specified publisher

path Parameters
id
required
integer

The ID of the publisher to update

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

Responses

Request samples

Content type
application/json
{
  • "name": "Penguin",
  • "location": "London"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Penguin",
  • "location": "London"
}

Delete a publisher

Delete the specified publisher

path Parameters
id
required
integer

The ID of the publisher to delete

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Penguin",
  • "location": "London"
}

books

Create book

Create a new Book

Request Body schema: application/json
title
required
string
genre
required
string
author_id
required
integer
publisher_id
required
integer

Responses

Request samples

Content type
application/json
{
  • "title": "2001: A Space Odyssey",
  • "genre": "Science Fiction",
  • "author_id": 1,
  • "publisher_id": 1
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "title": "2001: A Space Odyssey",
  • "genre": "Science Fiction",
  • "author_id": 1,
  • "publisher_id": 1
}

Get Books

Get all of the books in the list

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get a Book

Get a specific book by its id

path Parameters
id
required
integer

The ID of the book to retrieve

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "title": "2001: A Space Odyssey",
  • "genre": "Science Fiction",
  • "author_id": 1,
  • "publisher_id": 1
}

Update a book

Update the specified book

path Parameters
id
required
integer

The ID of the book to update

Request Body schema: application/json
title
required
string
genre
required
string
author_id
required
integer
publisher_id
required
integer

Responses

Request samples

Content type
application/json
{
  • "title": "2001: A Space Odyssey",
  • "genre": "Science Fiction",
  • "author_id": 1,
  • "publisher_id": 1
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "title": "2001: A Space Odyssey",
  • "genre": "Science Fiction",
  • "author_id": 1,
  • "publisher_id": 1
}

Delete a book

Delete the specified book

path Parameters
id
required
integer

The ID of the book to delete

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "title": "2001: A Space Odyssey",
  • "genre": "Science Fiction",
  • "author_id": 1,
  • "publisher_id": 1
}