Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

[ 9 : 2 3 am , 1 4 / 5 / 2 0 2 4 ] Pallavi: Refer the following code for a Java

[9:23 am,14/5/2024] Pallavi: Refer the following code for a Java class.
1. package com.mphasis:
2. import javax.persistance. Entity:
3. import javax.persistance GeneratedValue;
4. import javax.persistence. GenerationType
5. import javax.persistence.Id;
6.// code goes here
7. public class Customer(
8
// code goes here
// code goes here
10. private Long id;
11 private String firstName;
12. private String lastName;
Setters and Getters
Which of the following lines of code when added to Lines 6,8, and 9 will enable mapping of the Java class with the database using JPA where the id field is managed by JPA during generation of records?
[9:28 am,14/5/2024] Pallavi: O
(A)
@Table
@Id
9. GeneratedValue(strategy GenerationType. AUTO)
(B)
6. @Entity
8. @id
9. @GeneratedValue(strategy-GenerationType.AUTO)
C.@Table
@ Identity
@GeneratedValue (strategy-GenerationType AUTO)
D.@Table
@Id
AutoGenerated (strategy= GenerationType ,AUTO)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions