1Z0-898 · Question #16
An application has three entities: the mapped super class person class entity, and the parent and child entities, which are subclasses of person. The application has created four entity Instances…
The correct answer is B. Person1, parent1, child1, and child2 will be removed from cache. D. Result is false. evict(java.lang.Class cls) Remove the data for entities of the specified class (and its subclasses) from the cache.
Question
An application has three entities: the mapped super class person class entity, and the parent and child entities, which are subclasses of person. The application has created four entity Instances:
Person1 is a Person entity with a primary key of 50 Parent1 is a Parent entity with a primary key of 100 Child1 is a chi id entity with a primary key of 400 Child2 is a child entity with a primary key of 600 Caching has been enabled in the persistence unit, the persistence provider supports caching, and none of entities have the Cacheable annotation applied, or a cacheable XML element in persistence.xml. The application executes the following code:
Cache cache = . . . ; Cache.evict(person.class) Boolean result = cache.contains (Child.class, 400); Assume there is no concurrent activity involving the cache. Which two statements are correct? (Choose two)
Options
- AOnly person1 will be removed from cache.
- BPerson1, parent1, child1, and child2 will be removed from cache.
- CResult is true
- DResult is false
How the community answered
(28 responses)- A18% (5)
- B71% (20)
- C11% (3)
Explanation
evict(java.lang.Class cls) Remove the data for entities of the specified class (and its subclasses) from the cache.
Topics
Community Discussion
No community discussion yet for this question.