ignoreJPAEntities

Description

With the help of this configuration toggle it is possible to remove all calls to a JPA entity from the sequence flow because entities are often only simple POJOs.

Default value

The default value of this toggle is false.

Example

Here is an example from the JUnit tests using this configuration parameter:

// ARRANGE
PlantUMLSequenceDiagramConfigBuilder builder = new PlantUMLSequenceDiagramConfigBuilder(
		classUnderTest.getName(), "doSomeBusiness").withIgnoreJPAEntities(true); (1)
PlantUMLSequenceDiagramGenerator generator = new PlantUMLSequenceDiagramGenerator(builder.build());
String expectedDiagramText = IOUtils.toString(
		Objects.requireNonNull(classLoader.getResource("sequence/0003_jpa_test_with_ignore_jpa_entities.txt")), StandardCharsets.UTF_8);

// ACT
String generatedDiagram = generator.generateDiagramText();

// ASSERT
assertAll(() -> assertNotNull(generatedDiagram), () -> assertEquals(expectedDiagramText.replaceAll("\\s+", ""),
		generatedDiagram.replaceAll("\\s+", "")));
1 activate "ignore JPA entities" toggle

which is rendered this way:

0003_jpa_test_with_ignore_jpa_entities_diagram

and produces this PlantUML diagram text:

@startuml

participant MovieService
participant MovieDAO
participant EntityManager
participant EntityTransaction

activate MovieService
	MovieService -> MovieDAO : getMovie
	activate MovieDAO
		MovieDAO -> MovieDAO : getEntityManager
		activate MovieDAO
			MovieDAO --> MovieDAO
		deactivate MovieDAO
		MovieDAO -> EntityManager : find
		activate EntityManager
			EntityManager --> MovieDAO
		deactivate EntityManager
		MovieDAO -> EntityManager : detach
		activate EntityManager
			EntityManager --> MovieDAO
		deactivate EntityManager
		MovieDAO --> MovieService
	deactivate MovieDAO
	MovieService -> MovieDAO : saveMovie
	activate MovieDAO
		MovieDAO -> MovieDAO : getEntityManager
		activate MovieDAO
			MovieDAO --> MovieDAO
		deactivate MovieDAO
		MovieDAO -> EntityManager : getTransaction
		activate EntityManager
			EntityManager --> MovieDAO
		deactivate EntityManager
		MovieDAO -> EntityTransaction : begin
		activate EntityTransaction
			EntityTransaction --> MovieDAO
		deactivate EntityTransaction
		MovieDAO -> EntityManager : persist
		activate EntityManager
			EntityManager --> MovieDAO
		deactivate EntityManager
		MovieDAO -> EntityManager : getTransaction
		activate EntityManager
			EntityManager --> MovieDAO
		deactivate EntityManager
		MovieDAO -> EntityTransaction : commit
		activate EntityTransaction
			EntityTransaction --> MovieDAO
		deactivate EntityTransaction
		MovieDAO --> MovieService
	deactivate MovieDAO
deactivate MovieService

@enduml

Without the parameter the diagram would look like this:

0003_jpa_test_without_options_diagram