I have a Bean class called Bean_A that is map to table_A, and this Bean_A class is inherited from a base bean class, and the base bean class will have a unique_reference_key variable that will going to save into the database together with the Bean_A class. I already have the hibernate file ready for the Bean_A and the unique_reference_key field in table_A.
May I know how could I map the base bean class in hibernate to ensure this unique_reference_key variable is save into database when I was saving the Bean_A object? Take note that this base bean class is not map to any table in database, and there is no such table that “represent” the base bean.
Before I throw out this question, I have consult the following article but still couldn’t get any clue on it.
I have found the solution on how to map the base bean property into Bean_A in hibernate.
In hibernate:
Please note that theId was originally from Bean_A and it has been move to BaseBean. A new field, unique_ref_key, is created inside table_A.
In JAVA:
Hope this solution can help others.