-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: hibernate + pico = cool
PostPosted: Sun Feb 15, 2004 9:22 am 
Senior
Senior

Joined: Wed Aug 27, 2003 4:08 am
Posts: 178
Location: Wiesbaden, Germany
Well, finally employed it in my project.


pico (as expected) simplified configuration to triviality.

Assuming I like to have DAO which does cool things for me.
DAO needs "session provider" - where it can obtain session, give it back and
flush/ rollback...

1. I subclass configuration, and in constructor I set properties,
(or read xml configuration ) and add my classes there.

2. I develop "session factory provider" component - it gets configuration in constructor,
and creates session factory

3. I develop session factory, which creates and manages session ( for example in thread local
variable )

4. I develop my DAO accepts session factory as constructor parameter.

2 & 3 are pretty generic, and could be easily reused. And "thread local" behaviour can be
easily done by picocontainer ( through not yet implemented component adapter, which would be also thrivial ).

Split between 1 & 2 is necessary because session factory is not subclassing-friendly.
Of course session factory could be placed in container like every other componen,
but since there is no constructor, it has to be done in java code ( or scripting ) - and I prefer
xml configuration....

_________________
Got new hibernate xdoclet plugin? http://www.sourceforge.net/projects/xdoclet-plugins/
... Momentan auf der Suche nach neuen Projekt ode Festanstellung....


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 15, 2004 12:58 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Do you think you can write a small wiki page explaining that ?

_________________
Emmanuel


Top
 Profile  
 
 Post subject: wiki page is there
PostPosted: Mon Feb 16, 2004 1:08 pm 
Senior
Senior

Joined: Wed Aug 27, 2003 4:08 am
Posts: 178
Location: Wiesbaden, Germany
http://www.hibernate.org/174.html

_________________
Got new hibernate xdoclet plugin? http://www.sourceforge.net/projects/xdoclet-plugins/
... Momentan auf der Suche nach neuen Projekt ode Festanstellung....


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 16, 2004 2:37 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Thx, I've made some style updates.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 16, 2004 8:37 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Not sure why I could not edit the page. The word 'Confuguation' in the title should be corrected.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 17, 2004 3:28 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Typo and access fixed.

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.