简体   繁体   English

使用Hibernate和Spring进行Swing应用程序

[英]Swing application with Hibernate and Spring

Can we use Spring as Controller and Hibernate as ORM tool for an application with User Interface SWING?? 对于带有用户界面SWING的应用程序,我们可以使用Spring作为控制器,将Hibernate作为ORM工具吗?

If yes how?? 如果是,怎么办?

How will be its directory would appear. 其目录将如何出现。 How all injections will takes place. 所有注射将如何进行。 For simplicity maintaining a environment for saving Text fields input into DATABASE using Hibernate. 为简单起见,维护使用Hibernate将输入的文本字段保存到DATABASE中的环境。

Spring could not be used as Controller in desktop application ( Spring MVC is a web framework), but it can be used for features such as autowiring. Spring不能用作桌面应用程序中的Controller( Spring MVC是一个Web框架),但可以用于自动装配等功能。

However Spring and Swing does not play well together, my last attempt failed due to really inconvinient configuration and lots of overhead code. 但是春天和Swing不玩好起来,我的最后一次尝试失败,原因是真的 inconvinient配置和大量的开销代码。

Some time ago there was a project called Spring Rich Client , but seems to be abandoned. 前一段时间有一个名为Spring Rich Client的项目,但似乎被放弃了。

Anyway - internet is full of examples of using Swing with Spring, but you have to know that this pair is "not that popular". 无论如何-互联网上充满了将Swing与Spring结合使用的示例,但是您必须知道这对不那么受欢迎。

Using pair of Hibernate and Spring is not different than in web-application case. 使用Hibernate和Spring对与Web应用程序情况没有什么不同。

No. You cannot use Spring as a controller. 不能。您不能将Spring用作控制器。 But you can use core Spring container for using in Dao and Service layer. 但是您可以使用核心Spring容器在Dao和Service层中使用。 Hibernate for using Object mapping with Database Table. 休眠以将对象映射与数据库表一起使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM