I am learning hibernate and have some questions about the differences between Entity and Table, and how they work together/independently?
Case 1:
@Entity
public class Person{
}
My understanding -
Entity name - Person
Table name in db - person
Case 2:
@Entity(name = "people")
public class Person{
}
My understanding -
Entity name - people
Table name in db - people
Case 3:
@Entity
@Table(name="people")
public class Person{
}
My understanding -
Entity name - Person
Table name in db - people
Case 4:
@Entity(name = "person")
@Table(name = "people")
public class Person{
}
My understanding -
Entity name - person
Table name in db - people
Case 5:
@Table(name="people")
public class Person{
}
My understanding -
Entity name - ??
Table name in db - people
Is my understanding of these five cases correct? Is there anything else I should know about the working of Entity and Table?