rocking
rocking

Reputation: 4919

How to know which framework is used?

I have been made to involve recently in a new project and I am completely unaware of which framework is used.After a long time I came to know spring is used because I saw some imports like

import org.springframework.beans.factory.annotation.Configurable; 

and I am sure spring is used.Now I am completely unaware of whether hibernate is used or jpa is used.When I asked my colleague then some are telling jpa is used and some are telling hibernate that means they are also confused.Can any body please throw some light regarding this.How would I know jpa or hibernate is used.

which packages should be imported specifically for jpa or hibernate.Any hint please

Upvotes: 6

Views: 12032

Answers (3)

geoand
geoand

Reputation: 64079

What is probably going on, is that the project is using Hibernate as an implemention of JPA.

To check and see is JPA is used, check the code and see whether or not you can find EntityManager or EntityManagerFactory

One way to see if Hibernate is being used, is to check the Spring configuration and see whether or not HibernateJpaVendorAdapter is used anywhere

In case you are have a persistence.xml file, HibernateJpaVendorAdapter shouldn't be present anywhere, and you can check if hibernate is mentioned anywhere in the file

Upvotes: 5

V G
V G

Reputation: 19002

As you use Maven, you could list all dependencies (inclusive those transitive) using the dependency plugin. Execute in the root folder the following command:

mvn dependency:tree

There you could check what version of hibernate is used and if hibernate-jpa is used.

Upvotes: 3

Kojotak
Kojotak

Reputation: 2070

Check out your project for pom.xml. This is configuration file for Maven, which handles dependencies (and how your project is build). With IDE or even with command line, you can display all used dependencies and frameworks.

Upvotes: 5

Related Questions