Can I use Spring-Roo without setting up a database?
I have to start a new Spring MVC project and I've been reading about Roo and it looks quite nice, especially for someone like me who comes from an RoR background.
However, the objects we'll be presenting to our users are really just documents which are already stored in our internal databases, so we have no need for another database. We will most likely have classes which retrieve xml documents from our database and convert them into runtime objects (results lists of documents with links to other documents). Our users will not modify any of these objects, all controllers will have only GET actions.
Can I use Roo without setting up a database? From what I've read so far, Roo just assumes that you are using a database and it doesn't look like you can do much without one. We COULD use a database, but this would just be duplicate storage and I prefer to use our existing systems as a back end to a Roo front end if at all possible.
Point of clarification:
I don't even have direct access to the database where these are stored. This project is more along the lines of data aggregation. My service will be making calls to other services, including an internal search engine which retrieves these documents from various database开发者_如何学JAVAs. So neither do I have a database, nor do I need one. Is this still possible? If I have to set up persistence, can I specify a dummy which will just ignore my resources so it does not try to retrieve them from a database?
You can set up a "dummy" database using HSQLDB which is an internal Java based database that takes up minimal resources. It will satisfy Spring Roo's persistence requirements, and you don't have to use it. Plus, it has a minimal overhead.
Since Roo works with data providers such as Hibernate you do have the flexibility to decide where you want to store your entities. If as you describe you have an existing database then you can configure this in the application so that a new database will not be required. You can specify your entities so that they load directly from the existing database.
You might find this blog entry interesting.
精彩评论