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

2016 Jul 1Z0-898 practice

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


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


Q23. An application uses optimistic locking by defining version attributes in its entity classes. The application performs a bulk update of the entities using a JPQL query. 

Which of the following is correct? 

A. The persistence provider will ensure that the version value in each table is updated. 

B. The persistence provider will create a new transaction for the bulk update. 

C. An OptimisticLockException will be thrown by the persistence provider. 

D. The value of the Version attributes of the updated entitles should be also be explicitly updated by the query. 

Answer: A 


Q24. A developer has created an application managed entity manager. Which statement is correct? 

A. A new persistence context begins when the entity manager is created. 

B. A new persistence context begins when a new JTA transaction begins. 

C. A new persistence context begins when the entity manager is invoked in the context o\ transaction. 

D. A new persistence context begins when the entity manager is invoked in the context of a resource-local transaction. 

Answer: B 


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


certifyforall.com

Renew 1Z0-898 free practice questions:

Q26. An application has two entities, parson and Address. 


The application calls the DeletePersonsByStatus named query. 

Which of the following is true? 

A. The person entities are removed, but NOT their related address entities. 

B. The person entities, and all their related address entities, are removed. 

C. The DeletePersonsByStatus named query is ill-formed, and will be rejected by the persistence provider. 

D. The named query will fall. 

Answer: B 


Q27. 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: D 


Q28. 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. FooBean.foo method receives javax.ejb.EJBException. 

B. The BarBean bean instance is in ready state for the next invocation. 

C. FooBean.foo method receives javax -ejb. EJBTtansactionRolledbackException. 

D. FooBean.foo method receives the original RuntimeException thrown from BarBean.bar method. 

Answer: A 


Q29. A user entity is in a one-to-many relationship with a Book entity. In other words, a developer reach the collection of books that a user instance myUser has by using the path expression-“myuser -books". 

A developer wants to write a Java Persistence query that returns all users that have only two books. 

Which two are valid queries that return this information? (Choose two.) 

A. SELECT u FROM User U WHERE SIZE (u.books) = 2 

B. SELECT u FROM User WHERE COUNT (u.books) = 2 

C. SELECT u FROM User u (WHERE COUNT (b) FROM u.books b) = 2 

D. SELECT u FROM user u WHERE (SELECT SIZE (b) FROM u.books b) = 2 

Answer: AC 


Q30. 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. @OneToMany 

@joinColumn (name = “Customer - FK”) 

Map <Magzine, Data> subscriptions; 

B. @ElementaryCollection 

Map <Magzine, Data> subscriptions 

C. @OneToMany 

@JoinTable (name = “Subscriptions”) 

Map <Magzine, Data> subscriptions; 

D. @ElementaryCollection 

@CollectionTable (name = “subscriptions”) 

Map <Magazine, Data> subscriptions 

E. @ElementaryCollection 

@CollectionTable (Name = “Subscriptions”) 

@Temporal (TemporalType.DATE) 

Map<magazine, date> subscriptions 

Answer: C