Want to know Actualtests 1Z0-898 Exam practice test features? Want to lear more about Oracle Java Platform, Enterprise Edition 6 Java Persistence API Developer Certified Expert Exam certification experience? Study Free Oracle 1Z0-898 answers to Renew 1Z0-898 questions at Actualtests. Gat a success with an absolute guarantee to pass Oracle 1Z0-898 (Java Platform, Enterprise Edition 6 Java Persistence API Developer Certified Expert Exam) test on your first attempt.

2016 Aug 1Z0-898 practice test

Q31. The department entity has a unidirectional OneToMany relationship to the employee entity. The developer wants to model this relationship as a java.util.map such that the key of map is true employee name. The primary key of the Employees entity is empId, an integer. 

Which of the following is correct? 

A. @OneToMany (targetEntity = Employee.class) 

@MapKeyClass (string.class) 

map employees; 

B. @OneToMany @mapKey (name, “name”) map < integer, Employee> Employees; 

C. @OneToMany @MapKeyJoinColumn (name = “name”) map <String, Employee> employees; 

D. @OneToMany @mapsId (name = “name”) map <String, Employee> employees; 

Answer: B 


Q32. 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) A. The developer can model the grades as an element collection in the Student entity. 

B. The developer can model the grades as a oneToMany relationship in the Student entity. 

C. The mapping for the key of the map can be specified by the @MapKeycolumn annotation. 

D. The mapping for the value of the map can be specified by the @Column annotation. 

Answer: AC 


Q33. An application that uses pessimistic locking calls an updateData method that results in a LockTimeoutException being thrown. What three statements are correct? (Choose three) 

A. The current transaction continues. 

B. The current statement continues. 

C. The current transaction is rolled back. 

D. The current statement is rolled back. 

E. The LockTimeoutException can NOT be caught. 

F. The LockTimeoutException can be caught, and the updateData method retried. 

Answer: ADF 


Q34. Given the following code: 

Public void create () { 

try { 

doA () { 

} catch (PersistenceException e) {} try (doB) (); 

} catch (PersistenceException e) {} 

Calling method doA will cause an NonUniqueResultException to be thrown. Calling method doB will cause an EntityExistsException to be thrown. 

What two options describe what will happen when the create method is called within an application ' uses container managed transactions? (Choose two) 

A. Method doB will never be called. 

B. The current transaction will continue after doA executes. 

C. The current transaction will continue after doB executes. 

D. The current transaction will be marked for rollback when doA is called. 

E. The current transaction will be marked for rollback when doB is called. 

Answer: CE 


Q35. Which two of the following statements are true of embeddable classes? (Choose two) 

A. An embeddable class must not be used to represent the state of another embeddable class. 

B. Null comparison operations over embeddable classes are not supported in the Java Persistence query language. 

C. An embeddable class must not contain a relationship to an entity. 

D. An embeddable class can be the key of a Map relationship. 

Answer: BD 


certifyforall.com

Refresh 1Z0-898 test engine:

Q36. Entity lifecycle callback methods may be defined in which three classes? (Choose three) 

A. Embedded classes 

B. Entity classes 

C. Abstract classes 

D. Entity listener classes 

E. Mapped superclasses 

F. Concrete non-entity superclasses 

Answer: BDE 


Q37. The developer wants to define a unidirectional relationship from the customer entity to the order entity and map this relationship using a foreign key mapping strategy. 

Which one of the pairs of classes below correctly achieves this task? 

A. @Entity public class Customer { 

@Id int customerId; 

@OneToMany @JoinColumn (name = “CUST_ID”) Set <Order> orders; 

. . . 

@Entity public class order { 

@Id int orderId; 

. . . 

B. @Entity public class Customer { 

@Id int customerId; 

@OneToMany Set <Order> orders; 

. . . 

@Entity 

@JoinColumn (names = “CUST-ID”, referencedColumnName = “customerId”) 

public class order { 

@Id int order Id; 

. . . 

C. @Entity public class Customer { 

@Id int customerId; 

@OneToMany (JoinColumn = @joinColumn (name = “CUST_ID”) Set <Order> orders; 

. . . 

@Entity public class order { 

@Id int orderId; 

. . . 

D. @ Entity public class Customer { 

@Id int customerId; 

@OneToMany (JoinColumn = @JoinColumn (name = “CUST_ID”), table = “”ORDER) Set 

<Order> orders; 

. . . 

@Entity public class order { 

@Id int orderId; 

. . . 

Answer: A 


Q38. 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? 

A. @OneToOne (optional = false) 

personDetail detail; 

B. @OneToOne (optional = false) 

@mapsId 

PersonDetail Detail; 

C. @ OneToOne (orphanremoval = true) 

PersonDetail Detail; 

D. @ OneToOne (cascade = ORPHAN _ DELETE) 

@mapsId 

PersonDetail detail; 

Answer: C 


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


Q40. Refer to the Exhibit. 


A developer wants to have bookingdata stored in the table BOOKING, flightnumber in table FLIGHTBOOKING, and hotel name in HOTELBOOKING. 

Which code, inserted at line 11 of class Booking, is appropriate for his strategy? 

A. @Joined 

B. @SingleTable 

C. @TablePerClass 

D. @Inheritance (strategy = JOINED) 

E. @Inheritance (strategy = SINGLE_TABLE) 

F. @Inheritance (strategy = TABLE_PER_CLASS) 

Answer: D