JPA 1.0 实体类映射改进
全部, 我们有 300 个实体类,它们是根据 J2EE Web 应用程序的现有数据库模式生成的。 我们在应用程序部分之一面临性能问题,想知道是否:
- 可以调整/优化当前映射(@ManyToOne, @OneToMany)关系可以减轻运行时的负担?如果是这样,如何 以及起点是什么。
- 是否有工具可以标记出此类实体的改进 课程?
- 此类改进/更改是否会影响数据库结构。我们会 想要保持数据库结构的影响?
请注意,该应用程序尚未投入生产。我们不想/避免改变当前的数据库结构。
系统信息: 视窗XP IBM Websphere AS 7.0.0.15 拉德7.5 休眠3.3 春天3
All,
We have 300 entity classes that was generated from existing DB schema for a J2EE web application.
We are facing performance issues in one of the application sections and wanted to know if:
- It’s possible to tune/optimize the current mappings (@ManyToOne,
@OneToMany) relationsships to make the runtime less heavy? If so, how
and what would be a starting point.- Is there a tool(s) that mark out the improvements in such entity
classes?- Will such improvements/changes impact the DB structure. We would
like to keep the DB structure impact?
Please note that the application is not in production yet. We do not want/avoid to change the current DB structure.
System info:
Windows XP
IBM Websphere AS 7.0.0.15
RAD 7.5
Hibernate 3.3
Spring 3
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,首先要研究关系和获取组的延迟加载,这样您就不会从数据库中拉回整个对象图,而只是从数据库中拉回对象和对象图。您需要的领域。
据我所知,没有一个。您确实必须了解您的域以及您的应用程序如何使用它。
更改 hibernate 获取对象的方式根本不会改变数据库中的结构。
Yes, to start with investigating lazy loading of relationships and fetch groups so that you are not pulling your whole object graph back from the db, but rather just the objects & fields you need.
None that I know of. You really have to be aware of your domain and how your application is using it.
Changing how hibernate fetches your objects should not alter your structure in your database at all.