1Z0-898 · Question #14
A user entity is retrieved in a query and stored in an instance variable user. The user entity has a single valued name property that uses the mapping defaults, and a photo property, which is lazily…
The correct answer is A. The name property was loaded from the database. F. The photo property may or may not have been loaded from the database. An entity is considered to be loaded if all attributes with FetchType.EAGER--whether explictly specified or by default--(including relationship and other collection-valued attributes) have been loaded from the database or assigned by the application. Attributes with…
Question
A user entity is retrieved in a query and stored in an instance variable user. The user entity has a single valued name property that uses the mapping defaults, and a photo property, which is lazily loaded. The application then calls the following method: PersistenceUtil.isLoaded (user); Which two of the following statements are correct?
Options
- AThe name property was loaded from the database.
- BThe name property was NOTbeloaded from the database.
- CThe name property may or may not have been loaded from the database.
- DThe photo property was loaded from the database.
- EThe photo property was NOT loaded from the database.
- FThe photo property may or may not have been loaded from the database.
How the community answered
(27 responses)- A74% (20)
- B7% (2)
- C4% (1)
- D4% (1)
- E11% (3)
Explanation
An entity is considered to be loaded if all attributes with FetchType.EAGER--whether explictly specified or by default--(including relationship and other collection-valued attributes) have been loaded from the database or assigned by the application. Attributes with FetchType.LAZY may or may not have been loaded. Reference:What does PersistenceUtil.isLoaded means?;javax.persistence,Interface PersistenceUtil
Topics
Community Discussion
No community discussion yet for this question.