Announcement Announcement Module
No announcement yet.
Spring ROO JPQL Query editor Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring ROO JPQL Query editor


    I'm new to java, hibernate, spring roo and spring mvc. My IDE is Spring Source Tools

    What hibernate (JPQL) query editor do you suggest for testing hibernate (JPQL) queries?

    I've tried installing jboss hibernate tools for eclipse, but had no success in configuration. When I try to browse Database, I'm getting this error

    An internal error occurred during: "Fetching children of Database". org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/ThrowableV

    I've tried to configure maven to use older version slf4j (1.5.8) but that didn't resolved the issue.

    I've found recommendation for HQE editor, but it's not available (Not found)

    What is the easiest way to try Hibernate (JPQL) Queries with Spring Roo? What tool do you suggest?
    Last edited by ashikwindu; Apr 11th, 2011, 07:26 AM.

  • #2

    I'm trying to run queries using unit tests,

    When I try to inject EntityManager using lines bellow:

        private EntityManager em;
    I'm getting null pointer exception, because em is null.

    What is the correct way to load entity manager in unit test?


    • #3
      I am bumping this because there is no answer...

      I would not consider myself a "novice" with Spring Roo, but I too am looking for a tool to build/run JPQL/HQL queries. Frankly, its tiresome and boring to run my entire app just to try some new query, and frankly I am lazy and don't like work. I'd love to have a view in Eclipse I can just copy/paste some JPQL/HQL into, run, and see the results.

      I too tried to install the Hibernate Tools from JBoss. And, like the OP, I too got the failure once I set things up. The issue is that STS and Hibernate Tools use a different version of some Apache log library, with Hibernate Tools using an older version. Again, my laziness kicked in, and I abandoned any further attempt.

      Then I read about Dali. It seems STS has it installed, or at least I have some of the views. I added the JPA Facet to my project, setup the appropriate items, and told it to suck up all Annotated entities. The plugin seemed to know my DB connection right-off, so I was excited. But, nothing ever popped up in the JPA Structure or JPA Details views. I think, from reading other examples on how to use the plugin, it's keying off the @Entity annotation, but the latest versions of Roo dropped it in place of @RooJpaActiveRecord.

      So, long-post-short: Is it even possible to get this working, or am I just wasting time dreaming of a better life with a tool that could maybe save some time? Or, should I just bite the bullet and figure out some other way to do what I want to do? Are there any suggestions on other tools?


      • #4
        Have you guys considered trying Squirrel?


        • #5
          Yes, I thought of the Hibernate plugin for Squirrel. However, in looking at the setup panel, I don't see anyone to set it up without using physical Hibernate XML configs. Since Roo is doing everything in JPA w/ Annotations, I don't think these Hibernate configs are created. Perhaps I am wrong...


          • #6
            I don't have my Roo project available here right now for checking files, but I remember having edited persistence.xml. maybe I'm wrong.
            in any case, check if this could help you: