Skip to content

Conversation

@ladriana
Copy link
Collaborator

reviews repository and Dto files created

Copy link
Owner

@adrianbucur83 adrianbucur83 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing the controller and views

<artifactId>spring-boot-starter-thymeleaf</artifactId>
<version>3.2.4</version>
</dependency>
<dependency>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already have this in the project

<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-jpa -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already have this

private LocalDateTime date;
private String userName;

public Review() {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use lomboks' @DaTa


@Data
public class ReviewDto {
private String reviewMsg;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these fields should be validated (maybe @NotNull or minimum size?)

import java.time.LocalDateTime;

@Data
public class ReviewUpdateDto {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validation

language=not set
numbers.separator=n

logging.level.root=info
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't commit this file :) git rm --cached

public interface ReviewsRepository extends JpaRepository<Review, Integer> {
List<Review> getAllByUser(String userName);

void deleteAllByUser(String userName);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deleteAllByUser_name or something similar will work but you need to have the OneToOne/ OneToMany relation set up correctly

private LocalDate date;

private LocalDateTime date;
private String userName;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a User entrity and a relation like ManyToOne

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants