V
visionset
I have a series of Rule classes that are mainly behaviour. I generally need
just one object of each class.
They all inherit from a single superclass and are at present persisted as
@Entity through Hibernate.
I would like these rules to be configurable through Spring such that I may
have where neccessary more than 1 object per class. But the config state is
so disparate it won't fit neatly into the Hibernate inheritence persistence
scheme.
I'm thinking of just storing Spring Bean Ids for the Rule classes (as
properties in place of the original foreign key) via Hibernate then using
Spring to instantiate the Beans from this name and pull out config
properties from bean xml. If the bean definition does not exist then some
sensible default can be created and a Class.newInstance() performed.
I suppose I'd mark the Rule attribute as @Transient and lazily instantiate
it on request.
Does this sound like a decent plan?
just one object of each class.
They all inherit from a single superclass and are at present persisted as
@Entity through Hibernate.
I would like these rules to be configurable through Spring such that I may
have where neccessary more than 1 object per class. But the config state is
so disparate it won't fit neatly into the Hibernate inheritence persistence
scheme.
I'm thinking of just storing Spring Bean Ids for the Rule classes (as
properties in place of the original foreign key) via Hibernate then using
Spring to instantiate the Beans from this name and pull out config
properties from bean xml. If the bean definition does not exist then some
sensible default can be created and a Class.newInstance() performed.
I suppose I'd mark the Rule attribute as @Transient and lazily instantiate
it on request.
Does this sound like a decent plan?