Announcement Announcement Module
No announcement yet.
Spring Data Examples not working? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Data Examples not working?

    I downloaded the Spring Data Examples from

    and at least one of them seems to be broken. It references a non-existent class t in the file

    I'd really like to get this working so I can see all the cool Spring Data stuff working - has anybody gotten these examples working? If so, how?

  • #2
    The "Q" classes (i.e., QAccount, QCustomer) are those which QueryDSL needs to do its work.

    You have to run the Maven goals "clean generate-sources" on the project in order to create them. If you look in the pom.xml file, you'll see


    Create a "Runtime Configuration" under the "Maven Build" node, assuming you are using STS, or have the Maven Eclipse plugin installed. Here's a screen shot of my configuration:


    Once you have configured this, select the project node in Package Explorer and run the configuration.

    An alternative to doing this inside STS/Eclipse would be to do this from a command line, assuming you have mvn installed:
    mvn clean generate-sources

    Once you do that, you will see the generated files in the target/generated-sources/queries.
    Attached Files
    Last edited by pfurbacher; Jul 17th, 2013, 08:54 AM.


    • #3
      Thank you! I have not worked with generated source files in Java before; I guess I have some reading to do. Thanks again.


      • #4
        The subject of "generated source files in Java" could be a rather wide-ranging and nebulous one.

        I think you would save time by just reading the QueryDSL docs related to the issue.

        Getting started with Querydsl

        Querying JPA

        A quick search for "generate" across all files in the JPA examples you referred to in the original message did not find any statement regarding how to generate the required supporting files. If you have the time, it might good idea to file a JIRA issue to the effect that some mention of running the generate-sources goal is necessary in the readme file.