Spring notes(六) - DAO and ORMapping support
Spring provides all kinds of DAO layers: JdbcDaoSupport: you can get JdbcTemplate. HibernateDaoSupport:you can get hibernateTemplate and SessionFactory JdoDaoSupport: you can get jdoTemplate and PersistenceManagerFactory JpaDaoSupport: you can get jpaTemplate and EntityManagerFactory SqlMapDaoSupport: you can get sqlMapDaoTemplate and SqlMapClient So, you can extend these XxxDaoSupport to expose CRUD APIs. In spring applicationContext.xml, you should inject [...]
Categorized in: Design Patterns, Java · Tagged with: DAO, Java, Spring
Spring notes(五) - transaction
Spring transaction mechanism supports: programming transaction declaring transaction I. Programming transaction: At first, you should define a transactionManager which is the subclass derived from PlatformTransactionManager. DataSourceTransactionManager: inject datasource instance to it. JtaTransactionManager: no need to inject anything HibernateTransactionManager: inject sessionFactory instance to it JdoTransactionManager: inject persistenceManagerFactory instance to it Then, inject these transactionManagers to JdbcTemplate, [...]
Categorized in: Java · Tagged with: Java, Spring, Transaction
Spring notes(四) – AOP
AOP in springframework…
Categorized in: Java · Tagged with: AOP, Java, Spring
Spring notes(三) - Resource
Resource interface defines the accessor to all various resources, such as file, http resource, ftp resource, class, etc. Built-in implementations: UrlResource ClassPathResource FileSystemResource ServletContextResource InputStreamResource ByteArrayResource
Categorized in: Java · Tagged with: AOP, Java, Spring
Spring notes(二) – Ioc container
IOC container, in spring framework is BeanFactory, contains the following functions: controls the lifecycle (creation, init, destroy) controls the scope (like singleton, prototype, request, session, applicationcontext, new in spring) maintains beans’ dependence BeanFactory is the base of the other modules in springframework. Collection type for bean’s property: list set map props Lazy init for bean: [...]
Categorized in: Java, Scripts · Tagged with: AOP, IOC, Java, Spring
Spring notes(一) – Overview
Spring contains following modules: Core: the core(beanfactory) of springframework providing bean management Context: based on BeanFactory, but supports more functions, such as i18n, event-broadcasting, resource-loading, mail, validation, etc. DAO: series of interfaces that you can choose to implement DAOs. ORM: corresponding classes for integrating many ORM utilities to springframework. Web/Web MVC AOP: AOP function you [...]

(
(4.00 out of 5)