Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

@Repository
@Transactional(readOnly = true)
public interface AppUserRepository
extends JpaRepository<AppUser, Long> {
public interface AppUserRepository extends JpaRepository<AppUser, Long> {

Optional<AppUser> findByEmail(String email);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,36 @@
package com.example.demo.registration;

import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;

@Getter
@AllArgsConstructor
@EqualsAndHashCode
@ToString
public class RegistrationRequest {
private final String firstName;
private final String lastName;
private final String email;
private final String password;

//We have to remove the final from here to set the values
private String firstName;
private String lastName;
private String email;
private String password;


//We have to use this nowadays, if not we are going to face the
// [com-fasterxml-jackson-databind-exc-invaliddefinitionexception-cannot-construct-instance-of-xyz-no-creators-
// like-default-construct-exist-cannot-deserialize-from-object-value-no-delega/]
//I faced the error recently.
//I have used the strategy of default constructor.


//default constructor
public RegistrationRequest() {
}

public RegistrationRequest(String firstName, String lastName, String email, String password) {
this.firstName = firstName;
this.lastName = lastName;
this.email = email;
this.password = password;
}
}