I have two entities (Item and CostItem) which share the same table (ITEMS).
CostItem is a subclass inherited from Item.
When the user creates an Item, he must be able to provide his own item code (id column) without restrictions, but when the user creates a CostItem, I don't want him to indicate this code, instead this code must be "read" from a database sequence.
This two object are declared as shown:
Does anynone know how to acomplish this automatic id generation.