|
1 | 1 | package com.baeldung.hibernate; |
2 | 2 |
|
3 | | -import com.baeldung.hibernate.pojo.Employee; |
4 | | -import com.baeldung.hibernate.pojo.EntityDescription; |
5 | | -import com.baeldung.hibernate.pojo.OrderEntry; |
6 | | -import com.baeldung.hibernate.pojo.OrderEntryIdClass; |
7 | | -import com.baeldung.hibernate.pojo.OrderEntryPK; |
8 | | -import com.baeldung.hibernate.pojo.PointEntity; |
9 | | -import com.baeldung.hibernate.pojo.PolygonEntity; |
10 | | -import com.baeldung.hibernate.pojo.Product; |
11 | | -import com.baeldung.hibernate.pojo.Phone; |
12 | | -import com.baeldung.hibernate.pojo.TemporalValues; |
13 | | -import com.baeldung.hibernate.pojo.Course; |
14 | | -import com.baeldung.hibernate.pojo.Student; |
15 | | -import com.baeldung.hibernate.pojo.User; |
16 | | -import com.baeldung.hibernate.pojo.UserProfile; |
17 | | -import com.baeldung.hibernate.pojo.inheritance.Animal; |
18 | | -import com.baeldung.hibernate.pojo.inheritance.Bag; |
19 | | -import com.baeldung.hibernate.pojo.inheritance.Book; |
20 | | -import com.baeldung.hibernate.pojo.inheritance.Car; |
21 | | -import com.baeldung.hibernate.pojo.inheritance.MyEmployee; |
22 | | -import com.baeldung.hibernate.pojo.inheritance.MyProduct; |
23 | | -import com.baeldung.hibernate.pojo.inheritance.Pen; |
24 | | -import com.baeldung.hibernate.pojo.inheritance.Person; |
25 | | -import com.baeldung.hibernate.pojo.inheritance.Pet; |
26 | | -import com.baeldung.hibernate.pojo.inheritance.Vehicle; |
27 | | - |
| 3 | +import com.baeldung.hibernate.pessimisticlocking.Individual; |
| 4 | +import com.baeldung.hibernate.pessimisticlocking.PessimisticLockingCourse; |
| 5 | +import com.baeldung.hibernate.pessimisticlocking.PessimisticLockingEmployee; |
| 6 | +import com.baeldung.hibernate.pessimisticlocking.PessimisticLockingStudent; |
| 7 | +import com.baeldung.hibernate.pojo.*; |
| 8 | +import com.baeldung.hibernate.pojo.Person; |
| 9 | +import com.baeldung.hibernate.pojo.inheritance.*; |
28 | 10 | import org.apache.commons.lang3.StringUtils; |
29 | 11 | import org.hibernate.SessionFactory; |
30 | 12 | import org.hibernate.boot.Metadata; |
@@ -82,6 +64,12 @@ private static SessionFactory makeSessionFactory(ServiceRegistry serviceRegistry |
82 | 64 | metadataSources.addAnnotatedClass(PointEntity.class); |
83 | 65 | metadataSources.addAnnotatedClass(PolygonEntity.class); |
84 | 66 | metadataSources.addAnnotatedClass(com.baeldung.hibernate.pojo.Person.class); |
| 67 | + metadataSources.addAnnotatedClass(Individual.class); |
| 68 | + metadataSources.addAnnotatedClass(PessimisticLockingEmployee.class); |
| 69 | + metadataSources.addAnnotatedClass(PessimisticLockingStudent.class); |
| 70 | + metadataSources.addAnnotatedClass(PessimisticLockingCourse.class); |
| 71 | + metadataSources.addAnnotatedClass(com.baeldung.hibernate.pessimisticlocking.Customer.class); |
| 72 | + metadataSources.addAnnotatedClass(com.baeldung.hibernate.pessimisticlocking.Address.class); |
85 | 73 |
|
86 | 74 | Metadata metadata = metadataSources.buildMetadata(); |
87 | 75 | return metadata.getSessionFactoryBuilder() |
|
0 commit comments