userRepository.save doesnt work for registration

https://pastebin.com/JG5LYnwB Error when I click Register

Code for the Register view

@Route("register")
@AnonymousAllowed
@CssImport("./styles/login-view.css")
public class RegisterView extends Composite {

    private final AuthService authService;

    public RegisterView(AuthService authService) {
        this.authService = authService;
    }

    @Override
    protected Component initContent() {
        TextField firstname = new TextField("First Name");
        TextField lastname = new TextField("Last Name");
        EmailField email = new EmailField("Email");
        PasswordField password1 = new PasswordField("Password");
        PasswordField password2 = new PasswordField("Confirm password");
        return new VerticalLayout(
                new H2("Register"),
                new HorizontalLayout(firstname, lastname),
                email,
                new HorizontalLayout(password1, password2),
                new Button("Register", event -> register(
                        firstname.getValue(),
                        lastname.getValue(),
                        password1.getValue(),
                        password2.getValue(),
                        email.getValue()
                ))
        );
    }

    private void register(String firstname, String lastname, String password1, String password2, String email) {
        if (firstname.trim().isEmpty()) {
            Notification.show("Enter your name");
        } else if (lastname.trim().isEmpty()) {
            Notification.show("Enter your last name");
        } else if (email.isEmpty()) {
            Notification.show("Enter your email");
        }else if (password1.isEmpty()) {
            Notification.show("Enter a password");
        } else if (!password1.equals(password2)) {
            Notification.show("Passwords don't match");
        } else {
            authService.register(email, password1);
            Notification.show("Check your email.");
        }
    }
}```

Register method in the authService Class

 public void register(String email, String password) {
        userRepository.save(new User(email, password, Role.USER));
        Notification.show("Registered!");```

User Repository
```Java
public interface UserRepository extends JpaRepository<User, Integer> {
User getByEmail(String email);

Roles

public enum Role {
    ADMIN, USER
}```

You cannot name the table user because user is a reserved SQL keyword

ohhhhh

let me fix that

One more question

it works now thanks for that but where does it save the user?

can I manually edit this

what database do you have?

JpaRepository?

uh is this never being saved anywhere

i tried to find resources on how to connect

can you show your pom.xml?

yes one sec

only the dependecies or everything?

I assume you are using H2 in-memory database

yes that is a dependecy

<dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-oauth2-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.5.0-b01</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.5.0-b01</version>
        </dependency>
    </dependencies>```

(in my pom.xml)