hibernate与数据库交互的时序图
我需要为 hibernate 和任何数据库的交互创建一个通用序列图。
它需要非常通用并适用于hibernate和数据库之间的所有事务
打开、获取数据和关闭与数据库的hibernate会话涉及的主要方法是什么
I need to create a general sequence diagram for the the interaction of hibernate and a any database.
It needs to be very generic and application to all transaction between hibernate and database
What are the main methods involved in opening, fetching data and closing of a hibernate session with the database
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
序列图显示了一些对象实例之间的关系,您介意哪些?在某种程度上,它只是一个数据库和一个休眠应用程序。在这种情况下,您只需完成以下操作:打开、获取(或其他查询)、关闭。
现在想必您想要比这更多的细节,但我认为我们需要知道您为什么要绘制此图。谁会读这篇文章,他们对什么感兴趣?考虑这个简单的教程,它们显示了一个代码片段:
所以现在我们有几个有趣的对象,SessionFactory、Session等等。对于即将使用 Hibernate 的程序员来说,这可能很有趣。对于 DBA 来说也许不那么重要?您可以很容易地绘制上述代码片段的序列图,并且它有一定的道理。我无法理解这样的图表的价值,但那是另一个故事了。
A sequence diagram shows relationships between some object instances, which ones do you have mind? At one level it's just a database and a hibernate application. In which case you've just done it: Open, Fetch (or other query), Close.
Now presumably you want more detail than this, but I think we need to know why you're drawing this diagram. Who is going to read this, what are they interested in? Consider this this simple tutorial, they show a code snippet:
So now we have several interesting objects, SessionFactory, Session and so on. For a programmer about to work with Hibernate this might be interesting. For a DBA maybe less so? You can quite easily draw a sequence diagram of the above snippet, and it has some truth in it. I can't understand the value such a diagram, but that's another story.