| Exam Code/Number: | 1Z0-898Join the discussion |
| Exam Name: | Java EE 6 Java Persistence API Developer Certified Expert Exam |
| Certification: | Oracle |
| Question Number: | 63 |
| Publish Date: | Dec 05, 2026 |
|
Rating
100%
|
|
Given two entities with one to-one association:
Which code fragment correctly defines the detail field that PersonDetail instance in removed if the person instance that references it is removed?
The developer is creating a Java Persistence model for a legacy database. The database contains customer and subscriptions.
The subscriptions table has a foreign key to the Customer table, a foreign key to the magazines table, and a column that stores a java.util.Date (the subscription expiration date).
The developer wants to create entities Customer and subscription to model these tables and to represent the relationship between customer and subscription as a java.util.Map.
Which one of the following fields of the Customer entity accomplishes this task?
A developer wrote an entity class with the following method:
Private static Logger logger = Logger.getLogger ("myLogger");
@PrePersist @PreUpdate Public void doA () { Logger.info ("A"); } @PostPersist @PostUpdate Public void doB () { logger.info ("B"); }
What will the log message contain when an application does the following?
1.Begins a transaction
2.Creates the entity
3.Persists the entity
4.Commits the transaction
5.Begins the entity data
6.Modifies the entity data
7.Merges the entity
8.Commits the second transaction
FooBean and BarBean are both EJB 3.0 stateless beans with container-managed transaction demarcation. All business methods in FooBean have transaction attribute REQUIRED, and all business methods in BarBean have transaction attribute REQUIRED_NEW. The business method foo in FooBean invokes the Business method bar in BarBean.
Given:
10.
Public class BarBean {
11.
public void bar () {
12.
throw new RuntimeException ("unexpected error . . . ");
13.
}}
Which is true about the method of invocation assuming execution reaches line 12?
A developer wants to model the grades for a student as a Map<course, integer>. Assume that Student and Course are entitles, and that grades are modeled by integers.
Which of the following two statements are correct? (Choose two)