Skip to content

commit project with spring boot + spring data jpa#51

Open
tungvv318 wants to merge 2 commits into
UETCodeCamp:masterfrom
tungvv318:tungvv318
Open

commit project with spring boot + spring data jpa#51
tungvv318 wants to merge 2 commits into
UETCodeCamp:masterfrom
tungvv318:tungvv318

Conversation

@tungvv318

Copy link
Copy Markdown
Contributor

No description provided.

@quytm quytm left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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