gregsoulsby (30) [Avatar] Offline
#1
I would like to use the QueryDSL functions in Spring Data.

That means creating the repository layer in Roo with this command

repository jpa --interface ~.domain.CfxAddress --entity ~.domain.CfxAddress

Should the name ~.domain.CfxAddress be the same as that that you get from reverse engineering, and thus overwriting the active record created from reverse engineering? Or should you use another name and thus keep them both?

(I tried using the same name, but that wrecked the --testAutomatically tests from reverse engineering. I tried using different but could not get QueryDSL to run as it classed with the no repository domain classed.)
ken.rimple (246) [Avatar] Offline
#2
Re: Using repository layer and reverse engineering. Possible?
Greg,

I've been away from the forums as my day-work has become my night-work for the time being.

Assuming you are following this procedure:

http://blog.springsource.org/2011/04/26/advanced-spring-data-jpa-specifications-and-querydsl/

Do you have any code snippets or exception messages you can share? It looks like if you extend the QueryDSL interface QueryDslPredicateExecutor you should get the ability to create the BooleanExpression statements that you can then chain into calls to your Repository's findAll method.

If you have it going, I'm curious what you think of it. Seems easier than CriteriaBuilder queries to me and much more fluent.

Ken
ken.rimple (246) [Avatar] Offline
#3
Re: Using repository layer and reverse engineering. Possible?
Putting the DBRE aside for the moment, I had trouble getting anything to work on the QueryDSL generators with the pre-built ITDs. Since the actual class doesn't have an @Entity on it (until the AspectJ compiler comes in and adds it) when the QueryDSL is generating code, it doesn't see them as entities.

I push-in refactored one of my entities and it worked - found the entity and build the Q class for it in generated-sources.
gregsoulsby (30) [Avatar] Offline
#4
Re: Using repository layer and reverse engineering. Possible?
That makes sense, even if I dont like it.

In the Spring Roo addins webinar this week you mentioned the developers are putting a lot of effort at the moment into something, which supported a DSL. I heard it as Scala?

So would that be an option instead of QueryDSL?

If so I think I will wait.
ken.rimple (246) [Avatar] Offline
#5
Re: Using repository layer and reverse engineering. Possible?
The topic I was referring to was the Spring Integration team working on a Scala DSL. Kind of like JavaConfig but with Scala syntax and specifically for setting up S/I configurations.

Ken