posted 11 years ago
I'm not sure about the maturity of Spring Data JPA in general, but in terms of integration with Spring it's been available since Roo 1.2.0, close to 6 months.
I would highly recommend that instead of Active Record. I'm not a big fan of it, unless you have a really simple data model, or a quick CRUD application to write. The problem is, everything eventually gets bigger, more complex, and needs multi-entity methods for cross-domain transactions, etc...
So I'm a big fan of this approach:
1. Use services and repositories (hence the Spring Data JPA ones)
2. Use the automatic building of the Spring Data JPA repositories, but then implement a class that you move the annotations to, and add your own methods to that repository.
3. Also, you can feel free to create non-generated repositories for straight JPA methods and key data services. It's Spring after all.
Then there's the question of whether to trust the whole 'session in view' thing, which I'm not a huge fan of but understand why it exists. I would probably begin with exposing the entities (carefully) but then creating DTOs where needed (intermediate calculations, web-only results or information) so you do the 80/20 approach.
Some feel more strongly about the whole DTO -vs- exposing entities thing, and for them I say it depends on the situation but I'd not disagree with creating DTOs. The case can be made for a Roo add-on to generate DTOs based on annotations of the entities.
I fact, think of it, maybe:
Now you've gone and given me an idea... Darn!
(Sorry, my sense of humor involves silly comments - please excuse me for the week).