concept JPA in category camel

appears as: JPA
Camel in Action

This is an excerpt from Manning's book Camel in Action.

There are a number of Camel components that provide minor error-handling features: File, FTP, Mail, iBATIS, RSS, Atom, JPA, and SNMP. These components are based on the ScheduledPollConsumer class, which offers a pluggable PollingConsumerPollStrategy that you can use to create your own error-handling strategy. You can learn more about this on the Camel website, at http://camel.apache.org/polling-consumer.html.

The Spring beans file shown in listing 7.10 does a number of things to set up JPA. First off, it creates a Camel JpaComponent and specifies the entity manager to be used . This entity manager is then hooked up to OpenJPA and the HyperSQL order database . It also sets up the entity manager so it can participate in transactions .

There is one more thing left to configure before JPA is up and running. When the entity manager was created in listing 7.10 , you set the persistenceUnitName to "camel". This persistence unit defines what entity classes will be persisted, as well as the connection information for the underlying database. In JPA, this configuration is stored in the persistence.xml file in the META-INF directory on the classpath. Listing 7.11 shows the configuration required for your application.