|
From: Juergen H. <ju...@in...> - 2005-03-10 23:32:07
|
Thanks for the suggestion, Dan! I've prototypically added such an
AnnotationsSessionFactoryBean.
However, the Hibernate3 annotations jar is built with JDK 1.5, so we can
only build and ship this class if our build process switches to JDK 1.5
required too. We might switch to building with JDK 1.5 anyway, though, for
our new transaction annotation feature that we'd like to ship in Spring 1.2.
Juergen
-----Original Message-----
From: spr...@li...
[mailto:spr...@li...]On Behalf Of
Washusen, Dan
Sent: Thursday, March 10, 2005 7:09 AM
To: spr...@li...
Subject: RE: [Springframework-developer] Hibernate 3 annotations in 1.2
rc1
Incase anyone is interested; I've attached an implementation of the bean
definition I described below.
Cheers,
Dan
----------------------------------------------------------------------------
--
From: spr...@li...
[mailto:spr...@li...] On Behalf Of
Washusen, Dan
Sent: Wednesday, 9 March 2005 12:29 PM
To: spr...@li...
Subject: [Springframework-developer] Hibernate 3 annotations in 1.2 rc1
Hey guys,
I've bean mucking around with Hibernate 3 (with annotations) support in
nightly build. All is going well but I thought I would offer some feedback.
1.. I had to extend the
org.springframework.orm.hibernate3.LocalSessionFactoryBean class and
override the newConfiguration() method to return an instance of
org.hibernate.cfg.AnnotationConfiguration.
2.. I then moved the list of mappings (from hibernate2) specified by
mappingResources into the hibernate.cfg.xml file (using the format specified
by the Hibernate annotations page) and specified the location using the
configLocation property.
Pretty easy really.
A provided extension of LocalSessionFactoryBean that had support for
annotated classes would be nice. The bean definition could look something
like:
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.AnnotationsLocalSessionFactoryBean
">
<property name="dataSource">
<ref local="dataSource"/>
</property>
<property name="mappingPackage">
<value>some.package</value>
</property>
<property name="annotatedClasses">
<list>
<value>com.package.Foo</value>
<value>com.package.Bar</value>
</list>
</property>
</bean>
Cheers,
Dan
www.sensis.com.au
A leading Australian advertising, information
and directories business.
www.yellowpages.com.au
www.whitepages.com.au
www.citysearch.com.au
www.whereis.com.au
www.telstra.com.au
www.tradingpost.com.au
This email and any attachments are intended only for the use of the
recipient and may be confidential and/or legally privileged.
Sensis Pty Ltd disclaims liability for any errors, omissions, viruses, loss
and/or damage arising from using, opening or transmitting this email.
If you are not the intended recipient you must not use, interfere with,
disclose, copy or retain this email and you should notify the sender
immediately by return email or by contacting Sensis Pty Ltd by telephone on
[+61 3 8653 5000]
www.sensis.com.au
A leading Australian advertising, information
and directories business.
www.yellowpages.com.au
www.whitepages.com.au
www.citysearch.com.au
www.whereis.com.au
www.telstra.com.au
www.tradingpost.com.au
This email and any attachments are intended only for the use of the
recipient and may be confidential and/or legally privileged.
Sensis Pty Ltd disclaims liability for any errors, omissions, viruses, loss
and/or damage arising from using, opening or transmitting this email.
If you are not the intended recipient you must not use, interfere with,
disclose, copy or retain this email and you should notify the sender
immediately by return email or by contacting Sensis Pty Ltd by telephone on
[+61 3 8653 5000]
|