O'Reilly logo

Spring Roo 1.1 Cookbook by Ashish Sarin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating applications that interact with multiple databases

As of Spring Roo 1.1.3, both entity and persistence setup commands support the persistenceUnit argument which lets you create enterprise applications which interact with multiple databases. In this recipe we'll create two persistent units:

  • flight: the flight persistence unit consists of a single entity, Flight. It uses Hibernate as a JPA provider and maps to a MySQL database named "myFlightDB".
  • payment: the payment persistence unit consists of a single entity, Payment. It uses Hibernate as the JPA provider and maps to a MySQL database named "myPaymentDB".

Getting ready

Exit the Roo shell and delete the contents of the C:\roo-cookbook\ch02-recipes directory.

Start the Roo shell from the C:\roo-cookbook\ch02-recipes ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required