placeholder image to represent content

JPA annotations and operations reviewed

Quiz by Jordi Gual

Our brand new solo games combine with your quiz, on the same screen

Correct quiz answers unlock more play!

New Quizalize solo game modes
7 questions
Show answers
  • Q1
    What is the annotation used to indicate that a class is represented in the data base with a table?
  • Q2
    How do we define the name of the table wich will represent a class in the data base?
    With the @Entity annotation
    With the @Table annotation.
    With the @Alias annotation
    With the @Name annotation
  • Q3
    Which annotation has to be used in the class "Alumne" to define the relationship that we can see in the class diagram?
    Question Image
  • Q4
    What is the difference between @NamedQuery and @NamedQueries annotations?
    @NamedQuery is used to define single result queries and @NamedQueries for multiple result ones.
    @NamedQuery is used to define a single query to the database and @NamedQueries is used to group several queries defined with @NamedQuery.
    @NamedQuery is used to define queries with a single name and @NamedQueries is used to define multiple names to each query.
    @NamedQuery is used to define single field result queries and @NamedQueries for multiple field result ones.
  • Q5
    The four basic JPA persistence operations are...
    insert(), update(), delete() and select()
    add(), set(), remove() and get()
    insert(), modify(), remove() and query()
    persist(), merge(), remove() and createNamedQuery()
  • Q6
    What kind of query is the one we can see above if "id" is an attribute annotated as @Id?
    Question Image
    A multiple result parametric query.
    A multiple result non-arametric query.
    A single result parametric query.
    A single result non-parametric query.
  • Q7
    What is the language used to define object oriented queries in JPA?

Teachers give this quiz to your class