Spring/Hibernate config design question

Discussion in 'Java' started by visionset, Dec 12, 2006.

  1. visionset

    visionset Guest

    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?

    --
    Mike W
     
    visionset, Dec 12, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    702
  2. Replies:
    0
    Views:
    454
  3. rmn190
    Replies:
    2
    Views:
    2,460
    Arne Vajhøj
    Jan 10, 2008
  4. Goldfish
    Replies:
    1
    Views:
    819
    Goldfish
    Nov 6, 2008
  5. Amit Jain
    Replies:
    7
    Views:
    3,382
    Amit Jain
    Apr 27, 2009
Loading...

Share This Page