Question 21
Given the code fragments: Which action completes this composite primary key implementation?
- Add @IdClass annotation at line 1.
- Add @Embeddable annotation at line 1 and replace both @Id annotations with @EmbeddedId annotations.
- Add @IdClass(ContactId.class) annotation at line 2.
- Add @Embeddable annotation at line 1 and @EmbeddedId(ContactId.class) at line 2.
Question 22
Given the code fragment: How can you apply DateConverter to the birthday field?
- by adding @Convert(to=Date.class) at line 3
- by invoking the setConverter(DateConverter.class) method on the EntityManager object
- by adding @Converter(autoApply=true) at line 1
- by adding @Convert((DateConverter.class)) at line 2
Question 23
Which class do you use to handle an incoming JSON Message as a stream?
- JsonReader
- JsonObjectBuilder
- JsonParser
- JsonObject
Question 24
Which two approaches would result in the current date being added to the output of a JSP? (Choose two.)
- <%= out.printIn(new java.util.Date()) %>
- <% out.printIn(new java.util.Date()); %>
- <%= new java.util.Date() %>
- <% System.out.printIn(new java.util.Date()); %>
Question 25
Given the code fragment: How are transactions managed?
- through a single shared transaction across the connection factory
- through a separate transaction per JMS Consumer
- through a single transaction for the entire JMS Topic
- through a single shared transaction in the JMS Context