Professional Documents
Culture Documents
05 - JPA Napredno Mapiranje
05 - JPA Napredno Mapiranje
Advanced Mappings
entitymanager.getTransaction().commit();
entitymanager.close();
emfactory.close();
}
} Java Persistence API
Joined table strategy
Joined table strategy is to share the referenced column which contains unique values
to join the table and make easy transactions.
STAFF
@Entity
@Table • staff_ID
@Inheritance(strategy = InheritanceType.JOINED) • Sname
TEACHING STAFF
• staff_ID
• Qualification
• SubjectExpertise
entitymanager.getTransaction().commit();
entitymanager.close();
Java Persistence API
emfactory.close();
Exercise
If we have the following model (as on the right figure):
– Which diagram represents joined_table: (a) or (b)?
(a) (b)
=