Correct entity declaration

Report a typo

We have a Potter base entity class declaration marked with @DiscriminatorColumn annotation. It's time to declare a Master potter entity. Which of the following is the correct entity declaration?

Java

A)

public class Master extends Potter {
    private Integer experience;
}

B)

@Entity
public class Master {
    private Integer experience;
}

C)

@Entity
@DiscriminatorValue("master")
public class Master extends Potter {
    private Integer experience;
}

D)

@Entity
@DiscriminatorValue("master")
public class Master {
    private Integer experience;
}
Kotlin

A)

class Master(
    private val experience: Int = 0
) : Potter() 

B)

@Entity
class Master(
    private val experience: Int = 0
)

C)

@Entity
@DiscriminatorValue("master")
class Master(
    private val experience: Int = 0
) : Potter()

D)

@Entity
@DiscriminatorValue("master")
class Master(
    private val experience: Int = 0
)
Select one option from the list
___

Create a free account to access the full topic