1Z0-898 Exam Questions
63 real 1Z0-898 exam questions with expert-verified answers and explanations. Page 1 of 2.
- Question #1EJB Lite
The developer has defined the following entity class office: Which of the following attributes will be in corresponding generated static metamodel class for the rooms' field?
JPA static metamodelListAttributeentity attributecriteria API - Question #2EJB Lite
Given two entities with many-to-many bidirectional association between them: What set of annotations correctly defines the association?
@ManyToManybidirectional associationmappedByJPA relationship mapping - Question #3EntityManager Operations
An application wants to utilize side effects of cascading entity manager operations to related entities. Which statement is correct?
cascade operationspersistremoveentity relationships - Question #4
The Contact Information embeddable class contains address information as well as a reference to a phone entity. The ContactInformation class is defined as follows: @Embeddable publ...
- Question #5Advanced Topics
A stateless session bean's business method invokes EJBContext.setRollBackOnly and receives an IllegalStateException. Under which of these conditions could this be possible?
transaction managementNONSUPPORTEDsetRollbackOnlyEJBContext - Question #6Advanced Topics
Given the following stateless session bean implementation classes: Assuming no other transaction-related metadata, what are the transaction attributes on methodB, and method C resp...
transaction attributesREQUIREDMANDATORYREQUIRES_NEW - Question #7Advanced Topics
A session bean business method throws an exception during execution. Which two are responsibilities of the Bean Provider when throwing the exception? (Choose two.)
exception handlingapplication exceptionsEJBExceptionsystem errors - Question #8Advanced Topics
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 bu...
RuntimeException propagationREQUIRES_NEWEJBExceptiontransaction boundary - Question #9
Given a set of CMT bean methods with the following transaction attributes: Method M1 = SUPPORTS Method M2 = REQUIRED Method M3 = NOT_SUPPORTED Method M4 = REQUIRES_NEW And the foll...
- Question #10EntityManager Operations
Which EntityManager API will lock entity x with a pessimistic lock?
pessimistic lockingLockModeTypeEntityManager.lockPESSIMISTIC_READ - Question #11Advanced Topics
It a Persistence application locks entity x with a pessimistic lock, which statement is true?
pessimistic lockPessimisticLockExceptionlock acquisitionlock behavior - Question #12Advanced Topics
If a Persistence application locks entity x with a LockModeType.OPTIMISTIC_FORCE INCREMENT lock type, which statement is true?
OPTIMISTIC_FORCE_INCREMENTversion attributeLockModeTypeoptimistic locking - Question #14Advanced Topics
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 propert...
lazy loadingPersistenceUtil.isLoadedfetch typeentity state - Question #15Caching
Given the following entity classes: @Entity @cacheable (true) Public class A { . . . } - - - - @Entity @cacheable (false) Public class B { . . .} @Entity Public class C { . . . } I...
@Cacheableshared-cache-modeENABLE_SELECTIVEsecond-level cache - Question #16Caching
An application has three entities: the mapped super class person class entity, and the parent and child entities, which are subclasses of person. The application has created four e...
cache evictionmapped superclassinheritanceCache.evict - Question #17EntityManager Operations
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?
EntityManager.refreshentity statedatabase synchronizationcache - Question #18Criteria API
The developer wants to write a criteria query that will return the number of orders made by customer of each county. Assume that customer is an entity with a unidirectional one-to-...
CriteriaBuildergroupByjoinembeddable - Question #19Criteria API
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 corr...
CriteriaBuilderorderByquery filteringcriteria query - Question #20JPQL
An application has two entities, parson and Address. The application calls the DeletePersonsByStatus named query. Which of the following is true?
bulk deletenamed querycascadeJPQL delete - Question #21JPQL
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...
bulk updateversion attributeoptimistic lockingJPQL - Question #22Advanced Topics
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 a...
PESSIMISTIC_FORCE_INCREMENTnamed query lock modeconcurrent transactionspessimistic lock - Question #23JPQL
A developer wants to create a Java Persistence query that will include a sub-query. Which three are true? (Choose three.)
subqueryWHERE clauseANY expressionEXISTS expression - Question #24JPQL
Which statement is correct about the Java Persistence API support for the SQL queries?
native SQLSQL query supportSELECT queriesportability - Question #25JPQL
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 expre...
SIZE functioncollection queriesone-to-manyJPQL syntax - Question #26Advanced Topics
A session bean business method invokes UserTransaction.setRollbackonly and receives an IllegalStateException. Under which circumstance can this happen?
bean-managed transactionsUserTransactionsetRollbackOnlyIllegalStateException - Question #27JPA Fundamentals
A JavaEE application is packaged as follows. Which of the following is true for a portable JavaEE application?
persistence unit visibilityJavaEE packagingmodule scopingpersistence unit - Question #28Entity Relationships
The developer has modeled student interests as a set <String>: @Entity public class Student { @Id int student Id; string name; @ElementaryCollection Set <String> Interests; . . . }...
ElementCollectionCollectionTablecolumn mappingbasic type collection - Question #29Entity Relationships
The embeddable class ContractInformation is used in an element collection of the Employee entity. @Entity Public class Employee { @Id int empId; @ElementaryCollection Set <Contract...
ElementCollectionEmbeddableembeddable restrictionselement collection constraints - Question #30Advanced Topics
If a Persistence application locks entity x with a pessimistic lock, which statement is true?
pessimistic lockingdatabase row lockingforeign key lockinglock scope - Question #31Advanced Topics
Entity lifecycle call-back methods may be defined in which three classes? (Choose three)
lifecycle callbacksentity listenersmapped superclasscallback placement - Question #32Advanced Topics
A developer wrote an entity class with the following method: Private static Logger logger = Logger.getLogger ("myLogger"); @PrePersist @PreUpdate Public void doA () { Logger.info (...
lifecycle callbacks@PrePersist@PostPersist@PreUpdate - Question #33EntityManager Operations
Given the following code: Public void create () { try { doA () { } catch (PersistenceException e) {} try (doB) (); } catch (PersistenceException e) {} } Calling method doA will cau...
container-managed transactionsPersistenceExceptiontransaction rollbackEntityExistsException - Question #34Advanced Topics
An application that uses pessimistic locking calls an update Data method that results in a LockTimeoutException being thrown. What three statements are correct? (Choose three)
pessimistic lockingLockTimeoutExceptionstatement rollbacktransaction continuation - Question #35Inheritance Strategies
A developer has created a deep entity class hierarchy with many polymorphic relationships between entitles. Which inheritance strategy, as defined by the inheritance Type enumerate...
SINGLE_TABLE strategypolymorphic relationshipsinheritance performanceInheritanceType - Question #36JPA Fundamentals
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 po...
composite primary key@IdClass@EmbeddedId@Embeddable - Question #37
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 modelled by integers. Which of the f...
- Question #38JPA Fundamentals
Consider a persistence application with the following orm.xml: What will be the effect of the above orm.xml?
orm.xmlaccess type overridefield accessmapping defaults - Question #39EntityManager Operations
A developer has created an application managed entity manager. Which statement is correct?
application-managed EntityManagerpersistence context lifecycleEntityManager creation - Question #40EntityManager Operations
Given: Which statement is correct?
entity statepersistence contextEntityManager operations - Question #41EntityManager Operations
If an application uses an extended persistence context, which of the following is true?
extended persistence contextEntityManager scopepersistence context lifecycle - Question #42EntityManager Operations
An application uses an application-managed entity manager. Which of the following is NOT true?
application-managed EntityManagerjoinTransactionJTA awarenessEntityManagerFactory - Question #43EntityManager Operations
An application that uses container-managed transaction demarcation creates a query within an active transaction and receives a QueryTimeoutException. Which of those scenarios descr...
QueryTimeoutExceptioncontainer-managed transactionsstatement rollbacktransaction continuation - Question #44Entity Relationships
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...
OneToOneorphanRemovalcascade typesentity removal - Question #45Entity Relationships
An entity person is mapped to a table PERSON and has a collection-valued persistence field otherUsedNames that stores names used by a person. The other used Names field is mapped t...
ElementCollectionCollectionTabletable mappingcollection-valued field - Question #46Entity Relationships
Which statement is true about the @OrderColumn annotation?
OrderColumnlist orderingcollection orderingorder column visibility - Question #48Entity Relationships
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 o...
OneToManyunidirectional relationshipforeign key mappingentity mapping - Question #49Entity Relationships
A developer who is designing entity classes to map a legacy database encounters a table called STUDENT_RECORD . This table has two columns, STUDENT_ID and STUDENT_INFO_ID. The prim...
composite primary keyjoin tablelegacy databaseforeign key mapping - Question #50Entity Relationships
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 Custome...
OneToManyMap relationshipMapKeycollection mapping - Question #51Inheritance Strategies
Refer to the Exhibit. A developer wants to have booking data stored in the table BOOKING, flight number in table FLIGHTBOOKING, and hotel name in HOTELBOOKING. Which code, inserted...
JOINED strategy@Inheritancetable per subclassinheritance mapping - Question #52JPA Fundamentals
Which two of the following statements are true of embeddable classes? (Choose two)
@Embeddableembeddable classMap keynull comparison