|
SpringBootLibrary
|
A JPA entity representing a borrowing record. More...
Public Member Functions | |
| Borrowing () | |
| Default constructor. | |
| Borrowing (User user, Book book) | |
| Constructor to create a new borrowing record. | |
| Long | getId () |
| Gets the unique identifier of the borrowing record. | |
| User | getUser () |
| Gets the user associated with this borrowing. | |
| Book | getBook () |
| Gets the book associated with this borrowing. | |
| LocalDateTime | getBorrowDate () |
| Gets the date and time when the book was borrowed. | |
| LocalDateTime | getReturnDate () |
| Gets the date and time when the book was returned. | |
| void | setReturnDate (LocalDateTime returnDate) |
| Sets the date and time when the book was returned. | |
A JPA entity representing a borrowing record.
This entity manages information regarding the borrowing and returning of a Book by a User.
Definition at line 31 of file Borrowing.java.
| com.example.restapi.model.Borrowing.Borrowing | ( | ) |
Default constructor.
Required by JPA for entity instantiation.
Definition at line 77 of file Borrowing.java.
Constructor to create a new borrowing record.
| user | the user borrowing the book |
| book | the book being borrowed |
The borrow date is initialized to the current time, and the return date is set to null.
Definition at line 88 of file Borrowing.java.
| Book com.example.restapi.model.Borrowing.getBook | ( | ) |
Gets the book associated with this borrowing.
Book that was borrowed Definition at line 114 of file Borrowing.java.
| LocalDateTime com.example.restapi.model.Borrowing.getBorrowDate | ( | ) |
Gets the date and time when the book was borrowed.
Definition at line 121 of file Borrowing.java.
| Long com.example.restapi.model.Borrowing.getId | ( | ) |
Gets the unique identifier of the borrowing record.
Definition at line 100 of file Borrowing.java.
| LocalDateTime com.example.restapi.model.Borrowing.getReturnDate | ( | ) |
Gets the date and time when the book was returned.
null if not yet returned Definition at line 128 of file Borrowing.java.
| User com.example.restapi.model.Borrowing.getUser | ( | ) |
Gets the user associated with this borrowing.
User who borrowed the book Definition at line 107 of file Borrowing.java.
| void com.example.restapi.model.Borrowing.setReturnDate | ( | LocalDateTime | returnDate | ) |
Sets the date and time when the book was returned.
| returnDate | the return date and time |
Definition at line 135 of file Borrowing.java.