10 Tips For Updated 1Z0-898 exam question

It is impossible to pass Oracle 1Z0-898 exam without any help in the short term. Come to Actualtests soon and find the most advanced, correct and guaranteed Oracle 1Z0-898 practice questions. You will get a surprising result by our Far out Java Platform, Enterprise Edition 6 Java Persistence API Developer Certified Expert Exam practice guides.


2024 Oracle Official New Released 1Z0-898 ♥♥
https://www.certleader.com/1Z0-898-dumps.html


Q1. An application has two entities, Department and Employee, and there is a one-to-many relationship between them. The application has the following query: 

SELECT d 

FROM Department d LEFT JOIN FETCH d. employees 

WHERE d.name = : name 

After receiving the results of the query, the application accesses the returned department’s Employee entities stored in the Department.employees collection-valued attribute. 

All caching has been turned off in the application. 

Which statement is true? 

A. The database will be accessed once during the query execution phase, and once for each Employee entity in Department - employees. 

B. The database will be accessed once during the query execution phase ONLY. 

C. The database will be accessed once during the query execution phase, and once when the department.employees collection-valued attribute is used. 

D. The database will be accessed once during the query execution phase, once when the Department. Employees collection-valued attribute is used, and once for each employee entity in the Department.employees. 

Answer:

Q2. 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 

Q3. Given the following stateless session bean implementation classes: 

Assuming no other transaction-related metadata, what are the transaction attributes on methodB, and methodC respectively? 

A. MANDATORY, MANDATORY, and MANDATORY 

B. REQUIRED, MANDATORY, andREQUIRES_NEW 

C. MANDATORY, MANDATORY, <and REQUIRES__NEW 

D. REQUIRED, REQUIRES_NEW, and REQUIRES_NEW 

Answer:

Q4. A developer wants to create a Java Persistence query that will include a subquery. 

Which three are true? (Choose three.) 

A. Subqueries can be used in a FROM clause. 

B. Subqueries can be used in a WHERE clause. 

C. The ANY expression can be used only with a subquery. 

D. The EXISTS expression can be used only with a subquery. 

E. The MEMBER expression can be used only with a subquery. 

Answer: BCD 

Q5. A named query that sets an exclusive pessimistic on the entities returned by the query by setting the NamedQuery lockMode element to LockModeType.PESSIMISTIC_FORCE_INCREMENT. The application starts transaction and executes the query. 

Which of the following statements is correct about the entities returned by the query? 

A. Only the current transition may modify or delete the entity instances. 

B. The current transaction may NOT modify or delete the entity instances. 

C. Other concurrent transactions may modify or delete the entity instances. 

D. Other concurrent transactions may modify but MAY NOT delete the entity instances. 

Answer:

Q6. A developer is creating an entity which is mapped to a table that has a primary key constraint defined on two character columns and would like to use mapping defaults as much as possible to simplify the code. 

Which two mapping options can be chosen? (Choose two.) 

A. Use an @id property that constructs a private field as a concatenation of two columns. 

B. Use a separate class to map those two columns and use an @idclass annotation to denote I primary key field or property in the entity. 

C. Use a separate @Embeddable class to map those two columns and use an @EmbeddedId annotation to denote a single primary key field or property in the entity. 

D. Use a separate @Embeddable class to map those two column and add two fields or properties the entity, each marked as @id, that correspond to the fields or properties in the embeddable class. 

E. Use a separate class to map those two columns. Specify that class using @Idclass annotation on the entity class. Add two fields or properties to the entity, each marked as @Id, that correspond to the fields or properties in that separate class. 

Answer: BC 

Q7. Consider a persistence application with the following orm.xml: 

What will be the effect of the above orm.xml? 

A. The access type for only those entities that have not explicitly specified @Access will be defaulted to field. 

B. The access type for all entities in the persistence unit will be changed to FIELD. 

C. The access type for allentities specified in this orm.xmlwill be changed to FIELD. 

D. The access type for only those entities defined in thisorm-xml for which access is notspecified will be defaulted to FIELD. 

Answer:

Q8. 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 

Q9. A developer needs to include a set of managed classes in a persistence unit. Which two solutions are correct? (Choose two.) 

A. Place the class files in the orm.xml file. 

B. Place the class files in the root of the persistence unit. 

C. Place the class files in any mapping file that is included on the classpath. 

D. Place the class files in any jar on the classpath that is included in the persistence unit. 

Answer: AB 

Q10. An application creates a TypedQuery object to perform a query, and sets the query object’s flush mode by calling setFlushMode (FlushModeType.commit). The query is executed within a transaction. 

Which of the following is true? 

A. Updates to the database tables may occur anytime during the transaction associated with the query. 

B. Updates to the entities that can affect the outcome of the query cannot be flushed to the database until the transaction commits. 

C. Changes to the entities in this transaction cannot be flushed to the database until the transaction commits. 

D. setFlushMode cannot be called on a TypedQuery object. 

Answer: