Eclipse plugins for Spring / Hibernate development? - eclipse

I have a running dynamic web project in Eclipse (Java EE + Maven + Spring). I am at the point where I need to integrate a persistence layer and want to use Hibernate with a MySql database.
I am wondering what plugins would be useful for me at this point? For Hibernate should I install hibernate tools or is it not necessary? Are then any plugins that are most widely use for connecting / exploring database connections that would be appropriate for the type of project I am working on? Thanks.

Hibernate Tools is definitely a nice plugin (that provides wizards, a nice console useful to setup the HQL queries, a mapping editor, etc). I'm actually tempted to say: why not using it? I use it in conjunction with the database support provided by the Eclipse Data Tools Platform (that is included in the Eclipse IDE for Java EE Developers or available via the update manager). In your case, I would maybe just consider using SpringSource Tools Suite as base instead of a vanilla Eclipse.
Update: As reminded by BalusC in a comment, the Hibernate Tools also include a database reverse engineering tool which is maybe the most powerful feature. I should have mentioned it, this is now fixed.

You can look at http://fast-code.sourceforge.net/ as well. You can create FooService and FooServiceImpl and the configurations just by typing foo. It has nice way to create unit tests as well.

Related

Spring Tools Suite, JPA project and the JPA facet

I am using a fresh install of STS 3.8.3 and I am unable to add the JPA facet to an EJB project:
If I try to create a JPA project, I cannot find that option:
I am certain these used to be available in STS. What did I miss?
We removed those extensions from the default distribution because users reported severe issues (search for JPA Event Handler on SO). In order to avoid this we decided to remove those tools from the distribution and added them to the extension install, so that you can get them back into STS quite easily.
However, we can revisit that decision in the future, if those tools don't cause those issues anymore.
Upon further investigation I discovered that the Eclipse Web Tools Platform at eclipse update site http://download.eclipse.org/webtools/repository/neon includes the following:
Why is this no longer configured in STS? That is really too bad and not a good decision in my opinion.
Go to Help -> Install New Software -> in the work with drop down , choose one with "https://download.eclipse.org/releases/*".
In the result you will be able to see Database Development.
Choose the database you wish to configure.

How do I add Hibernate to an existing Eclipse project? Is Hibernate the same as JPA?

I have searched. I can't find the exact way that matches what I have. I installed Eclipse for Java EE. I then went to help and install new software. Put in the jboss url, downloaded the Hibernate libraries. Everything went fine. I also installed the JDBC driver for MySQL. I tested it. It works. Downloaded and installed slf4j because I read someone that said to (hey, I'm learning).
I started a new Java EE project, and uh, I'm kind of stuck after that. It's a "Hello World" at the moment.
I can't find out what to do. I've seen tutorials where it says create a Hibernate project, but what if I want to add it later after I start a "normal" project? I don't want to manually look for the Hibernate.jar in the download folder. I installed it and want to know how to get to it.
I also saw lots of things that said JPA and Hibernate. Are they the same thing?
EDIT: I was able to find Hibernate by right clicking on the project, new, scroll down to hibernate. I am still interested in JPA and Hibernate.
JPA stands for "Java Persistence API", and it is a specification. It basically defines the APIs and behaviors of a persistence layer, and there are different implementations of the JPA specification. Hibernate is one of these implementations. There are a few others, e.g.:
http://www.oracle.com/technetwork/middleware/toplink/overview/index.html
http://openjpa.apache.org/
The JPA specification can be found here:
http://jcp.org/aboutJava/communityprocess/final/jsr317/index.html

weblogic data source not listed in eclipse

I was developing java ee applications in netbeans, for some reason I jumped to eclipse.
In netbeans when I click on "entity classes from database" I used to see oracle's data source, basically the database. And easily I used to create my beans.
Now, is there any way to do so in eclipse? If so, how to do that?
There is no direct equivalent for the netbeans functionality you are seeking in eclipse (or at least not that I know of in the stock eclipse install).
For starters, you should be using the eclipse version built for Java EE developers. It has a Data source explorer as one of the tabs. Here, you can add data sources that you can use to configure your applications.
More information here.

How to specify Library Provided at Runtime for Hibernate - Eclipse Dali JPA integration

I am trying to add Eclipse Dali JPA integration and to specify Hibernate as the JPA implementation. I have gathered different instructions but am struggling with specifying the user library when configuring the project facet. The page here (http://docs.redhat.com/docs/en-US/JBoss_Developer_Studio/4.0/html/Hibernate_Tools_Reference_Guide/dali_integration.html) shows an option that says Library Provided by Target Runtime but I don't have this option. I have User Library and Disable Library Configuration. I'd rather not download the hibernate jars and store them separately for eclipse configuration when I already have them specified in the project with maven. And the disable option leaves the configuration in error.
Anyone have any tips for getting that option or another suggested Hibernate/JPA configuration within Eclipse?
Thanks all.
If you are already doing library management with Maven and m2e, you should select Disable Library Configuration option. Yours is exactly the scenario that option was intended for. If you specify the errors you get when you follow this approach, someone may be able to help find the complete solution.
Alternatively, follow the User Library option and create a user library using the Hibernate jars you already have locally. There is no need to re-download them.

What IDE (Eclipse or Aptana) and What tools i need to develop a JSP Project

I need to create a web based project where I will use java codes to do the back-end processing and database connections. So I need to write my code in JSP. I already installed tomcat.
But in Aptana i do not get the option "New Dynamic Web Project". Which i have created JSP projects previously. Any one knows how to add it or what toold i need to install?.
I'm not a fan of Aptana; in my experience it's a bloated tool that tries to do too much and does nothing particularly well. I would just get the Eclipse IDE for Java EE Developers package from http://www.eclipse/downloads and use that.