|
2 | 2 |
|
3 | 3 | import com.baeldung.hibernate.pojo.Employee; |
4 | 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.Product; |
5 | 9 | import com.baeldung.hibernate.pojo.Phone; |
6 | 10 | import com.baeldung.hibernate.pojo.TemporalValues; |
| 11 | +import com.baeldung.hibernate.pojo.Course; |
| 12 | +import com.baeldung.hibernate.pojo.Student; |
| 13 | +import com.baeldung.hibernate.pojo.User; |
| 14 | +import com.baeldung.hibernate.pojo.UserProfile; |
| 15 | + |
7 | 16 | import org.hibernate.SessionFactory; |
8 | 17 | import org.hibernate.boot.Metadata; |
9 | 18 | import org.hibernate.boot.MetadataSources; |
@@ -33,6 +42,14 @@ private static SessionFactory makeSessionFactory(ServiceRegistry serviceRegistry |
33 | 42 | metadataSources.addAnnotatedClass(Phone.class); |
34 | 43 | metadataSources.addAnnotatedClass(EntityDescription.class); |
35 | 44 | metadataSources.addAnnotatedClass(TemporalValues.class); |
| 45 | + metadataSources.addAnnotatedClass(User.class); |
| 46 | + metadataSources.addAnnotatedClass(Student.class); |
| 47 | + metadataSources.addAnnotatedClass(Course.class); |
| 48 | + metadataSources.addAnnotatedClass(Product.class); |
| 49 | + metadataSources.addAnnotatedClass(OrderEntryPK.class); |
| 50 | + metadataSources.addAnnotatedClass(OrderEntry.class); |
| 51 | + metadataSources.addAnnotatedClass(OrderEntryIdClass.class); |
| 52 | + metadataSources.addAnnotatedClass(UserProfile.class); |
36 | 53 |
|
37 | 54 | Metadata metadata = metadataSources.buildMetadata(); |
38 | 55 | return metadata.getSessionFactoryBuilder() |
|
0 commit comments