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

commit project with spring boot + spring data jpa #51

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tungvv318
Copy link
Contributor

No description provided.

Copy link
Contributor

@quytm quytm left a comment

Choose a reason for hiding this comment

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

  • Push thừa: thư mục .idea, target
  • Với project nhỏ có thể chia thành nhiều controller (AddingController, ...), tuy nhiên, nên gộp lại thành CustomerController


@PostMapping("/handle-delete-customer")
public void deleCustomer(@RequestBody String delId){
delId =delId.substring(3,delId.length());
Copy link
Contributor

Choose a reason for hiding this comment

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

có thể thay thế bằng delId =delId.substring(3);

@Modifying
@Transactional
@Query("update Customer c set c.name = ?1, c.email = ?2, c.phone = ?3, c.balance = ?4 where c.id = ?5")
void updateCustomer(String name, String email, String phone, int balance, int id);
Copy link
Contributor

Choose a reason for hiding this comment

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

có thể dùng cách khác: find customer, update giá trị của nó, save lại

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