getSessionFactory().openSession();
Today I saw an example of using ThreadLocal to store Session:
inside s = getSessionFactory().openSession(); this code is not very understandable, and I have checked a lot of information but have not found a satisfactory answer. Is there a class called SessionFactory? As a factory for creating sessions? And what is the getSessionFactory() method for? Also, I found that both Spring and Hibernate frameworks have SessionFactory. Is the usage the same? How to use it?
I am a college student, and I am a rookie. I hope Daniel can answer it, thank you!