Results 1 to 3 of 3

Thread: LocalSessionFactoryBean's setConfigurationClass() method

  1. #1
    Join Date
    Dec 2004
    Posts
    11

    Default LocalSessionFactoryBean's setConfigurationClass() method

    I typically got bean definitions of my domain objects in my application contexts. Hence I use Hibernate3 in a Tiger environment I utilized a BeanPostProcessor for the registration of Entity annotated beans (= my persistent domain objects) at the AnnotationConfiguration singleton.

    Being forced to subclass the LocalSessionFactoryBean (which is sadly unable to BeanPostProcess the domain objects by itself due to the BeanFactory != BeanPostProcessor restriction) to use my AnnotationConfiguration I was wondering: why exactly is there no setter for a Hibernate Configuration object in the LocalSessionFactoryBean?

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    I wasn't the designer of the class , but I assume since the Configuration is created based on the various properties of the Bean and the sessionFactory
    is imutable once it's created - the configuration it's also imutable.
    However, if you look through the javadoc and the sources you'll see that you have a hook for post-processing the configuration object:
    postProcessConfiguration(config);
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3
    Join Date
    Dec 2004
    Posts
    11

    Default

    Quote Originally Posted by costin
    I assume since the Configuration is created based on the various properties of the Bean and the sessionFactory is imutable once it's created - the configuration it's also imutable.
    This might very well be the case. I think an explicit initializer method would have been a good alternative.

    Quote Originally Posted by costin
    However, if you look through the javadoc and the sources you'll see that you have a hook for post-processing the configuration object:
    postProcessConfiguration(config);
    Yes, I'm aware of that. That's what I'm currently doing (subclassing the darn thing) - I was merely wondering why the design decision was made.

Similar Threads

  1. Order of Bean definitions matters?
    By cfuser in forum Container
    Replies: 2
    Last Post: Oct 21st, 2005, 10:29 AM
  2. Spring container fails with no exception
    By naor in forum Container
    Replies: 9
    Last Post: Oct 1st, 2005, 03:39 PM
  3. EHCaching Hibernate
    By dencamel in forum Data
    Replies: 3
    Last Post: Sep 6th, 2005, 09:03 PM
  4. PerformanceMonitorInterceptor
    By tnist in forum AOP
    Replies: 3
    Last Post: Aug 24th, 2005, 01:39 PM
  5. Replies: 1
    Last Post: Jul 28th, 2005, 05:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •