I used to develop spring web applications where i always get tangled into the config stuff. Putting datasource, entitymanager transaction manager and blah blah.. But with time and with this spring boot and spring data, it is so easy and quick.
hie navin your videos are very good to understand ,thnaks for that. i have dought in this tutorial we have an interface for that while getting object we just called @autowired but you didnt mention @component in alienrepo interface how the object got created in spring container .
Hey Navin awesome video, but unfortunatly i am not getting any while I am not following the protocal of method creation in Alienrepo.class but I am getting error after compilation. Could you please provide me the solution..
Hi Sir, Excellent . i have a doubt, how can we write the @Query when we need data from two entity like one to one mapping, here you only return alien which is in the same Alien entity, but i want to return data from two table. please help me ..
Hi Naveen sir, I have a doubt, as I know to @Autowired an object of any class A we need to mention @Component on top of that particular class A. But when we are creating object of AlienRepo interface with @Autowired in AlienController then how it is working ? Can you please clarify? TIA
We have to add @Component annotation for custom classes that we create. But AlienRepo is an interface that extends inbuilt CrudRepository interface, which is provided by Spring. So we don't have to create any class that implements AlienRepo, as Spring Data does that for us in the background. A bean of this class is stored in the Spring Container when the application is run. When we create object of the interface using @Autowired, I think it actually looks for the bean of that hidden class that implements the AlienRepo interface stored in Spring container, and injects it.
So the query does not support update, is there another solution: @Query("Update Alien set tech='Python' where aid=?1") Alien updateByAid(int aid); It says: Not supported for DML operations
I actually did that. in your DAO file: List aliens = alienDAO.findByTechSorted(tech); mv.addObject("alien", aliens); Then add JSP file to alien like this: ${alien}
I did with ModelAndView. the code : @RequestMapping("/") public ModelAndView Home() { ModelAndView mv= new ModelAndView("index.jsp"); mv.addObject("lists", repo.findAll()); return mv; }
Hi Navin, Thank you very much for good tutorial. I want to do CRUD, All parts is Okay, just update doesn't work.The codes of java, JSP and the error: @RequestMapping(value="update/{id}", method=RequestMethod.GET) public ModelAndView update(@PathVariable("id") int id) { ModelAndView mv= new ModelAndView("update.jsp"); mv.addObject("lists", repo.findById(id)); return mv; } Insert title here Updating Page Id: First Name: Last Name:
Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. Mon Aug 27 00:22:30 PDT 2018 There was an unexpected error (type=Not Found, status=404). /update/update.jsp Can you help me what the problem is?
How to get Alien by it's name ? Trying whole day to write method get to filter by user name and unsuccessful so far. Here is what I got: // show object by it's NAME @RequestMapping(value = "/getAlienByName/{name}") public ResponseEntity getAlienByName(@PathVariable("name") String userName) { Alien alien = repo.findByName(userName).orElseThrow(() -> new IllegalArgumentException());; return ResponseEntity.ok().body(alien); }
Mind Blowing. Brain is bout to explode, It works like a superpower.
Thanks Alien , your part 1- 4 and the JPA vanilla videos helped me a lot .
I used to develop spring web applications where i always get tangled into the config stuff. Putting datasource, entitymanager transaction manager and blah blah..
But with time and with this spring boot and spring data, it is so easy and quick.
I'm becoming an Alien due to your videos. Great job!
Amazing Video it really look like magic, every thing is happening just by one line. I love this feature
You're tutorials are Excellent. Query sorted on tech is not worked. How to enable it?
You are doing the Gods' work. I love you Navin
That's fantastic! A bit confusing at the start, but I suppose it's going to ease a lot writing the code
you are good explained teacher.
thanks for this series Sir, hope this series will not end here, looking forward for next videos, thanks again
You are a good trainer sir
I found these tutorials very useful for me. Thanks Navin sir.
hie navin your videos are very good to understand ,thnaks for that. i have dought in this tutorial we have an interface for that while getting object we just called @autowired but you didnt mention @component in alienrepo interface how the object got created in spring container .
really Helpful, Nicely Explained sir
i hope this also will work.
List findByTechOrderByAnameAsc(String tech);
isn't it Navin ??
PS: I didnt try yet
Thank you for such a nice explanation.
sir plzz do it for update and delete also
Hey Navin awesome video, but unfortunatly i am not getting any while I am not following the protocal of method creation in Alienrepo.class but I am getting error after compilation. Could you please provide me the solution..
have you got any solution for this problem?
Thanks for the tutorial. I though don't like these frameworks auto injecting / creating methods. It is not help it is confusing.
These kind of frameworks ask you to study and adopt their ways. If you want to use them, you need to learn about the framework ways to do things.
Amazing content Alian! thanks so much
Is spring data jpa making heavy use of Java Reflection API to detect the method names and do its magic?
please add video with Services & without curd repository if possible
So which ORM is better Hibernate or Spring Data JPA ?
Awesome videos.. Great Leaning... your ..JAVA GURU
Nice tutorial
Can we use criteria implementations in spring data jpa?
Hi Sir, Excellent . i have a doubt, how can we write the @Query when we need data from two entity like one to one mapping, here you only return alien which is in the same Alien entity, but i want to return data from two table. please help me ..
How to create Join query in Spring JPA? In such cases, what should be the return type of the function that we write in the AlienRepo interface?
complex join is possible ?
I cannot find much information if look for query method, I just found one post where query methods are called Property Expressions
Hi I am getting classnotfoundexcception: antlr. RecognitionException
While try to execute custom queries
Can you help me out in that
It is due to wrong syntax
In my project - if i say findByTech1 this work , have a reason for it?
Anyway thank you a lot!!
Sir can you please tell that is Java a better option against PHP?
money $
Great series! I like it!
Help me a lots
How to fetch all values without condition?
Hi Naveen sir,
I have a doubt, as I know to @Autowired an object of any class A we need to mention @Component on top of that particular class A. But when we are creating object of AlienRepo interface with @Autowired in AlienController then how it is working ? Can you please clarify? TIA
We have to add @Component annotation for custom classes that we create. But AlienRepo is an interface that extends inbuilt CrudRepository interface, which is provided by Spring. So we don't have to create any class that implements AlienRepo, as Spring Data does that for us in the background. A bean of this class is stored in the Spring Container when the application is run. When we create object of the interface using @Autowired, I think it actually looks for the bean of that hidden class that implements the AlienRepo interface stored in Spring container, and injects it.
suppose if we have 100 entities we have to create 100 repository implementation.
So the query does not support update, is there another solution:
@Query("Update Alien set tech='Python' where aid=?1")
Alien updateByAid(int aid);
It says: Not supported for DML operations
Thanks
Like is not enough, need a love button
Sir, but i am unable to use List in AlienRepo interface for custom methods ,i am getting error. plz have a look.
what the error saying
thanks alien!!
[com.Uttarayan.StartApi.ApiEntity.LoginDetails@14ec036a] why am i getting this output from repo.findByuserid(userid)
how to display list of aliens in jsp
I actually did that. in your DAO file:
List aliens = alienDAO.findByTechSorted(tech);
mv.addObject("alien", aliens);
Then add JSP file to alien like this:
${alien}
I did with ModelAndView. the code :
@RequestMapping("/")
public ModelAndView Home()
{
ModelAndView mv= new ModelAndView("index.jsp");
mv.addObject("lists", repo.findAll());
return mv;
}
♥️
Hi Navin,
Thank you very much for good tutorial.
I want to do CRUD, All parts is Okay, just update doesn't work.The codes of java, JSP and the error:
@RequestMapping(value="update/{id}", method=RequestMethod.GET)
public ModelAndView update(@PathVariable("id") int id)
{
ModelAndView mv= new ModelAndView("update.jsp");
mv.addObject("lists", repo.findById(id));
return mv;
}
Insert title here
Updating Page
Id:
First Name:
Last Name:
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Mon Aug 27 00:22:30 PDT 2018
There was an unexpected error (type=Not Found, status=404).
/update/update.jsp
Can you help me what the problem is?
How to get Alien by it's name ?
Trying whole day to write method get to filter by user name and unsuccessful so far.
Here is what I got:
// show object by it's NAME
@RequestMapping(value = "/getAlienByName/{name}")
public ResponseEntity getAlienByName(@PathVariable("name") String userName) {
Alien alien = repo.findByName(userName).orElseThrow(() -> new IllegalArgumentException());;
return ResponseEntity.ok().body(alien);
}
Young Donna Jones Brenda Martinez Elizabeth