Exam Code: 1Z0-898 (Practice Exam Latest Test Questions VCE PDF)
Exam Name: Java Platform, Enterprise Edition 6 Java Persistence API Developer Certified Expert Exam
Certification Provider: Oracle
Free Today! Guaranteed Training- Pass 1Z0-898 Exam.
2021 May 1Z0-898 Study Guide Questions:
Q11. The developer has modeled student interests as a set <String>:
@Entity public class Student {
@Id int student Id;
string name;
@ElementaryCollection
Set <String> Interests;
. . .
}
The developer wants the values of this set to be stored using a column named student_intersets.
Select the item below that accomplishes this task:
A. @ElementaryCollection @Column(name = “student_interests”) Set <string> interests;
B. @ElementaryCollection (column = “student_intersets”) Set<String> interests;
C. @ElementaryCollection @CollectionTable (column = “student_intersets”) Set<String> interests;
D. @ElementaryCollection @CollectionTable (column = @column(name = “student_interests”)) Set <String> interests;
Answer: D
Q12. Which statement is correct about the Java Persistence API support for the SQL queries?
A. SQL queries are NOT allowed to use parameters.
B. The result of an SQL query is not limited to entities.
C. Only SELECT SQL queries are required to be supported.
D. SQL queries are expected to be portable across databases.
Answer: B
Q13. If a Persistence application locks entity x with a LockModeType.OPTIMISTIC_FORCE INCREMENT lock type, which statement is true?
A. The Persistence application must increment the version value prior to locking the entity.
B. This operation will result in a PersistentLockException for a non-versioned object.
C. This operation will result in a PersistentLockException if the version checks fail.
D. LockModeType.OPTIMISTIC_FORCE_INCREMENT is the synonym of the LockModeType.WRITE lock type.
Answer: D

Regenerate 1Z0-898 practice exam:
Q14. The embeddable class ContractInformation is used in an element collection of the Employee entity.
@Entity
Public class Employee {
@Id int empId;
@ElementaryCollection Set <ContractInformation> info;
. . .
}
Assume that the phone class is an entity and that address is an embedded class.
Which two of the code segments below can be used to model the state of ContractInformation? (Choose two)
A. @OneToMany Set <phone> phones;
B. @Embeddable Address address;
C. @ManyToOne phone phone;
D. @ElementaryCollection <Phone> phones;
E. @OneToOne Address address;
Answer: AB
Q15. A developer wants to ensure that an entity's data is up-to-date with regard to the database. Which of the following statements is guaranteed to accomplish this?
A. Call EntityManager.refresh on the entity.
B. Add acacheable (false) annotation on the entity class.
C. Call EntityManager.find on the entity.
D. Use a named query to retrieve the entity.
Answer: C
Q16. The developer wants to write a portable criteria query that will order the orders made by customer James Brown according to increasing quantity. Which one of the below queries correctly accomplishes that task?
A. CriteriaBuilder cb= . . .
CriteriaQuery<order> cq = cb.createquery<order.class>
Root <customer, order> 0 = cq.from(customer.class);
Join <customer, order> 0 = c.Join(customer-.orders);
cq.where (cb.equal(c.get(customer_.name, James Brown)));
cq.orderBy (0.get (order_.quantity));
B. CriteriaBuilder cb= . . .
CriteriaQuery<order> cq = cb.createquery<order.class>
Root <customer, order> 0 = cq.from(customer.class);
Join <customer, order> 0 = c.Join(customer-.orders);
cq.where (cb.equal(c.get(customer_.name, James Brown))); cq.select(0);
cq.orderBy (0.get (order_.quantity));
C. CriteriaBuilder cb= . . .
CriteriaQuery<order> cq = cb.createquery<order.class>
Root <customer, order> 0 = cq.from(customer.class);
Join <customer, order> 0 = c.Join(customer-.orders);
cq.where (cb.equal(c.get(customer_.name, James Brown)));
cq.orderBy (0.get (order_.quantity));
cq.select(0);
D. CriteriaBuilder cb= . . .
CriteriaQuery<order> cq = cb.createquery<order.class>
Root <customer, order> 0 = cq.from(customer.class);
Join <customer, order> 0 = c.Join(customer-.orders);
cq.where (cb.equal(c.get(customer_.name, James Brown)));
cq.orderBy (0.get (order_.quantity));
cq.orderBy (“quantity”);
Answer: C

100% Guarantee 1Z0-898 questions:
Q17. A developer has created a deep entity class hierarchy with many polymorphic relationships between entitles. Which inheritance strategy, as defined by the inheritanceType enumerated type, will be most performed in this scenario?
A. Single table-per-class-hierarchy (InheritanceType.SINGLE_TABLE)
B. Joined-subclass (inheritanceType. JOINED)
C. Table-per-concrete-class (inheritanceType.TABLE_PER_CLASS)
D. Polymorphic join table (inheritanceType. POLYMORPHIC_JOIN_TABLE)
Answer: C
Q18. An application wants to utilize side effects of cascading entity manager operations to related entities.
Which statement is correct?
A. The persist operation is always cascaded to related entitles for one-to one and one-to-many relationships.
B. To minimize the effect of the remove operation applied to an entity participating in a many-to-many relationship the remove operation should hecascadeto entities on both sides of the relationship.
C. The persist operation applied to a new entity x is cascaded to entities referenced by x if the relationship from x to these other entities is annotated with the cascade=PERSIST or cascade=ALL annotation element value.
D. The remove operation applied to a removed entity x is cascaded to entities referenced by x of the relationship from x to these other entities is annotated with the cascade = REMOVE of cascade = ALL annotation element value.
Answer: C
Q19. A session bean business method throws an exception during execution.
Which two are responsibilities of the Bean Provider when throwing the exception? (Choose two.)
A. For application exceptions, ensure that ifthe current transaction commits there will be noloss ofdata integrity.
B. For application exceptions, ensure that the current transaction will commit.
C. For system errors, when the client is remote through a java.rmi.remoteException that wraps the original exception.
D. For checked exceptions from which the bean cannot recover, throw an EJBException that wraps the original exception.
Answer: AD
Q20. 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?
A. The name property was loaded from the database.
B. The name property was NOTbeloaded from the database.
C. The name property may or may not have been loaded from the database.
D. The photo property was loaded from the database.
E. The photo property was NOT loaded from the database.
F. The photo property may or may not have been loaded from the database.
Answer: AD