Red Hat Training
A Red Hat training course is available for Red Hat Fuse
5.9. JPA
JPA インテグレーションは Camel JPA コンポーネント によって提供されます。一部の JPA アノテーションが付けられたクラスと合わせて persistence.xml 設定ファイルを指定することで、Camel JPA アプリケーションを開発できます。
5.9.1. persistence.xml の例
以下の例では、JBoss EAP の standalone.xml 設定ファイル内で設定された JBoss EAP インメモリー ExampleDS データソースを使用できます。
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="camel">
<jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
<class>org.wildfly.camel.test.jpa.model.Customer</class>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.show_sql" value="true"/>
</properties>
</persistence-unit>
</persistence>