231k views
0 votes
What are some common JPA annotations used in Hibernate?

1 Answer

1 vote

Final answer:

Some common JPA annotations used in Hibernate include (at)Entity, (at)Table, and (at)Id.

Step-by-step explanation:

Common JPA annotations used in Hibernate include `(at)Entity`, `(at)Id`, `(at)GeneratedValue`, `(at)Column`, `(at)Table`, and `(at)OneToMany`. In Hibernate, `(at)Entity` marks a class as an entity, `(at)Id` specifies the primary key of an entity, `(at)GeneratedValue` configures the automatic generation of a primary key, `(at)Column` allows customization of column properties, `(at)Table` defines the table details, and `(at)OneToMany` establishes a one-to-many relationship between entities.

`(at)Entity` is fundamental, marking a class as an entity that Hibernate will manage. `(at)Id` identifies the primary key, while `(at)GeneratedValue` automatically generates its value. `(at)Column` customizes column attributes, like name or constraints. `(at)Table` specifies table details if different from defaults. `(at)OneToMany` helps establish relationships, allowing one entity to have multiple related entities.

Correct Answer: `(at)Entity`, `(at)Id`, `(at)GeneratedValue`, `(at)Column`, `(at)Table`, and `(at)OneToMany`.

User Juan Ocho
by
8.0k points

Related questions

1 answer
5 votes
132k views
1 answer
3 votes
87.0k views