|
From: snpe <sn...@sn...> - 2004-06-16 10:32:58
|
Juergen,
getBean("&sessionFactory") work fine - I need Configuration for database =
properties for instance :
table name, column name and special column length
What mean : 'This will also work via a bean reference ' - How use it ?
Thanks
On Wednesday 16 June 2004 07:37 am, j=FCrgen h=F6ller [werk3AT] wrote:
> HibernateDaoSupport's protected accessors should usually be good enough -=
they allow access in subclasses, which is what you typically want.
> =20
> Regarding the Configuration object: You can fetch the LocalSessionFactory=
Bean itself via getBean("&sessionFactory"),
> i.e. a prefixed "&" to get the FactoryBean itself rather than the Session=
=46actory it creates. This will also work via a bean reference.=20
> =20
> The standard HibernateDaoSupport base class shouldn't have a Configuratio=
n property, I believe, as this is hardly ever needed. I suggest to expose a=
separate property of type LocalSessionFactoryBean in your DAO class, pass =
"&sessionFactory" in, and fetch the Configuration object from there.
> =20
> Juergen
> =20
>=20
> ________________________________
>=20
> Von: spr...@li... im Auftrag von=
snpe
> Gesendet: Mi 16.06.2004 06:58
> An: spr...@li...
> Betreff: Re: [Springframework-developer] Hibernate Configuration and Sess=
ionFactory
>=20
>=20
>=20
> Hi Dmitriy,
> You are correect - I use spring 1.0.1, but I have current cvs
> There is public method getConfiguration in LocalSessionFactoryBean, but I=
don't know how I can get instance this class
>=20
> I can get hibernate metadata from SessionFactory, but I can't get databa=
se metadata (for instance length) without Configuration
>=20
> Is it possible export Configuration to HibernateDaoSupport ?
>=20
> Is current cvs stable or I have to checkout version 1.0.2 ?
>=20
> Thanks
> On Wednesday 16 June 2004 03:17 am, Dmitriy Kopylenko wrote:
> > Haris,
> >
> > what version of Spring are you using? As of 1.0.2 the visibility of
> > HibernateDaoSupport's resource factory accessors has been changed to
> > *public*.
> >
> > I'm not sure about how you would get hold of Configuration instance tho=
ugh.
> >
> > Regards,
> > Dmitriy.
> >
> >
> > snpe wrote:
> >
> > >Hello,
> > > I want use SessionFactory and Configuration classes for metadata API=
(property name type, database name, type, length etc)
> > >I use spring's HibernateDaoSupport, but getSessionFactory is protected=
and I can't use it in my DAO (why ? - I can make method for get SessionFac=
tory,
> > >but I don't know why this is protected/forbiden)
> > >
> > >How I get instance classes Configuration and SessionFactory ?
> > >
> > >regards
> > >Haris Peco
> > >
> > >
> > >-------------------------------------------------------
> > >This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
> > >Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
> > >Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
> > >REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYK=
ND
> > >_______________________________________________
> > >Springframework-developer mailing list
> > >Spr...@li...
> > >https://lists.sourceforge.net/lists/listinfo/springframework-developer
> > >=20
> > >
> >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
> > Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
> > Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
> > REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
> > _______________________________________________
> > Springframework-developer mailing list
> > Spr...@li...
> > https://lists.sourceforge.net/lists/listinfo/springframework-developer
> >
>=20
>=20
> -------------------------------------------------------
> This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
> Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
> Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
> REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>=20
>=20
>=20
>=20
> -------------------------------------------------------
> This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
> Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
> Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
> REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>=20
|