Update Home
							parent
							
								
									d35729d123
								
							
						
					
					
						commit
						46eadd7783
					
				
							
								
								
									
										6
									
								
								Home.md
									
									
									
									
									
								
							
							
								
								
								
								
									
									
								
								
								
							
						
						
									
										6
									
								
								Home.md
									
									
									
									
									
								
							@ -1,4 +1,4 @@
 | 
				
			|||||||
This repo is my first attempt to learn `SpringBoot` following [this](https://spring.academy/courses/building-a-rest-api-with-spring-boot/lessons/introduction) tutorial. The setup is Visual Code IDE alongside with [SpringBoot](https://code.visualstudio.com/docs/java/java-spring-boot) plugin.
 | 
					This repo is my first attempt to learn `SpringBoot` following [this](https://spring.academy/courses/building-a-rest-api-with-spring-boot/lessons/introduction) tutorial. The setup is Visual Code IDE alongside with [SpringBoot](https://code.visualstudio.com/docs/java/java-spring-boot) plugin. It is also advised to read this wiki via [Obsidian](https://obsidian.md/)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Spring Initializr
 | 
					# Spring Initializr
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -74,7 +74,7 @@ public class CashCardController {
 | 
				
			|||||||
That’s all it takes to tell Spring: “create a REST Controller”. The Controller gets injected into Spring Web, which routes API requests (handled by the Controller) with help of [[GET#@GetMapping]] annotation to the correct method.
 | 
					That’s all it takes to tell Spring: “create a REST Controller”. The Controller gets injected into Spring Web, which routes API requests (handled by the Controller) with help of [[GET#@GetMapping]] annotation to the correct method.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Get
 | 
					## Get
 | 
				
			||||||
****
 | 
					
 | 
				
			||||||
In [[GET]] requests, the body is empty. So, the request to read the Cash Card with an id of 123 would be:
 | 
					In [[GET]] requests, the body is empty. So, the request to read the Cash Card with an id of 123 would be:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
@ -139,4 +139,4 @@ cashCard = cashCardRepository.findById(99);
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
You might immediately wonder: where is the implementation of the `CashCardRepository.findById()` method? `CrudRepository` and everything it inherits from is an Interface with no actual code! Well, based on the specific Spring Data framework used, which for us will be Spring Data JDBC, Spring Data takes care of this implementation for us during the IoC container startup time. The Spring runtime will then expose the repository as yet another bean that you can reference wherever needed in your application.
 | 
					You might immediately wonder: where is the implementation of the `CashCardRepository.findById()` method? `CrudRepository` and everything it inherits from is an Interface with no actual code! Well, based on the specific Spring Data framework used, which for us will be Spring Data JDBC, Spring Data takes care of this implementation for us during the IoC container startup time. The Spring runtime will then expose the repository as yet another bean that you can reference wherever needed in your application.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
As we’ve learned, there are typically trade-offs. For example the `CrudRepository` generates SQL statements to read and write your data, which is useful for many cases, but sometimes you need to write your own custom SQL statements for specific use cases. But for now, we’re happy to take advantage of its convenient, out-of-the-box methods, 
 | 
					As we’ve learned, there are typically trade-offs. For example the `CrudRepository` generates SQL statements to read and write your data, which is useful for many cases, but sometimes you need to write your own custom SQL statements for specific use cases. But for now, we’re happy to take advantage of its convenient, out-of-the-box methods.
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user