问题
Preface: I am coming from a .NET and PHP backround. I'm pretty comfortable with making a console app in Java. I've never used an ORM on any platform. I'm trying to learn enterprise java best practices. Therefore, if I sound ignorant, its probably because I am.
I downloaded the latest version of the SpringSource Tool Suite. I want to make a spring project with a JPA mongo (adapter/driver/driver whatever). I'd like to do so with roo. So what I think I need to know is the name of a JPA library that has a mongodb driver.
回答1:
Check out Kundera, it's a JPA 1.0 ORM library for the Cassandra/Hbase/MongoDB database. For info about getting started, see this blog post: Working with MongoDB using Kundera.
回答2:
Please try newer version of Kundera, i.e. 2.0.1. It has gone a major change since its inception and I see a lot of new features getting added and bugs being fixed. Currently it supports JPA 1.0 and Cassandra 0.7.6/ HBase/ MongoDB but we are planning to add support for Cassandra 0.8 and JPA 2.0 very soon. There is a pretty good example here: https://github.com/impetus-opensource/Kundera/wiki/Getting-started
回答3:
You can use Spring data mongodb, is not JPA but is easy to use. Also, Spring roo has support to use it as persistence layer.
Good luck.
来源:https://stackoverflow.com/questions/6079461/using-roo-to-create-a-springsource-project-with-mongo