Some days ago I heard about spring-boot. So I started to setup my project from zero, include jpa and dont use older setups from existing projects. But now there is an understanding problem between what I've learned and what I've read about the "easy setup" with spring boot and jpa.
Usually my projects have this structur.
- Model (for excample Car)
ModelDao (CarDao with the following code-example)
@Component public class CarDao { /** The Hibernate session factory. */ @Autowired private SessionFactory sessionFactory; @Transactional public void save(Car car) { sessionFactory.getCurrentSession().saveOrUpdate(car); }CarServiceImpl thats works with DAO´s (includes methods like
findAll(),getCarById()orsaveCar(Car car))
But now I only read about @Entity and JPA-repositorys.
Is it right to say that I dont need models and dao's because I have the @Entity-Annotation? And my ServiceImples and JPA-repositorys have the same functionality? What happend with the SessionFactory? Is all managed automatically?