วันพฤหัสบดีที่ 24 มิถุนายน พ.ศ. 2553

The POJO for wrapping the JPA Entity

    Regarding to my opinion, there are 2 types of entity attributes (fields). The one must be persisted at the storage, the data base is an example, the another one is the  temporary which is available for each business, the calculated attributes(fields), the age which is calculated from the date of birth for example.

    Since it is a quick travel for updating and capturing the new technology, I do not have enough time to move further to the JPA Entity inheritance. I decide to create a wrapping class which contains the JPA Entity as its attribute and adding the other attributes which is a temporary entity attributes (fields).  I will use it as a data bean for integrating among my application from end-to-end, the presentation layer through the JPA layer.

    I hope I may have more time to come back to this state and investigating further about the good practice for the extended JPA entity.

ไม่มีความคิดเห็น:

แสดงความคิดเห็น