In my domain object, there is a concept class: Storage_move_bill. There are two attribute exist in this concept class: Move type and Storage. Move type means either move_in or move_out. Source storage means diffierent storage: e.g. source storage, scrap storage, product storage. So there are a number of Storage_move_bill, like source_storage_move_out_bill, scrap_storage_move_in_bill, product_storage_move_in_bill, product_storage_move_out_bill and so on.
I designed a common Storage_move_bill class, two interface: Move_type and Storage. There is two attributes named moveType and storage in Storage_move_bill class. A lot of subclass of interface Move_type and Storage.
In DB, all kinds of Storage_move_bill store in one table, two columns distinguish which storage and which move type.
But I have no idea how to map my class to DB. Is there any suggestion?
|