spring jdbctemplate和Hibernate之间的区别 [英] differences between spring jdbctemplate and Hibernate

查看:110
本文介绍了spring jdbctemplate和Hibernate之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题很简单:Spring jdbcTemplate和Hibernate的主要区别是什么?我们应该考虑使用其中一个或另一个的主要原因是什么?

My question just simple : what are the main differences between Spring jdbcTemplate and Hibernate ? what are the main reasons we should take into account for using one or the other ?

谢谢

Thanks

推荐答案

Hibernate是一个真正巨大的数据持久化和ORM解决方案,包括JPA实现。此外,还定义了许多方法来管理Hibernate中的实体,如何持久化,事务等。在Hibernate中,您可以使用SQL,HQL或Java注释。 JDBC模板只是一个简单的工具,可以帮助您管理SQL查询和事务。它可能更好地描述为JDBC包装器或帮助器。如果您更喜欢自己管理数据库查询(SQL),或者如果您是初学者,那么使用Spring JdbcTemplate将帮助您了解它的工作原理。即使你正在研究更大的应用程序,也应该考虑使用Hibernate。只要小心Hibernate的学习曲线。

Hibernate is a really huge solution with data persistence and ORM including JPA implementation. Also, there are defined many ways how to manage entities in Hibernate, how to persist, transactions, etc. In hibernate you can use SQL, HQL or java annotations. JDBC template is just a simple tool that helps you to manage SQL queries and transactions. It is probably better described as a JDBC wrapper or helper. If you prefer managing database queries (SQL) yourself or if you are a beginner, using Spring JdbcTemplate will help you understand how it works. Even if you are working on a bigger application, think about using Hibernate. Just be wary of the learning curve of Hibernate.

这篇关于spring jdbctemplate和Hibernate之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆