Question

I'm using JBoss Tools to reverse engineer a DB schema into POJO's. Specifically, I'm using the hbm2java option in the hibernatetool ANT task. Under the hbm2java option you can specify ejb3=true to have EJB3 (JPA?) annotations generated in your POJO's. My questions is whether these annotations are JPA annotations? Or, more generally, what is the difference between JPA annotations, Hibernate annotations and EJB3 annotations. Are they all essentially the same?

Was it helpful?

Solution

JPA (Java Persistence API) annotations declare how Java classes should be persisted to a database. Hibernate annotations are an implementation of JPA, plus some extra ones specific to the Hibernate framework. EJB (Enterprise Java Beans) annotations are separate from JPA, and are used to describe more general aspects of business logic within the EJB framework (transactions, concurrency, security, etc.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top