Skip to content
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

Conversation

KinTrae
Copy link
Collaborator

@KinTrae KinTrae commented Aug 28, 2024

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.

Kintrae and others added 2 commits August 10, 2024 11:36
…9535ja9_Create-a-mock-database-with-mock-date-for-dev-purposes_Kinga-Traczyk
@JimTheCat
Copy link
Owner

Copy link
Owner

@JimTheCat JimTheCat left a 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)
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 leave such things in code. Also user id strategy needs to be discussed

private String email;


// private String status INT NOT NULL;
Copy link
Owner

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)
Copy link
Owner

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();
Copy link
Owner

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
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 leave comments in Polish :-)


@Override
public List<UserDto> getAllUsers() {
List<User> users =userRepository.findAll();
Copy link
Owner

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
Copy link
Owner

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

Copy link
Owner

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

Copy link

@JimTheCat
Copy link
Owner

Decision: to be closed

@JimTheCat JimTheCat closed this Aug 28, 2024
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.

2 participants