Hi,
I am also interested on having polymorphic components so my questions are :
- Shorn, did you manage to create a patch for that ? If not, do you have any idea on how this could be achieved ?
Here is a case where this feature would help me.
I have a Client object. I have different levels of clients : NewClient, GoodClient, GoldClient. I want some polymorphism on my levels to be able to define different behaviour on different client level. I also don't want to create a new Client object when the level of my client change.
Thus I have this classes :
Code:
public class Client
{
public Level myLevel;
}
public abstract class Level
public class LevelNew extends Level
public class LevelGood extends Level
public class LevelGold extends Level
As clients and levels are thightly coupled, I want to save them on the same db table. So, as far as I know, I have to make the level a component of the client class. This leads to the need of a subcomponent.
I present you this example because maybe I missed something in hibernate and it is possible to have all this classes mapped on one table. But if no, subcomponents seems to be a really useful feature
Seb