From c04ddee258d17e40e593d3bcac0384243f276531 Mon Sep 17 00:00:00 2001 From: Ajay Negi Date: Mon, 16 Sep 2024 22:48:13 +0530 Subject: [PATCH] Update --- .../exception/ResourceNotFoundException.java | 17 +++++++++++++++++ .../application-development.properties | 8 +++++++- src/main/resources/application.properties | 2 +- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/libraryman_api/exception/ResourceNotFoundException.java b/src/main/java/com/libraryman_api/exception/ResourceNotFoundException.java index 24281e0..56a5840 100644 --- a/src/main/java/com/libraryman_api/exception/ResourceNotFoundException.java +++ b/src/main/java/com/libraryman_api/exception/ResourceNotFoundException.java @@ -10,6 +10,23 @@ */ public class ResourceNotFoundException extends RuntimeException { + /** + * The {@code serialVersionUID} is a unique identifier for each version of a serializable class. + * It is used during the deserialization process to verify that the sender and receiver of a + * serialized object have loaded classes for that object that are compatible with each other. + * + * The {@code serialVersionUID} field is important for ensuring that a serialized class + * (especially when transmitted over a network or saved to disk) can be successfully deserialized, + * even if the class definition changes in later versions. If the {@code serialVersionUID} does not + * match during deserialization, an {@code InvalidClassException} is thrown. + * + * This field is optional, but it is good practice to explicitly declare it to prevent + * automatic generation, which could lead to compatibility issues when the class structure changes. + * + * The {@code @Serial} annotation is used here to indicate that this field is related to + * serialization. This annotation is available starting from Java 14 and helps improve clarity + * regarding the purpose of this field. + */ @Serial private static final long serialVersionUID = 1L; diff --git a/src/main/resources/application-development.properties b/src/main/resources/application-development.properties index 94719e8..e16234d 100644 --- a/src/main/resources/application-development.properties +++ b/src/main/resources/application-development.properties @@ -12,6 +12,12 @@ spring.datasource.password= Add_Your_Password spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.jpa.hibernate.ddl-auto=update -spring.jpa.show-sql=true +spring.jpa.properties.hibernate.format_sql=true + + +server.error.include-binding-errors=always +server.error.include-message=always +server.error.include-stacktrace=never +server.error.include-exception=true logging.level.org.springframework.security = TRACE \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index eef557c..21abc9b 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,2 +1,2 @@ spring.application.name=libraryman-api -spring.profiles.active=${ENV:development} +spring.profiles.active=${ENV:dev}