This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<mule xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:cassandradb="http://www.mulesoft.org/schema/mule/cassandradb" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.3.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" | |
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd | |
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd | |
http://www.mulesoft.org/schema/mule/cassandradb http://www.mulesoft.org/schema/mule/cassandradb/3.2/mule-cassandradb.xsd | |
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd | |
http://www.mulesoft.org/sch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<flow name="dogGroomingFlow"> | |
<vm:inbound-endpoint path="dog.groom.in"/> | |
<transactional> | |
<jpa:merge/> | |
<component class="service.DogServiceImpl"/> | |
</transactional> | |
<vm:outbound-endpoint path="dog.groom.out"/> | |
</flow> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DogServiceImpl { | |
@PersistenceContext | |
EntityManager entityManager; | |
public Dog groom(Dog dog) { | |
return entityManager.merge(dog); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<flow name="testDetach"> | |
<transactional> | |
<jpa:detach/> | |
</transactional> | |
</flow> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<flow name="testMerge"> | |
<vm:inbound-endpoint path="in"/> | |
<transactional> | |
<jpa:merge/> | |
....other processing here.... | |
</transactional> | |
<vm:outbound-endpoint path="foo"/> | |
</flow> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<flow name="testTransactionalInsertAndQuery"> | |
<transactional> | |
<jpa:persist/> | |
<jpa:query statement="from Dog dog where dog.name = 'Cujo'"/> | |
</transactional> | |
</flow> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<flow name="testFind"> | |
<jpa:find entityClass="domain.Dog" id-ref="#[payload:]"/> | |
</flow> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); | |
CriteriaQuery<Dog> criteriaQuery = criteriaBuilder.createQuery(Dog.class); | |
Root<Dog> from = criteriaQuery.from(Dog.class); | |
Predicate condition = criteriaBuilder.equal(from.get("name"), "Cujo"); | |
criteriaQuery.where(condition); | |
runFlowWithPayloadAndExpect("testQuery", expectedResults, criteriaQuery); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<flow name="testQueryWithMapParameters"> | |
<jpa:query statement="from Dog dog where dog.name = :name and dog.breed = :breed" queryParameters-ref="#[payload:]"/> | |
</flow> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<flow name="testQueryWithListParameters"> | |
<jpa:query statement="from Dog dog where dog.name = ?" queryParameters-ref="#[payload:]"/> | |
<vm:outbound-endpoint path="foo"/> | |
</flow> |