
Hibernate با استفاده از اشیاء پراکسی ، واکشی و بهینه سازی داده ها را مدیریت می کند. در این آموزش ، خواهیم آموخت که آنها چه هستند و ابتدای راه تنبل چگونه کار می کند.
لینک دانلود
49 پاسخ به “آموزش خواب زمستانی 12 – انواع پروکسی و انواع مشتاق و مشتاق”
نظرات بسته شده اند.
You are creating a world of well-informed developers. Nice work!
Hi Koushik, excellent tutorials as usual, but I have a doubt : when I print the class of the retreived object using session.get(), it still shows the original class, and not some proxy class, why is this ?
After session.close() if you r trying to fetch user.getName() it is showing the name?.How is it possible? because after session close all objects will be clear from cache
Amazing if you were using Django querysets , they are almost the same.
I still didn't get why hibernate is creating a Proxy instead of providing user class directly.
Thank you a lot.
These are really awesome tutorials. Very easy to understand. Keep it up….
8:12 proxy diagram
With new versions of Hibernate, I don't think this concept still holds. I am not able to make any lazy fetch scenario even after specifying the FetchType as Lazy.
I am not getting any LazyInitializationException even on specifying the FetchType as Lazy :/
Not good explanation about proxy class.. :/
Amigo,
estou recebendo o seguinte erro quando tento fazer um GET em tabelas que possuem relacionamento:
"java.lang.UnsupportedOperationException: Attempted to serialize java.lang.Class: org.hibernate.proxy.HibernateProxy. Forgot to register a type adapter?"
A meu ver a biblioteca Gson está tendo problemas ao receber a lista de objetos e converter para JSON. Sabe como resolver isso?
Obrigado.
Thank you so much, i love you <3
good tutorial indeed. However still did not get why Colletion Interface is used instead of collection implementation. In previous session it was said that it will be explained here.
You have good tutorials , but you have to explain this topic more deeply and give some others examples and problems with that fetching types!
While debugging as explained in the tutorial I am getting address object as well. I don't understand then how this corresponds to lazy initialisation? If you could explain
Very well explained the concept 🙂
Hibernate doesnt fire the select query if you just call user.getListOfAddresses(). it calls only when you are trying to get information of data inside collection like user.getListOfAddresses().size().
By writing user.getListOfAddresses() will print only the proxy object without the select being fired.
Also there is no proxy of User class, instead the proxy object of collection is created.
Does it mean every time we run 'select' operation, hibernate creates a proxy object and we call methods of that proxy objects only ?
very good tutorials Koushik. Thank you and pls keep up the good work.
You say the list is fetched when the getter is called, but I believe it is when the list is actually used :
user.getListOfAdresses(); // nothing is fetched
user.getListOfAdresses().size(); // list is fetched
I think session.get do not create proxy. Reasons are : 1.If constructor of userDetails entity is private then it will generate exception when we use session.load same scenario with session.get not throw exception.
2. For session.load JavassistProxyFactory creates proxy but in case of session.get there is a condition in Entity.class of hibernate. Below condition is false.
if ( proxyOrEntity instanceof HibernateProxy ) {
( (HibernateProxy) proxyOrEntity ).getHibernateLazyInitializer()
.setUnwrap( isProxyUnwrapEnabled );
}
Also the fetchType is related to Collection as shown in @OneToMany (By default Lazy for @OneToMany and @ManyToMany)
due to which lazy initilization exception was thrown. hese 2 things are different as per my understanding.
🙂 🙂 🙂
Yep as I said before the program has a problem for me.
If I run it twice the second time I run it hangs on
Hibernate: alter table USER_ADDRESS drop constraint FK_rr7b0tc5khp6fevg5vf9ctn5
@Java Brains
One thing that puzzles if this Proxy class extends a base class. You cast using a base class cast would you not be calling functions from the base class?
Hi koushik first of all, thank you very much for providing such a great tutorials. You are awesome.!! I am confused that I learned session.load() will only return a proxy object while session.get() will return real object that is instance of user class . But as you said in the video proxy object of user class is returned by session.get(). I am having confusion over here. Thanks
Ah crap I'm getting this in eclipse.
Hibernate: alter table USER_ADDRESS drop constraint FK_rr7b0tc5khp6fevg5vf9ctn5
Superb Sir……….
one of the best tutorial i've ever seen! congratulations
Your efforts are adorable !! thanx man
you are awesome…the tutorial is awesome…the world is awesome. Thanks. 🙂
Really useful thank you .!!
Excellence explanation about Lazy Loading vs Eager Loading , Thank you sir
Hi
As we will reach to user.getAddress, will load 100 of addresses but is there any way where I can specify to load the addresses who lives in bombay.
in this I can only think of writig a query which get the data of bombay location, is there any other way in hibernate itself
Hi Koushik! Thank u for such great tutorials.
I have a question, kindly clarify.
1) Instead of session.get, if we use session.load, unless we access the non-primary entities of a model/POJO class, no fetching is done from the db. Can this also be called a lazy fetching?
2) With sesion.load, even if Fetchtype=Eager, trying to fetch a collection after closing the session, it still throws an error LazyInitializationException.
Either case, using session.load is always a LazyFetching. Is that rt?
happy teachers day Koushik!! Nice tutorials, really helpful
A good rulu hibernate application
i dinn ask you sob
YouTube has lot of entertaining videos. Please do watch them. This was meant for teaching Hibernate, which it does.
you might already know that stuff but a totally new guy needs a little more details thats why i guess he explains it in so detail
Wow… this was revelatory.
your lectures are good … I feel you waste lot of time talking … its total unnecessary to go in that detail … this really bored me and made me close video
It's really not exaggerated when I say that I love all your videos!
why do you say so?
I read an interesting question on stackoverflow. com/questions/5027013/hibernate-lazy-load-application-design about lazy loading entities in DAO layer. What do you think about?
Regards. Thanks for your videos.
thanks
Thank you, it's great tutorial, i have a question, what does session exactly means ???
how can i manage sessions through my application
Very good explanation about Lazy nd Eager fetch…..
Thanks..
Videos are good but when you explain the concepts IT IS THE WORST EXPLAINATION YOU WILL GET ON THE EARTH….. SERIUOSLY VERY POOR EXPLANATION OF CONCEPTS …