Posts

Food Order System : Customer Service

  Domain  Customer package com.customer.Domain; import jakarta.persistence. Entity ; import jakarta.persistence.*; import jakarta.validation.constraints.*; import lombok. AllArgsConstructor ; import lombok. Data ; import lombok. NoArgsConstructor ; import lombok. ToString ; @Entity @Data @ToString @NoArgsConstructor @AllArgsConstructor public class Customer { @Id @GeneratedValue (strategy = GenerationType. AUTO ) private Integer customerId ; @NotNull (message = "firstName field should not be null" ) @Size (min = 3 ,max= 30 ,message = "name of min length should be 3 and max be 30" ) private String firstName ; @NotNull (message = "lastName field should not be null" ) @Size (min = 3 ,max= 30 ,message = "name of min length should be 3 and max be 30" ) private String lastname ; @NotNull (message = "age field should not be null" ) @Max ( 100 ) private Integer age ; @NotNull (message = "

2. Random Interview Question

  Object Class Methods (total are 11 Methods) 1. toString() method 2. hashCode() method 3. equals(Object obj) method 4. finalize() method 5. getClass() method 6. clone() method 7. wait(),  8. notify()  9. notifyAll() methods What is Difference between @Componet and @Bean ? - both Indicate Object creation. - but if we have source code we can open the class on the top of class we can write at @Component if class is programmer define means we created the class then we can use it @Component .  - If class is predefined and if we want create object inside container then at that time we have to use @Bean(Java Based Configuration)  annotation along with @Configuration (Java Based Configuration).   Use of @Required Annotation ? - @Required annotation is applied to bean property setter methods. - @Required is an annotation that indicates that a bean property must be populated at configuration time. It ensures that a required dependency is injected before the bean is used. - Note that @Requ