Free Oracle 1Z0-898 Exam Practice Questions & Explanations
Prepared & Reviewed by the ValidExamDumps Editorial Team
At ValidExamDumps, we consistently monitor updates to the Oracle 1Z0-898 exam questions by Oracle. Whenever our team identifies changes in the exam questions, objectives, focus areas or requirements, We immediately update our exam questions for both PDF and online practice exams. This commitment ensures our customers always have access to the most current and accurate questions. By preparing with these up to date and 100% exam domain coverage questions, our customers can successfully pass the Oracle Java EE 6 Java Persistence API Developer Certified Expert exam on their first attempt without needing additional materials or study guides.
Other certification materials providers often include outdated or removed questions by Oracle in their 1Z0-898 exam. These outdated questions lead to customers failing their Oracle Java EE 6 Java Persistence API Developer Certified Expert exam. In contrast, we ensure our questions bank includes only precise and up-to-date questions. Our main priority is your success in the Oracle 1Z0-898 exam, not profiting from selling obsolete exam questions in PDF or Online Practice Test.
The auction domain has BillingDetails as an abstract superclass with subclasses CreditCard and BankAccount. Business rules require that subclass-specific columns such as cardNumber be declared NOT NULL at the database level, and polymorphic queries over BillingDetails must still be supported without extra joins being ideal but acceptable.
Which inheritance strategy best satisfies the NOT NULL constraint requirement?
JOINED gives each subclass its own table containing only its own columns, so subclass columns can be declared NOT NULL, and polymorphic queries are supported via joins to the root table.
B is wrong: with SINGLE_TABLE all subclass columns must be nullable because rows of other subtypes leave them empty. C is wrong: TABLE_PER_CLASS does allow NOT NULL but polymorphic queries require costly UNIONs and support is optional in JPA - and the claim that it is the only strategy supporting polymorphic queries is false. D is wrong: a mapped superclass is not an entity and cannot be the target of a polymorphic query.
In the auction application, Item declares @OneToMany(mappedBy="item", cascade=CascadeType.ALL, orphanRemoval=true) List<Bid> bids;. A developer removes a Bid from the bids collection of a managed Item inside a transaction but never calls em.remove() on the bid.
The bid row will be deleted from the database when the persistence context is flushed.
True. With orphanRemoval=true, disassociating a child entity from the owning parent's collection marks it as an orphan, and the provider issues a DELETE for it at flush time as if em.remove() had been called. Without orphanRemoval, removing it from the collection would only null/leave the foreign key (and with mappedBy, possibly have no effect at all until the owning side is updated).
An auction service method runs inside a container-managed transaction and executes:
Item item = em.find(Item.class, 10L);
item.setName("Rare Coin");
Item detached = ...; // previously loaded, id 10, name "Coin Lot"
Item merged = em.merge(detached);
What is true when the transaction commits?
merge() copies the state of the detached instance onto the managed instance that already exists in the persistence context for that identity, and returns that managed instance. So merged == item, the managed instance's name is overwritten with "Coin Lot", and that value is flushed at commit.
B is wrong: merge never makes the detached argument managed. C applies to persist() semantics, not merge. D is wrong because the persistence context guarantees a single managed instance per identity.
The auction application's User entity embeds a Address homeAddress value type. Addresses have no identity of their own and are always loaded and stored with the owning user. A second field Address billingAddress must map to differently named columns in the USERS table.
Which combination correctly models this?
A value type with no identity is mapped as @Embeddable and used via @Embedded. Because both embedded fields default to the same column names, @AttributeOverrides/@AttributeOverride must be applied to one of them to map to different columns.
B gives the address its own identity and table, which contradicts the requirement. C is impossible - Java has single inheritance and a mapped superclass provides no per-field mapping. D is for collections of embeddables, not a single-valued attribute.
You are designing the persistence layer of an auction application. The Item entity has a bidirectional one-to-many association with Bid. The team wants the foreign key column ITEM_ID in the BID table to be maintained correctly without extra UPDATE statements being issued after each INSERT.
Which mapping approach achieves this?
In a bidirectional one-to-many/many-to-one, the many side (the side with the foreign key) must be the owning side; the one side declares mappedBy pointing at the field on the many side. The provider then writes ITEM_ID as part of the Bid INSERT, avoiding extra UPDATEs.
B is invalid: mappedBy is not an attribute of @ManyToOne, and a unidirectional @JoinColumn on the one side causes additional UPDATE statements. C is illegal - exactly one side must own the relationship. D works but is not required and adds a join table unnecessarily.
