from my previous experience with this magic DYTPE column there is not really a good way to map that to an entity property (or to have such an explicit property in the entities). There are a lot of shortcomings that are in different levels. In the JPA world it is problematic to get that mapped properly. When you google it outside the scope of CUBA you’ll find a few quite ugly solutions with various levels of problems. In the upper layers you also have certain requirements:
- filter for a given type via the generic filter UI
It becomes even more messy when you have multiple levels of inheritance and you want to find out all elements that belong to a certain sub layer (and below). All of this stuff is not really working.
Therefore: the only way that i have seen it working properly with the ability to fulfill requirements even four weeks from your todays requirements is the following:
Create a dedicated Enum (CustomerType or something) that mirrors the entity inheritance. Then all of a sudden most of the problems go away. You only have to be careful that when you create the instances, but this can be done through some @PostConstruct annotations and alike.