简体   繁体   English

EJB + Spring + Hibernate应用程序

[英]EJB+Spring+Hibernate application

I need to develop an application for just say,'user entry system' using EJB 3.0, spring and hibernate. 我需要使用spring和hibernate的EJB 3.0开发一个仅用于说“用户输入系统”的应用程序。 Can any one guide me how to start it, or could suggest any site where can i get some sample application using combination of all three. 任何人都可以指导我如何启动它,或者可以建议任何一个站点,在其中我可以结合使用这三个示例程序来获取一些示例应用程序。 or any person have some demo application . 或任何人都有一些演示应用程序。 I am really in a mess. 我真是一团糟。

Combining EJB 3.0 and Spring is a bit unusual since these are competing and largely overlapping technologies. 将EJB 3.0和Spring结合起来是有点不寻常的,因为它们是相互竞争的技术,并且在很大程度上是重叠的。

Nevertheless Spring has a very strong EJB integration that allows you to inject EJBs directly to Spring beans. 尽管如此,Spring具有非常强大的EJB集成 ,使您可以将EJB直接注入到Spring bean中。 There is no easy way to achieve this the other way around. 反之,没有简单的方法可以做到这一点。

For the Hibernate part, you should have a look at JPA 1.0 ( 2.0 comes with EJB 3.1 I believe ). 对于Hibernate,您应该看一下JPA 1.0( 我相信EJB 3.1附带了2.0 )。 Hibernate implements this standard, which is part of the EJB spec. Hibernate实现了该标准,它是EJB规范的一部分。 JPA also seamlessly integrates with Spring: 13.5 JPA . JPA还与Spring: 13.5 JPA无缝集成。

I don't see a reason to use EJB with Spring unless you use MDBs. 除非您使用MDB,否则我看不出将EJB与Spring一起使用的理由。 I would suggest you to use Spring+Hibernate+JPA(if needed). 我建议您使用Spring + Hibernate + JPA(如果需要)。

Look into petclinic application provided by springsource. 查看springsource提供的petclinic应用程序。 Here is an svn path. 这是一个svn路径。 Just search for 'Spring petclinic' for more details. 只需搜索“ Spring petclinic”以了解更多详细信息。

The svn location: https://src.springframework.org/svn/spring-javaconfig/trunk/samples/org.springframework.config.java.samples.petclinic svn位置: https : //src.springframework.org/svn/spring-javaconfig/trunk/samples/org.springframework.config.java.samples.petclinic

I don't see a reason to use Spring with EJB, unless you mean Spring MVC. 我看不出将Spring与EJB一起使用的理由,除非您的意思是Spring MVC。 I would suggest you to use EJB+JPA+CDI(if needed). 我建议您使用EJB + JPA + CDI(如果需要)。

Look into some Java EE 6 examples, for example look on the blogs of Adam Bien, BalusC and JDevelopment. 查看一些Java EE 6示例,例如,查看Adam Bien,BalusC和JDevelopment的博客。 They nicely show how easy and simple Java EE is. 它们很好地展示了Java EE是多么容易和简单。

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

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