no import statements needed for plain hibernate 3 DAO?
eclipse is complaining about sessionFactory being undefined... but i'm not supposed to add import statements right? so is there some way to have it not show this error in Eclipse? i tried installing spring ide but i still see the error.
Where do you get the idea that you don't need or aren't supposed to add the import statements?! If you need the SessionFactory you need to import it....
sp...rnate-straight
said no spring imports are required. but i guess i still need to import the hibernate SessionFactory?
As always you need to import all the classes you need. Which is also stated by that same reference guide you mention.
The main advantage of this DAO style is that it depends on Hibernate API only; no import of any Spring class is required. This is of course appealing from a non-invasiveness perspective, and will no doubt feel more natural to Hibernate developers. |