|
From: <jue...@we...> - 2004-06-02 08:29:54
|
You need to fetch the LocalSessionFactoryBean itself here, rather than =
the object it exposes:
LocalSessionFactoryBean lsfb =3D (LocalSessionFactoryBean) =
ctx.getBean("&mySessionFactory");
This is rarely necessary, but works with any FactoryBean: Simply prepend =
a "&" to the bean name.
Juergen
-----Original Message-----
From: spr...@li...
[mailto:spr...@li...]On Behalf
Of Jozsa Kristof
Sent: Wednesday, June 02, 2004 10:28 AM
To: spr...@li...
Subject: [Springframework-developer] access to
(LocalSessionFactoryBean).createDatabaseSchema()
Hi,
I'd like to create my database schema with my configured=20
LocalSessionFactoryBean's convenient method createDatabaseSchema(). I=20
configured my LSFB the usual way:
<bean id=3D"sessionFactory"=20
class=3D"org.springframework.orm.hibernate.LocalSessionFactoryBean">
<property name=3D"dataSource"><ref local=3D"oracleDS"/></property>
...
</bean>
..but if I pull that bean 'sessionFactory' from the spring container, it =
will be a type of net.sf.hibernate.SessionFactoryImpl, the default=20
implementation of the hibernate SessionFactory interface. How could I=20
invoke the method mentioned to create the database schema then? (I can't =
really see either how the resulting bean could be a total different type =
than the configured one, but that has minor priority compared to my=20
original question).
As a side note, I never really understood why Hibernate doesn't let=20
access the used Configuration from the SessionFactory instance, which=20
could be use to feed SchemaExport and create the schema..
tia,
dyn
--=20
.Digital.Yearning.for.Networked.Assassination.and.Xenocide.
-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|