Conversation
| private int id; | ||
| private int externalId; |
There was a problem hiding this comment.
| private int id; | |
| private int externalId; | |
| private Long id; | |
| private Long externalId; |
| private int helpfulnessNumerator; | ||
| private int helpfulnessDenominator; | ||
| private int score; | ||
| private int time; |
There was a problem hiding this comment.
| private int time; | |
| private LocalDateTime time; |
| @Enumerated(EnumType.STRING) | ||
| private RoleName roleName; | ||
|
|
||
| public static Role of(String roleName) { |
There was a problem hiding this comment.
let's make the constructor private?
There was a problem hiding this comment.
How will we use Role.of() then?
There was a problem hiding this comment.
будь уважним)) Ксенія говорила про конструктор, а не статичний метод
| user.setExternalId(reviewDto.getUserId()); | ||
| user.setProfileName(reviewDto.getProfileName()); | ||
| user.setPassword(PASSWORD); | ||
| user.setRoles(Set.of(Role.of(ROLE_NAME))); |
There was a problem hiding this comment.
we should create a separate class in our project where we add all the entities that were parsed from the file to the database
in this class we should fetch the role by rolename from the database (it should have id), and then set this role to the user
so, let's create that class and remove setting the roles and password from here
| @Enumerated(EnumType.STRING) | ||
| private RoleName roleName; | ||
|
|
||
| public static Role of(String roleName) { |
There was a problem hiding this comment.
будь уважним)) Ксенія говорила про конструктор, а не статичний метод
|
|
||
| @Override | ||
| public List<Review> saveReviews(List<ReviewDto> data) { | ||
| List<Review> reviews = data.stream() |
There was a problem hiding this comment.
де ми для рев'ю додаємо продукт і юзера?
No description provided.