Spring supports Data Access Object with 3 standard possible ways:
JDBC Templates
Hibernate Contextual Sessions
JPA Based templates
XML bean wiring includes follows:
Datasource configuration - JNDI or connection pool based
Wire template class with property to use the above datasource
JDBC Templates are for applications that are very small and requires quick development. Still will not support things like lazy loading, eager loading, cascade deletes, objects graph.
Hibernate Contextual sessions will support what is not supported by JDBC as mentioned above.
JPA based templates are JEE based standard and supports variety of frameworks from different vendors.
The templates are boiler plate code that is provided by Spring framework to write just the database access code and not worry about connection opening, closing, cleaning up of objects.
Had a good read on the above.
Tejas Bavishi
JDBC Templates
Hibernate Contextual Sessions
JPA Based templates
XML bean wiring includes follows:
Datasource configuration - JNDI or connection pool based
Wire template class with property to use the above datasource
JDBC Templates are for applications that are very small and requires quick development. Still will not support things like lazy loading, eager loading, cascade deletes, objects graph.
Hibernate Contextual sessions will support what is not supported by JDBC as mentioned above.
JPA based templates are JEE based standard and supports variety of frameworks from different vendors.
The templates are boiler plate code that is provided by Spring framework to write just the database access code and not worry about connection opening, closing, cleaning up of objects.
Had a good read on the above.
Tejas Bavishi
No comments:
Post a Comment