InterviewSolution
| 1. |
What are the drawbacks of using Hibernate Annotations? |
|
Answer» Using Hibernate Annotations has the following drawbacks:
Let us look at a simple scenario. As we know every bit of data, be it source code, a compiled class, an OBJECT or anything has a lifecycle associated with it. Suppose we add Hibernate Annotations to our Java code especially if we are connecting to a database and are expecting only this class to connect to the database. The table columns are mapped to the class using the annotations. Now let us assume that we use this class in an API and have consumed the API in a different project. Now the annotations we had used will leak into our API causing mismatches as the database and the tables are different. So, we end up using mapping tools to translate between different layers of the beans in a system. This is an example of the DISADVANTAGES of using annotations. |
|