Hibernate Tools Not Really Working in IDEA X

Hello,

I am trying to reverse DAO classes and whatever else Hibernate Tools will do for me beyond the basic hibernate configuration file (hibernate.cfg.xml) IDEA creates.

The problem is that when I click on the hibernate.cfg.xml file and select Hibernate Tools, I get errors like "No mapping file selected." This is regardless of which of the three options I pick (for example, add to code generator).

I also get null pointer exceptions and the display of the Hibernate Tools panel on the right side isn't quite right.

Is Hibernate Tools working yet in IDEA 10, and, if so, is there any type of help specific documentation for it?

----

All I'm really trying to do is set up a quick hibernate program (with save, delete, find, etc.) using the tools available for other IDEs. I know IDEA can do it, but some tools (like PMD) aren't yet working in IDEA 10 (reported this one already) even though you can download them.

I can't find any documentation on the Intellij site for this situation.

Thanks in advance.

- M

11 comments
Comment actions Permalink

Hello.

Hibernate Tools plugin (http://plugins.intellij.net/plugin/?idea&id=124) is the 3rd party, it is not supported by JetBrains, and seems to be rather old.

IDEA has built-in Hibernate support. Application Help contains a number of topics on that.

Regards,
Alexander.

0
Comment actions Permalink

Hello Alexander,

Why then is Hibernate Tools shown in the "Available Plug-ins" in IDEA X???

As the customer, I expect anything showing on the Available Plugins to actually work -- at least at some level, and not just crash.

JetBrains should at least do keep non-working plug-ins OFF the "Available" menu.

PMD, a very current source code checker, is also broken in IDEA X.

---------

To your other point above, IDEA  does not seem to have a way to hibernate reverse engineer the DAO level (the reason for needing Hibernate tools).

If you can give me a workaround, or if I'm mistaken here, I would appreciate it (Tutorials, examples???).

BTW, on your own forum, the same basic issue with Hibernate Tools that I was having was being reported back to 2006 with, as I can see, zero resolution.

This reliablity is troubling.

Thanks.

-- M

0
Comment actions Permalink

> Why then is Hibernate Tools shown in the "Available Plug-ins" in IDEA X???

At the moment this is responsibility of plugin authors. Plugin descriptor specifies IDEA versions it is compatible to.
We know that problems of such kind exist. I will send the link to this discussion to persons who can make changes in plugin repository.

> reverse engineer the DAO level

Could you specify, what do you have and what are you trying to get? E.g. IDEA can generate JPA-annotated classes by database schema. Are you trying to do something opposite?

Regards,
Alexander.

0
Comment actions Permalink

Hello Alexander,

Thanks for your reply and attention the plug-in situation.

Regarding the Hibernate Reverse Engineering, with MyEclipse I can reverse engineer a DB Table and it creates the Session Factory, mappings, the entity class, and a DAO class along with Save and Find methods.

How do I do this DAO equivalent with IDEA so I have working Save and Find methods?

Perhaps you do this with a JPA workflow and not Hibernate per se.

Look forward to any help or clarification.

Thanks in advance.

- M

0
Comment actions Permalink

Hi.

IDEA does not generate save and find methods. It generates hibernate config, mapping files and ORM classes sources.

If this can help, the main supported workflow is the following: first, user has to define a data source to connect to the database.
http://www.jetbrains.com/idea/webhelp/creating-data-sources.html

Then enable JPA or Hibernate technology (facet) for a module. It may be done on module creation or for existent module.
http://www.jetbrains.com/idea/webhelp/enabling-hibernate-support.html
http://www.jetbrains.com/idea/webhelp/enabling-jpa-support.html

Then use "Import database schema" dialog. Also available from new module wizard.
http://www.jetbrains.com/idea/webhelp/import-database-schema-import-mappings.html

Basically, that's it.


Regards,
Alexander.

0
Comment actions Permalink

Hi Alexander,

Please don't get me wrong, I like IDEA (I've been buying it for years now), it's just that MyEclipse does (a lot) more for me with a simpler interface (no concepts like "facets" to have to understand -- and configure correctly -- for example). (And, unlike my recent issues with the Hibernate Tools and PMD with IDEA X that didn't work at all for me, MyEclipse's plug-ins really work.)

With Hibernate projects, MyEclipse creates the (fully annotated) DAO logic so I don't have to write that at all. Save, Find, and tons of other conveneince methods are done automatically. I would have to write the class that uses it, of course.

IDEA? Nope.

-----

With MyEclipse for Spring, the story is even stronger. MyEclipse creates (I can pick which, but...) the system, dao, and other application directory, creates all the Spring plumbing code (fully editiable), and reverse engineers fully working front ends from the database (up to 5 front ends, including Flex, are created just by clicking checkboxes).

You end up with source and plubming code you would have taken lots longer to write yourself (but you didn't have to).

MyEclipse for Spring will also FORWARD ENGINEER for you the database tables/relationship given a POJO.

It all works. In about 3 minutes, I can have a fully functional application with several front ends. All the Hibernate code, and other pieces are done. I can edit them if needed.

IDEA? Nope.

----

It seems with IDEA, I have so much more work to do.

I don't want to write Spring plumbing code that takes hours or days to get right.

----

I hope that IDEA becomes a more productive tool soon. I had high hopes for version 10....

For the time being, MyEclipse saves me lots of time each day so I can just concentrate on the application.

Since my project is so time constrained (like most projects, right?), I can only use IDEA for small things, if at all, at the moment.

Thanks again for your reply. :)

-- M

0
Comment actions Permalink

Thank you for the feedback.

BTW, you can create corresponding feature requests in the bug tracker, if you like: http://youtrack.jetbrains.net/dashboard

Alexander.

0
Comment actions Permalink

Hi Alexander,

I wanted to also say on a positive note that IDEA runs perfectly on the Mac.

MyEclipse will not even debug properly for me on the Mac at all.

I'm very happy that IDEA includes the src libs required.

------------

I hope that you can implement a few productivity features (and maybe also tweak your interface a little so it's more straightforward).

>>>> I would rather use IDEA if possible. <<<<<

Any chance of some new productivity features in the 10.X release cycles?

Thanks again.

- M

0
Comment actions Permalink

> Any chance of some new productivity features in the 10.X release cycles?

Basically, 10.0.x are bugfix updates. If you need something specific, better create an issue in YouTrack or comment existent one, so development will be able to estimate the efforts.

Alexander.

0
Comment actions Permalink

>MyEclipse will not even debug properly for me on the Mac at all.

Since these are JetBrains' forums I wish to respect that by refraining from commenting in this thread except to illuminate one MyEclipse-specific point for the record. From the description of this issue and the username, I believe that Mork contacted MyEclipse support and we determined his debugging issue on the Mac was an Eclipse workspace corruption problem that was quickly resolved. For the record, MyEclipse is supported on the Mac and Linux as well as on Windows.

Best regards,
--Scott
MyEclipse Support

0
Comment actions Permalink

Yes, Scott is right.

I apologize for not updating this thread to show the resolution on this issue.

Most of my narrative on MyEclipse, however, Scott, was highly complimentary.

One of the points of my posting was to try to get IDEA to catch up with the excellent MyEclipse features that save me time every day. :)

Thanks Scott.

- M

0

Please sign in to leave a comment.