-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create mock db on docker oracle xe container #39
Create mock db on docker oracle xe container #39
Conversation
…9535ja9_Create-a-mock-database-with-mock-date-for-dev-purposes_Kinga-Traczyk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will check if changes are working locally. Please take a look on comments ;-)
public class User { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) //pod sqlite | ||
// @GeneratedValue(strategy = GenerationType.AUTO) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't leave such things in code. Also user id strategy needs to be discussed
private String email; | ||
|
||
|
||
// private String status INT NOT NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this block of comments :-)
public class UserRole { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) //pod sqlite | ||
// @GeneratedValue(strategy = GenerationType.AUTO) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same situation like before
@Override | ||
public UserRole getUserRole() { | ||
//todo - paskudnie brzydkie | ||
return userRoleRepository.findAll().stream().filter(role -> role.getName().equals("USER")).findFirst().get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Streams are sexy but what if role won't be found
|
||
@Override | ||
public UserRole getUserRole() { | ||
//todo - paskudnie brzydkie |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't leave comments in Polish :-)
|
||
@Override | ||
public List<UserDto> getAllUsers() { | ||
List<User> users =userRepository.findAll(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use code reformat to avoid places like here =nameOfVariable.
public UserDto register(RegisterDto registerDto) { | ||
if(registerDto == null) throw new IllegalArgumentException("Cannot register a null user"); | ||
|
||
//sprawdzenie, czy wszystkie wymagane pola w formularzu zostały wypełnione |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again please write comments in English
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea can be seperate application.properties for dev purpose
Quality Gate passedIssues Measures |
Decision: to be closed |
I added scripts to be run on start of the container - creation of user meowhub and all tables on the schema. I put some basic inserts as well.
I changed the image from Oracle Enterprise Edition to Oracle Express Edition - for current development there's no need for all of the advanced options that Enterprise Edtition has to offer, as well as it saves us developers disc space and time that the container needs to start.
It's a first draft, to be improved in the future.