-
1. Re: Hibernate tools for Hibernate 4.x
marcelstoer Aug 13, 2012 7:47 AM (in response to marcelstoer)1 of 1 people found this helpfulNever mind...
My findings:
- Building 4.0.0 SNAPSHOT myself sort-of work (odd dependencies to Eclipse stuff not in Maven Central).
- Using the manually built 4.0.0 SNAPSHOT in my own Maven build to run hbm2ddl failed with some Ant errors. I suspected Ant version conflicts (two different Ant versions in classpath). Specifically excluding Ant from the 4.0.0 SNAPSHOT dependency yielded no sensible result. The build didn't fail but no DDL was produced.
- I had to revert all my changes and re-add the @Type annotations :-( I realized that hbm2ddl run from Hibernate tools during a Maven build can never do without because there's nothing there that would populate the type registry (equivalent to what Usertype does when the app runs).
All in all several wasted hours just to realize that Hibernate 4 auto-registration is cool but useless if you still depend on hbm2ddl during Maven build.
-
2. Re: Hibernate tools for Hibernate 4.x
maxandersen Aug 13, 2012 8:06 AM (in response to marcelstoer)1 of 1 people found this helpfulheya, sorry for not responding sooner (vacation time).
yes, you should be able to use trunk on github - fixing the lack of proper tags in the master repo this week so stay tuned.
About autoregistered usertypes, can you show me the code you actually want to have executed ?
There might be a hook - and if not we actually should get such hook created.
-
3. Re: Hibernate tools for Hibernate 4.x
jackalista Aug 13, 2012 3:23 PM (in response to maxandersen)Hi Max,
I have a more general question about using hibernate tools to reverse engineer domain objects from an exisitng database. Is there some content on here somewhere to show how to do that? I've not found any discussions that relate to the current tools set for eclipse indigo and the plugins for hibernate tools. I did get the tools installed successfully but I'm not seeing how to reverse engineer hibernate domain objects from our DB. All the discussions I did see about reverse engineering this stuff appear to be in seam discussions, so I tried to create a seam project and see if that made things clearer but I'm still not seeing a way to get this working. Any pointers to how this is supposed to be done? Thanks.
-
4. Re: Hibernate tools for Hibernate 4.x
marcelstoer Aug 13, 2012 3:36 PM (in response to maxandersen)Better late than never they say...
yes, you should be able to use trunk on github - fixing the lack of proper tags in the master repo this week so stay tuned.
I added my hand-woven 4.0.0 tools SNAPSHOT to the hibernate3-maven-plugin and experienced the described the Ant issues. I don't think this is a use case you actually test. Why should you..once tools 4.0.0 is out the Maven plugin maintainer(s) have to take care of that. IMO there's little hope, though. Never got any feedback to the post I sent to their mailing list.
About autoregistered usertypes, can you show me the code you actually want to have executed ?
We use the Usertype library to map Joda Time data types via Hibernate (it's also JSR-310 compliant). It provides several implementations of org.hibernate.integrator.spi.Integrator. The relevant abstract class is AbstractUserTypeHibernateIntegrator (autoRegisterUsertypes()). The relevant sub class that provides implementations of getUserTypes() and getCompositeUserTypes() is UserTypeJodaTimeHibernateIntegrator.
-
5. Re: Hibernate tools for Hibernate 4.x
maxandersen Aug 14, 2012 4:45 AM (in response to jackalista)Answered in your own thread at https://community.jboss.org/message/753399#753399
Please don't cross-post
-
6. Re: Hibernate tools for Hibernate 4.x
maxandersen Aug 14, 2012 4:25 AM (in response to marcelstoer)yes, you should be able to use trunk on github - fixing the lack of proper tags in the master repo this week so stay tuned.
I added my hand-woven 4.0.0 tools SNAPSHOT to the hibernate3-maven-plugin and experienced the described the Ant issues. I don't think this is a use case you actually test. Why should you..once tools 4.0.0 is out the Maven plugin maintainer(s) have to take care of that. IMO there's little hope, though. Never got any feedback to the post I sent to their mailing list.
yeah, I wasn't involved in hibernate3-maven-plugin; that was all externally done and I've rarely heard from them either. I wanted them to contribute it so the maven plugin could work more or less the same as the ant tasks and eclipse integration. Just never materialized ;(
But its sure that they can't run with hibernate4 jars in a hibernate3 plugin - that will never work without changes.
About autoregistered usertypes, can you show me the code you actually want to have executed ?
We use the Usertype library to map Joda Time data types via Hibernate (it's also JSR-310 compliant). It provides several implementations of org.hibernate.integrator.spi.Integrator. The relevant abstract class is AbstractUserTypeHibernateIntegrator (autoRegisterUsertypes()). The relevant sub class that provides implementations of getUserTypes() and getCompositeUserTypes() is UserTypeJodaTimeHibernateIntegrator.
I haven't done much work with auto registered types but my understanding was that these jars just needed to be on the classpath when "starting" hibernate. Do you have these usertypes on the classpath ?
if yes, then yes we definitely need to add in a hook for this to happen and I would appreciate if you could open a issue on https://jira.jboss.org/jira/browse/JBIDE with a small example that fails for you.
Thanks!
-
7. Re: Hibernate tools for Hibernate 4.x
maxandersen Aug 14, 2012 4:36 AM (in response to maxandersen)just learned that the auto type registration happens at SessionFactory creation time - that explains why you don't see those types.
we should try fix this in tools - please open a https://jira.jboss.org/jira/browse/JBIDE issue with an example so we can be sure to cover your usecase - thanks!
-
8. Re: Hibernate tools for Hibernate 4.x
thomas.letsch Jan 16, 2013 11:06 AM (in response to maxandersen)I got the latest hibernate-tools running under maven with the help of the ant-run plugin. The solution is described in more details in my blog: http://www.thomas-letsch.de/2013/generate-ddl-with-hibernate-tools-jpa-and-maven/. If this works for others as well, there is no urgent need for a newer hibernate3-maven-plugin anymore.
-
9. Re: Hibernate tools for Hibernate 4.x
schvanhugten Dec 10, 2013 10:15 AM (in response to marcelstoer)I checked the projects (hibernate-tools and hibernate3-maven-plugin) out from SVN and GIT and recompiled them against 4.2.7.SP1 jars. I think every goal now works, but I have only really tested hbm2ddl. You can check out the jar (and source code) at http://sourceforge.net/projects/hibernate4mavenplugin/files/?source=navbar.
-
10. Re: Hibernate tools for Hibernate 4.x
jzwolak Jan 20, 2014 3:25 PM (in response to marcelstoer)Any update on this? It seems that Hibernate Tools is not under active development. On GitHub I see the last commit was 1-2 years ago, depending. The JBoss tools seem to have engulfed hibernate tools, but the version for hibernate tools remains at 3.3.0 M5 and seems old and out of date (last copyright from 2011).
I have a successful build system using Hibernate tools from Maven Central: org.hibernate:hibernate-tools:4.0.0-CR1
But I worry about the future and even if what I'm using is stable or the latest of what's available.
-
11. Re: Hibernate tools for Hibernate 4.x
maxandersen Jan 21, 2014 3:40 AM (in response to jzwolak)Where are you seeing the version remains at 3.3.0.M5 ?
MAster is at 4.0 at https://github.com/hibernate/hibernate-tools
But yes, hibernate tools have only received maintanence patches in a long time - I/we haven't had anything to do with the maven integration though.
If anyone is up for maintaining and moving hibernate tools forward in and outside of eclipse ping me.
-
12. Re: Hibernate tools for Hibernate 4.x
jzwolak Jan 25, 2014 2:43 PM (in response to maxandersen)Hibernate Tools Reference Guide
Which is linked to (indirectly) from here: Reference - JBoss Community
-
13. Re: Hibernate tools for Hibernate 4.x
karlvr Jan 27, 2014 10:55 PM (in response to jzwolak)I've had similar issues and went down a rabbit hole updating Hibernate Tools to Hibernate 4.3.1.Final. It works now for my use. I've submitted a pull request to start the conversation hopefully to update Hibernate Tools. Here's my Github repo karlvr/hibernate-tools · GitHub
-
14. Re: Hibernate tools for Hibernate 4.x
jzwolak Feb 11, 2014 12:54 PM (in response to karlvr)Hi Karl, it seems that your pull request was accepted. I wonder if I get the source from hibernate/hibernate-tools · GitHub , will it work? Are all your changes in the hibernate tools master branch now?