Sir please make video on angular 12 Spring boot rest API MySQL database. Get multiple images from database through rest API and display angular.
@maheshchandane719711 ай бұрын
Durgesh bhai aap genius ho❤ India me Spring ke badshah
@rahul-sinha2 жыл бұрын
Durgesh Sir, please do include proper THUMBNAIL for each videos as well. Thanks 👍
@dnyaneshwarbandgar53382 жыл бұрын
Great sir 👌👌
@AbhishekKumar-hy7fb2 жыл бұрын
Sir plz implement all services in Microservice manners
@sunnysingh78542 жыл бұрын
The assignments which you gave are done
@Vithal_Nivargi2 жыл бұрын
6:34 I have created for the User....
@pradeepsharma57112 жыл бұрын
As you said to complete the suggested method without your help. So i did. Name: Pradeep Sharma Method completed from my end.
@vishalgoel7661 Жыл бұрын
Sir in postman your url starts with http .What should we do so that I can use https ? I have a very little idea of https like "we need a certificate and write code for it's validation ." Sir please make video on this topic as well .
@himanshugoyal95812 жыл бұрын
Hello Sir, Thanx for helping all students like me with all these types of contents. Further, i have completed APIs of getOnePost(postId) and getAllPost(). Please keep supporting us with your content.
@abbasmastan779311 ай бұрын
Sir thank you for this course but please sir implements multilangual work in this app like urdu and english this will be my final year project
@lordgreat60512 жыл бұрын
coding can already be so annoying sometimes like forgetting to add autowired annotation and wondering for an hour why im getting null on request and then these youtube ads mess with my brain ugh
@mohammadsaddanhussain73422 жыл бұрын
Hello Sir, I am getting null value while retrieving data from database using getPostByUser or getPostCategory. { "postTitle": null, "postContent": null, "postImageName": null, "postAddedDate": null, "category": null, "user": null }
@hashmisaddam70782 жыл бұрын
Same question
@vatsalvasoya5662 жыл бұрын
@@hashmisaddam7078 same question did u got solution to it?!
@sujayjeppu23202 жыл бұрын
public List getAllPostsByCategory(Long categoryId) { Category category = this.categoryRepo.findById(categoryId).orElseThrow(() -> new ResourceNotFoundException("Category", "Id", categoryId)); List allPostsByCategory = this.postRepo.findByCategory(category); return extractAllPostDTOs(allPostsByCategory); } public List getAllPostsByUser(Long userId) { User user = this.userRepo.findById(userId).orElseThrow(() -> new ResourceNotFoundException("User", "Id", userId)); List allPostsByUser = this.postRepo.findByUser(user); return extractAllPostDTOs(allPostsByUser); } private List extractAllPostDTOs(List allPostsByCategory) { List allPostDTOByCategory = allPostsByCategory .stream() .map( post -> { UserDTO postUserDTO = this.modelMapper.map(post.getUser(), UserDTO.class); CategoryDTO postCategoryDTO = this.modelMapper.map(post.getCategory(), CategoryDTO.class); PostDTO postDTO = this.modelMapper.map(post, PostDTO.class); postDTO.setUserDTO(postUserDTO); postDTO.setCategoryDTO(postCategoryDTO); return postDTO; }) .collect(Collectors.toList()); return allPostDTOByCategory; }
Nice explanation. thanks a lot for sharing this knowledge with us without any cost.
@sarveshm-rd6zp Жыл бұрын
Hi sir when i am run postman i am getting output like this please replay me what happend "title": null, "content": null, "imageName": null, "addedDate": null, "category": null, "user": null
@SachinSavita-dv7yj Жыл бұрын
me too, what to do now?
@Javed_Khan_. Жыл бұрын
@@SachinSavita-dv7yj watch at 15:30
@KashyapSharma011 ай бұрын
@@Javed_Khan_. Thanks
@gauravbansalkec2 жыл бұрын
Can't I fetch the list of posts from category object obtained directly rather than calling post repo for it as we have stored all posts of a category in the category model also ???
@shameersharif76802 жыл бұрын
Bro you look like a music director in south his name is S.S.Thaman….you look exact😳
@sheetalrai33252 жыл бұрын
I'm getting null for the category and user details while printing all the posts Any help is much appreciated
@travelwithannus Жыл бұрын
Same error.... Have you find any solution ?
@s.prabin Жыл бұрын
@@travelwithannus copy this code @Override public List getAllPostByCategory(Integer cid) { Category cat = this.categoryRepo.findById(cid) .orElseThrow(() -> new ResourceNotFoundException("Category", "Category id", cid)); List posts = this.postRepo.findByCategory(cat); List tempDto = posts.stream().map((post) -> this.modelMapper.map(post, PostDto.class)) .collect(Collectors.toList()); return tempDto; } a small typo leads to that error(i.e. in lambda expression while modelmapping, we have to write lambda expression post instead of List posts)
@vijayrajsingh23482 жыл бұрын
Hi Sir, I am getting null values for users and category when I am trying to create Post. public PostDto createPost(PostDto postDto,Integer uid, Integer cid) { Post post = toPost(postDto); // reading remaining data post.setImageName("default.png"); post.setDate(new Date()); // set users User userById = userRepo.findById(uid).orElseThrow(()-> new ResourceNotFoundException("user","id",uid)); post.setUserss(userById); // set category Category categoryById = catRepos.findById(cid).orElseThrow(()->new ResourceNotFoundException("category","id",cid)); post.setCategoryy(categoryById); Post savedPost = repos.save(post); System.out.println("user is====" +savedPost.getUserss().toString()); System.out.println("category is ==>"+ savedPost.getCategoryy().toString()); System.out.println("post is:"+ savedPost); return toPostDto(savedPost); } // conversion of post dto to post entity public Post toPost(PostDto postDto) { Post post = modelMapper.map(postDto, Post.class); return post; } // conversion of post entity to post dto public PostDto toPostDto(Post post) { PostDto postDto = modelMapper.map(post, PostDto.class); return postDto; }
@travelwithannus Жыл бұрын
Same error... Have you found any solution ?
@challengefitness-gz9bo Жыл бұрын
@@travelwithannus hello same problem hvae you find any solution
@s.prabin Жыл бұрын
@@challengefitness-gz9bo @Override public List getAllPostByCategory(Integer cid) { Category cat = this.categoryRepo.findById(cid) .orElseThrow(() -> new ResourceNotFoundException("Category", "Category id", cid)); List posts = this.postRepo.findByCategory(cat); List tempDto = posts.stream().map((post) -> this.modelMapper.map(post, PostDto.class)) .collect(Collectors.toList()); return tempDto; } copy this code a small typo leads to that problem
@samartajshaikh26012 жыл бұрын
great practice tutorial
@ManishKumar-zb2qx11 ай бұрын
i did
@vatsalvasoya5662 жыл бұрын
"title": null, "content": null, "imageName": null, "addedDate": null, "category": null, "user": null }, when i created get all posts by user i get these can anyone help......
@s.prabin Жыл бұрын
@Override public List getAllPostByCategory(Integer cid) { Category cat = this.categoryRepo.findById(cid) .orElseThrow(() -> new ResourceNotFoundException("Category", "Category id", cid)); List posts = this.postRepo.findByCategory(cat); List tempDto = posts.stream().map((post) -> this.modelMapper.map(post, PostDto.class)) .collect(Collectors.toList()); return tempDto; } copy this code
@mrrishiraj882 жыл бұрын
🙏👍
@rahul-sinha2 жыл бұрын
💥Sir Please *upload this project source-code on your website* -Thanks 🤗💖💞💥
@TheHimanshuSharmaYT7 ай бұрын
Katakuri
@yashgupta-qn6qg2 жыл бұрын
bhai source code bhi do n
@artworkbysomrita2062 Жыл бұрын
After defining these 2 extra methods inside PostsRepositories public interface PostRepositories extends JpaRepository{ List findAllPostsByUser(Users users); List findAllPostsByCategory(Category category); } getting this error: Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled. [2m2023-05-03T11:24:55.605+05:30[0;39m [31mERROR[0;39m [35m17836[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mo.s.boot.SpringApplication [0;39m [2m:[0;39m Application run failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'postController': Unsatisfied dependency expressed through field 'postServ': Error creating bean with name 'postsServiceImpl': Unsatisfied dependency expressed through field 'postRepo': Error creating bean with name 'postRepositories' defined in com.somrita.blog.repositories.PostRepositories defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Could not create query for public abstract java.util.List com.somrita.blog.repositories.PostRepositories.findAllPostsByUser(com.somrita.blog.models.Users); Reason: Failed to create query for method public abstract java.util.List com.somrita.blog.repositories.PostRepositories.findAllPostsByUser(com.somrita.blog.models.Users); No property 'user' found for type 'Posts' Did you mean ''users'' at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:713) ~[spring-beans-6.0.8.jar:6.0.8] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:693) ~[spring-beans-6.0.8.jar:6.0.8] at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:133) ~[spring-beans-6.0.8.jar:6.0.8] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:482) ~[spring-beans-6.0.8.jar:6.0.8] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1416) ~[spring-beans-6.0.8.jar:6.0.8] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:597) ~[spring-beans-6.0.8.jar:6.0.8] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[spring-beans-6.0.8.jar:6.0.8] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.8.jar:6.0.8] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.8.jar:6.0.8] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.8.jar:6.0.8] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.8.jar:6.0.8] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:973) ~[spring-beans-6.0.8.jar:6.0.8] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:917) ~[spring-context-6.0.8.jar:6.
@dhavalhatzade62922 жыл бұрын
while creating "findByCategory" method in PostRepo, I'm getting org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'postServiceImpl': Unsatisfied dependency expressed through field 'postRepo'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'postRepo' error Can someone help me fix this.
@vijik29882 жыл бұрын
please autowire all services and repository
@sunnysingh78542 жыл бұрын
In the repo Interface, check whether you are giving the correct names for the methods. Hope it helps. List findByUser(User user); List findByCategory(Category category);
@vasuaggarwal988311 ай бұрын
in your PostServiceImpl add the service annotation@@sunnysingh7854