How to avoid multiple inheritance

The point in JPA/Spring code is that it is part of a framework. Using this framework means having a lot of advantage in other parts of the framework. Most enterprises only accept code that is written in JPA/Spring.

Using JPA/Spring also accepting its limitations. There are not many. But one limitation is that multiple inheritance is a big NoNo. There is no way of having a semi-multiple inheritance construct with interfaces and then still having all the JPA advantages. That is for people who reinvent the wheel, and they produce a lot of code which is often hard to maintain and hard to debug. They go for a wild road with many unexpected dangers. Snakes in the grass, dangerous bugs which can bite.

So the JPA programmer needs to rethink a model so that it can fit in the JPA philosophy. That means that sometimes the semantics of the code need to be traded against purpose of the code.

The IS-A concept in JPA is very strong. You can query a class for its routines and in one line of code retrieve both the functions as the procedures, because they are inherited from routine. This query will occur in a BMM framework many times. A web-interface will want to do these kind of things.
In this query, the inheritance construct is very important.

So having an inheritance tree for the BMM-DECLARATION side of my diagram is essential.

But do you ever query in a live BMM-model for all the entities which have a specific type or which can return null? Semantics have a price. One must ask if it is worth it in a specific situation.
So from purpose-wise, this is not necessary. Nullablity of a BMM_ROUTINE can as well be a feature instead of being brought in by inheritance, and thus it can be in a HAS-A-relation.

The fact that the BMM-created-models can support multiple inheritance does not mean that multiple inheritance must be a part of the BMM. The semantic power of the BMM-models do not have to be part of the BMM itself.

A database is not written in SQL, it offers SQL.

So, after long thinking (it is a hobby project, there is no deadline), I decided to replace the multiple inheritance IS-A relations by HAS-A relations.

Thanks for the discussion.

Best regards
Bert Verhees