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

Added Book model, repository & service layers #1

Merged
merged 3 commits into from
Oct 16, 2023
Merged

Conversation

viacheslav-torbin
Copy link
Owner

No description provided.

Comment on lines 28 to 94
public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}

public String getAuthor() {
return author;
}

public void setAuthor(String author) {
this.author = author;
}

public String getIsbn() {
return isbn;
}

public void setIsbn(String isbn) {
this.isbn = isbn;
}

public BigDecimal getPrice() {
return price;
}

public void setPrice(BigDecimal price) {
this.price = price;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public String getCoverImage() {
return coverImage;
}

public void setCoverImage(String coverImage) {
this.coverImage = coverImage;
}

@Override
public String toString() {
return "Book{"
+ "id=" + id
+ ", title='" + title + '\''
+ ", author='" + author + '\''
+ ", isbn='" + isbn + '\''
+ ", price=" + price
+ '}';
}
}

Choose a reason for hiding this comment

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

you can just use @DaTa annotation on your class ) It's up to you

Choose a reason for hiding this comment

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

You added Lombok annotation but didn’t use it. Lombok is a great library but be attentive when using it with Entity JFYI

Copy link

@TetianaDenchyk TetianaDenchyk left a comment

Choose a reason for hiding this comment

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

Good job!

Copy link

@liliia-ponomarenko liliia-ponomarenko left a comment

Choose a reason for hiding this comment

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

Good job! Let’s make your code more consistent ;)

Comment on lines 28 to 94
public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}

public String getAuthor() {
return author;
}

public void setAuthor(String author) {
this.author = author;
}

public String getIsbn() {
return isbn;
}

public void setIsbn(String isbn) {
this.isbn = isbn;
}

public BigDecimal getPrice() {
return price;
}

public void setPrice(BigDecimal price) {
this.price = price;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public String getCoverImage() {
return coverImage;
}

public void setCoverImage(String coverImage) {
this.coverImage = coverImage;
}

@Override
public String toString() {
return "Book{"
+ "id=" + id
+ ", title='" + title + '\''
+ ", author='" + author + '\''
+ ", isbn='" + isbn + '\''
+ ", price=" + price
+ '}';
}
}

Choose a reason for hiding this comment

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

You added Lombok annotation but didn’t use it. Lombok is a great library but be attentive when using it with Entity JFYI

import org.bookstore.model.Book;

public interface BookRepository {

Choose a reason for hiding this comment

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

To be honest I don’t prefer to leave one empty line after class declaration but you can do it if you like it BUT!!! make it consistent (leave one empty line in each class or remove it everywhere)

public class BookRepositoryImpl implements BookRepository {
private final SessionFactory sessionFactory;

@Autowired

Choose a reason for hiding this comment

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

As of Spring Framework 4.3, an @Autowired annotation on such a constructor is no longer necessary if the target bean defines only one constructor to begin with. See note here Let’s check it ;)

Copy link

@liliia-ponomarenko liliia-ponomarenko left a comment

Choose a reason for hiding this comment

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

Triggered reject

Copy link

@liliia-ponomarenko liliia-ponomarenko left a comment

Choose a reason for hiding this comment

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

LGTM 🔥

@viacheslav-torbin viacheslav-torbin merged commit f789b40 into master Oct 16, 2023
2 checks passed
@viacheslav-torbin viacheslav-torbin deleted the hw-book branch October 16, 2023 14:30
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.

4 participants