|
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]
|
|
From: Colin S. <col...@ex...> - 2005-03-10 23:50:47
|
Short of switching to separate source modules (hint hint :-) ), that's going to be pretty hard to do. We can compile with JDK 1.5, for lower target versions, but then if you don't specify a 1.5 target version, the annotations stuff would blow up. Juergen Hoeller wrote: > 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] > > |
|
From: Juergen H. <ju...@in...> - 2005-03-11 20:42:17
|
Well, as long as we just compile against JDK 1.5 API or jars built with JDK 1.5 (like hibernate-annotations.jar), we should be able to build with -target 1.3 on JDK 1.5. Thinks just become hard if we intend to include annotations in some of our files or use generics. Admittedly, I haven't played with JDK 1.5 generating 1.3-compatible class files yet... Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Colin Sampaleanu Sent: Friday, March 11, 2005 12:51 AM To: spr...@li... Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2 rc1 Short of switching to separate source modules (hint hint :-) ), that's going to be pretty hard to do. We can compile with JDK 1.5, for lower target versions, but then if you don't specify a 1.5 target version, the annotations stuff would blow up. Juergen Hoeller wrote: > 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] > > ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Colin S. <col...@ex...> - 2005-03-11 21:01:23
|
I think JDK 1.5 generating 1.3 compatible code would hopefully work fine. But realistically, we _do_ want to use annotations, as in the current Tx Annotations code... So there the problem becomes that if everything is in the same codebase, you can't really compile some parts with -1.3, and some with -1.5. Juergen Hoeller wrote: >Well, as long as we just compile against JDK 1.5 API or jars built with JDK >1.5 (like hibernate-annotations.jar), we should be able to build >with -target 1.3 on JDK 1.5. Thinks just become hard if we intend to include >annotations in some of our files or use generics. > >Admittedly, I haven't played with JDK 1.5 generating 1.3-compatible class >files yet... > >Juergen > > >-----Original Message----- >From: spr...@li... >[mailto:spr...@li...]On Behalf >Of Colin Sampaleanu >Sent: Friday, March 11, 2005 12:51 AM >To: spr...@li... >Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2 >rc1 > > >Short of switching to separate source modules (hint hint :-) ), that's >going to be pretty hard to do. We can compile with JDK 1.5, for lower >target versions, but then if you don't specify a 1.5 target version, the >annotations stuff would blow up. > > >Juergen Hoeller wrote: > > > >>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] > > >> >> |
|
From: Juergen H. <ju...@in...> - 2005-03-11 21:25:09
|
Well, we only want to *access* annotations through the corresponding JDK 1.5 API. That should be possible with -source 1.3 and -target 1.3 too, if I understand the issue correctly. The only thing we can't do is include annotations in our sources and expect them to be compiled into the class files. Please let me know if I'm completely mistaken :-) Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Colin Sampaleanu Sent: Friday, March 11, 2005 10:01 PM To: spr...@li... Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2 rc1 I think JDK 1.5 generating 1.3 compatible code would hopefully work fine. But realistically, we _do_ want to use annotations, as in the current Tx Annotations code... So there the problem becomes that if everything is in the same codebase, you can't really compile some parts with -1.3, and some with -1.5. Juergen Hoeller wrote: >Well, as long as we just compile against JDK 1.5 API or jars built with JDK >1.5 (like hibernate-annotations.jar), we should be able to build >with -target 1.3 on JDK 1.5. Thinks just become hard if we intend to include >annotations in some of our files or use generics. > >Admittedly, I haven't played with JDK 1.5 generating 1.3-compatible class >files yet... > >Juergen > > >-----Original Message----- >From: spr...@li... >[mailto:spr...@li...]On Behalf >Of Colin Sampaleanu >Sent: Friday, March 11, 2005 12:51 AM >To: spr...@li... >Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2 >rc1 > > >Short of switching to separate source modules (hint hint :-) ), that's >going to be pretty hard to do. We can compile with JDK 1.5, for lower >target versions, but then if you don't specify a 1.5 target version, the >annotations stuff would blow up. > > >Juergen Hoeller wrote: > > > >>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.AnnotationsLocalSessionFactoryBea n >"> > > >> <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] > > >> >> ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Colin S. <col...@ex...> - 2005-03-11 21:33:42
|
We we do need to include the actual Annotation source files somewhere...
On top of that, yes, you access the actual annotations via calls like
Annotation ann = targetClass.getAnnotation(filter);
or
Annotation ann = targetMethod.getAnnotation(filter);
Now Annotation itself is for the most part just a regular Interface, but
it does have a method in it
Class<? extends Annotation> annotationType();
which is 1.5 syntax specific, so I personally think 1.3 code is going to
barf on trying to use this interface, never mind that in practice, any
code which gets the annotation will quickly try to see if it's a
specific type (subclass) of Annotation (since this is just a marker
interface that does nothing by itself), and do something with it, so
really the code that manipulates the Annotations themselves would have
to be compiled as 1.5 as well.
Colin
Juergen Hoeller wrote:
>Well, we only want to *access* annotations through the corresponding JDK 1.5
>API. That should be possible with -source 1.3 and -target 1.3 too, if I
>understand the issue correctly.
>
>The only thing we can't do is include annotations in our sources and expect
>them to be compiled into the class files. Please let me know if I'm
>completely mistaken :-)
>
>Juergen
>
>
>-----Original Message-----
>From: spr...@li...
>[mailto:spr...@li...]On Behalf
>Of Colin Sampaleanu
>Sent: Friday, March 11, 2005 10:01 PM
>To: spr...@li...
>Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2
>rc1
>
>
>I think JDK 1.5 generating 1.3 compatible code would hopefully work
>fine. But realistically, we _do_ want to use annotations, as in the
>current Tx Annotations code... So there the problem becomes that if
>everything is in the same codebase, you can't really compile some parts
>with -1.3, and some with -1.5.
>
>Juergen Hoeller wrote:
>
>
>
>>Well, as long as we just compile against JDK 1.5 API or jars built with JDK
>>1.5 (like hibernate-annotations.jar), we should be able to build
>>with -target 1.3 on JDK 1.5. Thinks just become hard if we intend to
>>
>>
>include
>
>
>>annotations in some of our files or use generics.
>>
>>Admittedly, I haven't played with JDK 1.5 generating 1.3-compatible class
>>files yet...
>>
>>Juergen
>>
>>
>>-----Original Message-----
>>From: spr...@li...
>>[mailto:spr...@li...]On Behalf
>>Of Colin Sampaleanu
>>Sent: Friday, March 11, 2005 12:51 AM
>>To: spr...@li...
>>Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2
>>rc1
>>
>>
>>Short of switching to separate source modules (hint hint :-) ), that's
>>going to be pretty hard to do. We can compile with JDK 1.5, for lower
>>target versions, but then if you don't specify a 1.5 target version, the
>>annotations stuff would blow up.
>>
>>
>>Juergen Hoeller wrote:
>>
>>
>>
>>
>>
>>>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.AnnotationsLocalSessionFactoryBea
>>
>>
>n
>
>
>>">
>>
>>
>>
>>
>>> <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]
>>
>>
|
|
From: Juergen H. <ju...@in...> - 2005-03-11 22:21:01
|
Well, we could simply give this a try - we'll see whether defining
annotation classes and writing annotations access works with "-target 1.3".
Generics shouldn't be a problem when just accessing an API - that should
(hopefully) not require "-target 1.5". Anyway, let's give this a try!
On this occasion: Where does the JDK 1.5 transaction annotation code reside?
I can't find it in Spring CVS yet... We need to proceed quickly here; after
all, 1.2 RC1 is less than a week a way.
Juergen
-----Original Message-----
From: spr...@li...
[mailto:spr...@li...]On Behalf
Of Colin Sampaleanu
Sent: Friday, March 11, 2005 10:34 PM
To: spr...@li...
Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2
rc1
We we do need to include the actual Annotation source files somewhere...
On top of that, yes, you access the actual annotations via calls like
Annotation ann = targetClass.getAnnotation(filter);
or
Annotation ann = targetMethod.getAnnotation(filter);
Now Annotation itself is for the most part just a regular Interface, but
it does have a method in it
Class<? extends Annotation> annotationType();
which is 1.5 syntax specific, so I personally think 1.3 code is going to
barf on trying to use this interface, never mind that in practice, any
code which gets the annotation will quickly try to see if it's a
specific type (subclass) of Annotation (since this is just a marker
interface that does nothing by itself), and do something with it, so
really the code that manipulates the Annotations themselves would have
to be compiled as 1.5 as well.
Colin
Juergen Hoeller wrote:
>Well, we only want to *access* annotations through the corresponding JDK
1.5
>API. That should be possible with -source 1.3 and -target 1.3 too, if I
>understand the issue correctly.
>
>The only thing we can't do is include annotations in our sources and expect
>them to be compiled into the class files. Please let me know if I'm
>completely mistaken :-)
>
>Juergen
>
>
>-----Original Message-----
>From: spr...@li...
>[mailto:spr...@li...]On Behalf
>Of Colin Sampaleanu
>Sent: Friday, March 11, 2005 10:01 PM
>To: spr...@li...
>Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2
>rc1
>
>
>I think JDK 1.5 generating 1.3 compatible code would hopefully work
>fine. But realistically, we _do_ want to use annotations, as in the
>current Tx Annotations code... So there the problem becomes that if
>everything is in the same codebase, you can't really compile some parts
>with -1.3, and some with -1.5.
>
>Juergen Hoeller wrote:
>
>
>
>>Well, as long as we just compile against JDK 1.5 API or jars built with
JDK
>>1.5 (like hibernate-annotations.jar), we should be able to build
>>with -target 1.3 on JDK 1.5. Thinks just become hard if we intend to
>>
>>
>include
>
>
>>annotations in some of our files or use generics.
>>
>>Admittedly, I haven't played with JDK 1.5 generating 1.3-compatible class
>>files yet...
>>
>>Juergen
>>
>>
>>-----Original Message-----
>>From: spr...@li...
>>[mailto:spr...@li...]On Behalf
>>Of Colin Sampaleanu
>>Sent: Friday, March 11, 2005 12:51 AM
>>To: spr...@li...
>>Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2
>>rc1
>>
>>
>>Short of switching to separate source modules (hint hint :-) ), that's
>>going to be pretty hard to do. We can compile with JDK 1.5, for lower
>>target versions, but then if you don't specify a 1.5 target version, the
>>annotations stuff would blow up.
>>
>>
>>Juergen Hoeller wrote:
>>
>>
>>
>>
>>
>>>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.AnnotationsLocalSessionFactoryBe
a
>>
>>
>n
>
>
>>">
>>
>>
>>
>>
>>> <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]
>>
>>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|
|
From: Colin S. <col...@ex...> - 2005-03-11 22:42:12
|
Parallel to the 'spring' module is a module called samples. Inside that is a tiger project which contains the transaction Annotations stuff, including a unit test, as well as some more experimental JMX Annotation stuff that Rob did. Also inside samples is a tiger-samples/jpetstore-annotations project which is a version of the JPetstore that is almost identical to the commons-attribute version of the petstore, except it uses the Annotations code. The latter depends on the code from the 'tiger' project. The ant builds and Eclipse projects for these both use and expect JDK 1.5. There's no IDEA projects, since I don't use IDEA. Colin Juergen Hoeller wrote: >Well, we could simply give this a try - we'll see whether defining >annotation classes and writing annotations access works with "-target 1.3". >Generics shouldn't be a problem when just accessing an API - that should >(hopefully) not require "-target 1.5". Anyway, let's give this a try! > >On this occasion: Where does the JDK 1.5 transaction annotation code reside? >I can't find it in Spring CVS yet... We need to proceed quickly here; after >all, 1.2 RC1 is less than a week a way. > >Juergen > > >-----Original Message----- >From: spr...@li... >[mailto:spr...@li...]On Behalf >Of Colin Sampaleanu >Sent: Friday, March 11, 2005 10:34 PM >To: spr...@li... >Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2 >rc1 > > >We we do need to include the actual Annotation source files somewhere... > >On top of that, yes, you access the actual annotations via calls like > Annotation ann = targetClass.getAnnotation(filter); >or > Annotation ann = targetMethod.getAnnotation(filter); > >Now Annotation itself is for the most part just a regular Interface, but >it does have a method in it > Class<? extends Annotation> annotationType(); >which is 1.5 syntax specific, so I personally think 1.3 code is going to >barf on trying to use this interface, never mind that in practice, any >code which gets the annotation will quickly try to see if it's a >specific type (subclass) of Annotation (since this is just a marker >interface that does nothing by itself), and do something with it, so >really the code that manipulates the Annotations themselves would have >to be compiled as 1.5 as well. > >Colin > >Juergen Hoeller wrote: > > > >>Well, we only want to *access* annotations through the corresponding JDK >> >> >1.5 > > >>API. That should be possible with -source 1.3 and -target 1.3 too, if I >>understand the issue correctly. >> >>The only thing we can't do is include annotations in our sources and expect >>them to be compiled into the class files. Please let me know if I'm >>completely mistaken :-) >> >>Juergen >> >> >>-----Original Message----- >>From: spr...@li... >>[mailto:spr...@li...]On Behalf >>Of Colin Sampaleanu >>Sent: Friday, March 11, 2005 10:01 PM >>To: spr...@li... >>Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2 >>rc1 >> >> >>I think JDK 1.5 generating 1.3 compatible code would hopefully work >>fine. But realistically, we _do_ want to use annotations, as in the >>current Tx Annotations code... So there the problem becomes that if >>everything is in the same codebase, you can't really compile some parts >>with -1.3, and some with -1.5. >> >>Juergen Hoeller wrote: >> >> >> >> >> >>>Well, as long as we just compile against JDK 1.5 API or jars built with >>> >>> >JDK > > >>>1.5 (like hibernate-annotations.jar), we should be able to build >>>with -target 1.3 on JDK 1.5. Thinks just become hard if we intend to >>> >>> >>> >>> >>include >> >> >> >> >>>annotations in some of our files or use generics. >>> >>>Admittedly, I haven't played with JDK 1.5 generating 1.3-compatible class >>>files yet... >>> >>>Juergen >>> >>> >>>-----Original Message----- >>>From: spr...@li... >>>[mailto:spr...@li...]On Behalf >>>Of Colin Sampaleanu >>>Sent: Friday, March 11, 2005 12:51 AM >>>To: spr...@li... >>>Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2 >>>rc1 >>> >>> >>>Short of switching to separate source modules (hint hint :-) ), that's >>>going to be pretty hard to do. We can compile with JDK 1.5, for lower >>>target versions, but then if you don't specify a 1.5 target version, the >>>annotations stuff would blow up. >>> >>> >>>Juergen Hoeller wrote: >>> >>> >>> >>> >>> >>> >>> >>>>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.AnnotationsLocalSessionFactoryBe >>> >>> >a > > >>> >>> >>n >> >> >> >> >>>"> >>> >>> >>> >>> >>> >>> >>>> <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] >>> >>> >>> >>> > > > >------------------------------------------------------- >SF email is sponsored by - The IT Product Guide >Read honest & candid reviews on hundreds of IT Products from real users. >Discover which products truly live up to the hype. Start reading now. >http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >_______________________________________________ >Springframework-developer mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > >------------------------------------------------------- >SF email is sponsored by - The IT Product Guide >Read honest & candid reviews on hundreds of IT Products from real users. >Discover which products truly live up to the hype. Start reading now. >http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >_______________________________________________ >Springframework-developer mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > > |
|
From: Colin S. <col...@ex...> - 2005-03-11 22:44:34
|
The plan we (Rod and I) hatched after discussing things at TSSJS was that instead of shipping this stuff directly, we would ship a version based on Annogen, so that could be compiled with all the other normal code, and would have the benefit of also workin with JDK 1.4. However the fly in that ointment is that Annogen does not apparently support arrays in Annotations, and the TxAttribute Annotation does use those. Colin Sampaleanu wrote: > Parallel to the 'spring' module is a module called samples. Inside > that is a > tiger > project which contains the transaction Annotations stuff, including a > unit test, as well as some more experimental JMX Annotation stuff that > Rob did. Also inside samples is a > tiger-samples/jpetstore-annotations > project which is a version of the JPetstore that is almost identical > to the commons-attribute version of the petstore, except it uses the > Annotations code. The latter depends on the code from the 'tiger' > project. > > The ant builds and Eclipse projects for these both use and expect JDK > 1.5. There's no IDEA projects, since I don't use IDEA. > > Colin > > Juergen Hoeller wrote: > >> Well, we could simply give this a try - we'll see whether defining >> annotation classes and writing annotations access works with "-target >> 1.3". >> Generics shouldn't be a problem when just accessing an API - that should >> (hopefully) not require "-target 1.5". Anyway, let's give this a try! >> >> On this occasion: Where does the JDK 1.5 transaction annotation code >> reside? >> I can't find it in Spring CVS yet... We need to proceed quickly here; >> after >> all, 1.2 RC1 is less than a week a way. >> >> Juergen >> >> >> -----Original Message----- >> From: spr...@li... >> [mailto:spr...@li...]On Behalf >> Of Colin Sampaleanu >> Sent: Friday, March 11, 2005 10:34 PM >> To: spr...@li... >> Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2 >> rc1 >> >> >> We we do need to include the actual Annotation source files somewhere... >> >> On top of that, yes, you access the actual annotations via calls like >> Annotation ann = targetClass.getAnnotation(filter); >> or >> Annotation ann = targetMethod.getAnnotation(filter); >> >> Now Annotation itself is for the most part just a regular Interface, but >> it does have a method in it >> Class<? extends Annotation> annotationType(); >> which is 1.5 syntax specific, so I personally think 1.3 code is going to >> barf on trying to use this interface, never mind that in practice, any >> code which gets the annotation will quickly try to see if it's a >> specific type (subclass) of Annotation (since this is just a marker >> interface that does nothing by itself), and do something with it, so >> really the code that manipulates the Annotations themselves would have >> to be compiled as 1.5 as well. >> >> Colin >> >> Juergen Hoeller wrote: >> >> >> >>> Well, we only want to *access* annotations through the corresponding >>> JDK >>> >> >> 1.5 >> >> >>> API. That should be possible with -source 1.3 and -target 1.3 too, if I >>> understand the issue correctly. >>> >>> The only thing we can't do is include annotations in our sources and >>> expect >>> them to be compiled into the class files. Please let me know if I'm >>> completely mistaken :-) >>> >>> Juergen >>> >>> >>> -----Original Message----- >>> From: spr...@li... >>> [mailto:spr...@li...]On Behalf >>> Of Colin Sampaleanu >>> Sent: Friday, March 11, 2005 10:01 PM >>> To: spr...@li... >>> Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2 >>> rc1 >>> >>> >>> I think JDK 1.5 generating 1.3 compatible code would hopefully work >>> fine. But realistically, we _do_ want to use annotations, as in the >>> current Tx Annotations code... So there the problem becomes that if >>> everything is in the same codebase, you can't really compile some parts >>> with -1.3, and some with -1.5. >>> >>> Juergen Hoeller wrote: >>> >>> >>> >>> >>> >>>> Well, as long as we just compile against JDK 1.5 API or jars built >>>> with >>>> >>> >> JDK >> >> >>>> 1.5 (like hibernate-annotations.jar), we should be able to build >>>> with -target 1.3 on JDK 1.5. Thinks just become hard if we intend to >>>> >>>> >>>> >>> >>> include >>> >>> >>> >>> >>>> annotations in some of our files or use generics. >>>> >>>> Admittedly, I haven't played with JDK 1.5 generating 1.3-compatible >>>> class >>>> files yet... >>>> >>>> Juergen >>>> >>>> >>>> -----Original Message----- >>>> From: spr...@li... >>>> [mailto:spr...@li...]On >>>> Behalf >>>> Of Colin Sampaleanu >>>> Sent: Friday, March 11, 2005 12:51 AM >>>> To: spr...@li... >>>> Subject: Re: [Springframework-developer] Hibernate 3 annotations in >>>> 1.2 >>>> rc1 >>>> >>>> >>>> Short of switching to separate source modules (hint hint :-) ), that's >>>> going to be pretty hard to do. We can compile with JDK 1.5, for lower >>>> target versions, but then if you don't specify a 1.5 target >>>> version, the >>>> annotations stuff would blow up. >>>> >>>> >>>> Juergen Hoeller wrote: >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>> 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.AnnotationsLocalSessionFactoryBe >>>> >>>> >>> >> a >> >> >>>> >>> >>> n >>> >>> >>> >>> >>>> "> >>>> >>>> >>>> >>>> >>>> >>>> >>>>> <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] >>>> >>>> >>>> >>> >> >> >> >> ------------------------------------------------------- >> SF email is sponsored by - The IT Product Guide >> Read honest & candid reviews on hundreds of IT Products from real users. >> Discover which products truly live up to the hype. Start reading now. >> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >> _______________________________________________ >> Springframework-developer mailing list >> Spr...@li... >> https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> >> >> ------------------------------------------------------- >> SF email is sponsored by - The IT Product Guide >> Read honest & candid reviews on hundreds of IT Products from real users. >> Discover which products truly live up to the hype. Start reading now. >> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >> _______________________________________________ >> Springframework-developer mailing list >> Spr...@li... >> https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> > > |
|
From: Juergen H. <ju...@in...> - 2005-03-12 16:43:36
|
I've just looked at the code in the "tiger" module. I haven't considered
that annotation classes *themselves* use annotations too. This indeeds needs
to be built with "-source 1.5" and consequently also with "-target 1.5".
Which means that it's not feasible to include this in the standard Spring
1.2 download. I guess it's best then to keep the standard download buildable
on JDK 1.4, an of course runnable on JDK >= 1.3.
There is also a couple of things worth considering from the implementation
point of view. The JDK 1.5 enums for propagation behavior and isolation
level are pretty generic and would make sense in the transaction package
itself in a full JDK 1.5 version of Spring, replacing
PlatformTransactionManager's constants completely.
Furthermore, I would prefer "TransactionAttribute" or
"TransactionAnnotation" instead of "TxAttribute": we don't use "tx" anywhere
else. I think this has already been discussed before, but I don't remember
the result. Sure, we already have a TransactionAttribute class in the
"transaction.interceptor" package, but that wouldn't hurt if the JDK 1.5
stuff is in a separate package.
I would suggest to do a preview/add-on download of the JDK 1.5 transaction
annotation support plus the corresponding JPetStore version, probably around
the time of Spring 1.2 final (alongside the Web Flow preview download). No
problem to build with JDK 1.5 there!
-----
I'll also keep the Hibernate3 annotation support out of Spring 1.2. After
all, Hibernate annotations are still alpha anyway. The
AnnotationSessionFactoryBean is pretty simple anyway, so it should be
sufficient to put this integration code on the Wiki or the like.
Essentially, if you stick to enumerating the names of annotated classes in
standard "hibernate.cfg.xml", all you need is:
public class AnnotationsSessionFactoryBean extends LocalSessionFactoryBean {
protected Configuration newConfiguration() throws HibernateException {
return new AnnotationConfiguration();
}
}
and hibernate-annotation.jar on the class path. Actually, I'll probably add
a "configurationClass" property to our default LocalSessionFactoryBean: then
you wouldn't even need such a subclass but only a LocalSessionFactoryBean
definition with:
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation">
<value>classpath:hibernate.cfg.xml</value>
</property>
<property name="configurationClass">
<value>org.hibernate.cfg.AnnotationConfiguration</value>
</property>
</bean>
That should be good enough for a start. Enumerating the names of annotated
packages and classes on the LocalSessionFactoryBean itself is a convenience
feature that we can arguably provide later; it's easy enough to do in a
custom subclass of LocalSessionFactoryBean.
Juergen
-----Original Message-----
From: spr...@li...
[mailto:spr...@li...]On Behalf
Of Colin Sampaleanu
Sent: Friday, March 11, 2005 11:42 PM
To: spr...@li...
Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2
rc1
Parallel to the 'spring' module is a module called samples. Inside that is a
tiger
project which contains the transaction Annotations stuff, including a
unit test, as well as some more experimental JMX Annotation stuff that
Rob did. Also inside samples is a
tiger-samples/jpetstore-annotations
project which is a version of the JPetstore that is almost identical to
the commons-attribute version of the petstore, except it uses the
Annotations code. The latter depends on the code from the 'tiger' project.
The ant builds and Eclipse projects for these both use and expect JDK
1.5. There's no IDEA projects, since I don't use IDEA.
Colin
Juergen Hoeller wrote:
>Well, we could simply give this a try - we'll see whether defining
>annotation classes and writing annotations access works with "-target 1.3".
>Generics shouldn't be a problem when just accessing an API - that should
>(hopefully) not require "-target 1.5". Anyway, let's give this a try!
>
>On this occasion: Where does the JDK 1.5 transaction annotation code
reside?
>I can't find it in Spring CVS yet... We need to proceed quickly here; after
>all, 1.2 RC1 is less than a week a way.
>
>Juergen
>
>
>-----Original Message-----
>From: spr...@li...
>[mailto:spr...@li...]On Behalf
>Of Colin Sampaleanu
>Sent: Friday, March 11, 2005 10:34 PM
>To: spr...@li...
>Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2
>rc1
>
>
>We we do need to include the actual Annotation source files somewhere...
>
>On top of that, yes, you access the actual annotations via calls like
> Annotation ann = targetClass.getAnnotation(filter);
>or
> Annotation ann = targetMethod.getAnnotation(filter);
>
>Now Annotation itself is for the most part just a regular Interface, but
>it does have a method in it
> Class<? extends Annotation> annotationType();
>which is 1.5 syntax specific, so I personally think 1.3 code is going to
>barf on trying to use this interface, never mind that in practice, any
>code which gets the annotation will quickly try to see if it's a
>specific type (subclass) of Annotation (since this is just a marker
>interface that does nothing by itself), and do something with it, so
>really the code that manipulates the Annotations themselves would have
>to be compiled as 1.5 as well.
>
>Colin
>
>Juergen Hoeller wrote:
>
>
>
>>Well, we only want to *access* annotations through the corresponding JDK
>>
>>
>1.5
>
>
>>API. That should be possible with -source 1.3 and -target 1.3 too, if I
>>understand the issue correctly.
>>
>>The only thing we can't do is include annotations in our sources and
expect
>>them to be compiled into the class files. Please let me know if I'm
>>completely mistaken :-)
>>
>>Juergen
>>
>>
>>-----Original Message-----
>>From: spr...@li...
>>[mailto:spr...@li...]On Behalf
>>Of Colin Sampaleanu
>>Sent: Friday, March 11, 2005 10:01 PM
>>To: spr...@li...
>>Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2
>>rc1
>>
>>
>>I think JDK 1.5 generating 1.3 compatible code would hopefully work
>>fine. But realistically, we _do_ want to use annotations, as in the
>>current Tx Annotations code... So there the problem becomes that if
>>everything is in the same codebase, you can't really compile some parts
>>with -1.3, and some with -1.5.
>>
>>Juergen Hoeller wrote:
>>
>>
>>
>>
>>
>>>Well, as long as we just compile against JDK 1.5 API or jars built with
>>>
>>>
>JDK
>
>
>>>1.5 (like hibernate-annotations.jar), we should be able to build
>>>with -target 1.3 on JDK 1.5. Thinks just become hard if we intend to
>>>
>>>
>>>
>>>
>>include
>>
>>
>>
>>
>>>annotations in some of our files or use generics.
>>>
>>>Admittedly, I haven't played with JDK 1.5 generating 1.3-compatible class
>>>files yet...
>>>
>>>Juergen
>>>
>>>
>>>-----Original Message-----
>>>From: spr...@li...
>>>[mailto:spr...@li...]On Behalf
>>>Of Colin Sampaleanu
>>>Sent: Friday, March 11, 2005 12:51 AM
>>>To: spr...@li...
>>>Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2
>>>rc1
>>>
>>>
>>>Short of switching to separate source modules (hint hint :-) ), that's
>>>going to be pretty hard to do. We can compile with JDK 1.5, for lower
>>>target versions, but then if you don't specify a 1.5 target version, the
>>>annotations stuff would blow up.
>>>
>>>
>>>Juergen Hoeller wrote:
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>>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.AnnotationsLocalSessionFactoryB
e
>>>
>>>
>a
>
>
>>>
>>>
>>n
>>
>>
>>
>>
>>>">
>>>
>>>
>>>
>>>
>>>
>>>
>>>> <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]
>>>
>>>
>>>
>>>
>
>
>
>-------------------------------------------------------
>SF email is sponsored by - The IT Product Guide
>Read honest & candid reviews on hundreds of IT Products from real users.
>Discover which products truly live up to the hype. Start reading now.
>http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
>_______________________________________________
>Springframework-developer mailing list
>Spr...@li...
>https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
>
>-------------------------------------------------------
>SF email is sponsored by - The IT Product Guide
>Read honest & candid reviews on hundreds of IT Products from real users.
>Discover which products truly live up to the hype. Start reading now.
>http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
>_______________________________________________
>Springframework-developer mailing list
>Spr...@li...
>https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|
|
From: Thomas R. <tho...@tr...> - 2005-03-12 18:41:17
|
+1 for TransactionAttribute
I also think that an add-on download would be OK to begin with, but we =20=
need to come up with a long-term strategy for targeting 1.3, 1.4 and =20=
5.0.
Thomas
On Mar 12, 2005, at 11:43 AM, Juergen Hoeller wrote:
> I've just looked at the code in the "tiger" module. I haven't =20
> considered
> that annotation classes *themselves* use annotations too. This indeeds =
=20
> needs
> to be built with "-source 1.5" and consequently also with "-target =20
> 1.5".
>
> Which means that it's not feasible to include this in the standard =20
> Spring
> 1.2 download. I guess it's best then to keep the standard download =20
> buildable
> on JDK 1.4, an of course runnable on JDK >=3D 1.3.
>
> There is also a couple of things worth considering from the =20
> implementation
> point of view. The JDK 1.5 enums for propagation behavior and =
isolation
> level are pretty generic and would make sense in the transaction =20
> package
> itself in a full JDK 1.5 version of Spring, replacing
> PlatformTransactionManager's constants completely.
>
> Furthermore, I would prefer "TransactionAttribute" or
> "TransactionAnnotation" instead of "TxAttribute": we don't use "tx" =20=
> anywhere
> else. I think this has already been discussed before, but I don't =20
> remember
> the result. Sure, we already have a TransactionAttribute class in the
> "transaction.interceptor" package, but that wouldn't hurt if the JDK =20=
> 1.5
> stuff is in a separate package.
>
> I would suggest to do a preview/add-on download of the JDK 1.5 =20
> transaction
> annotation support plus the corresponding JPetStore version, probably =20=
> around
> the time of Spring 1.2 final (alongside the Web Flow preview =20
> download). No
> problem to build with JDK 1.5 there!
>
> -----
>
> I'll also keep the Hibernate3 annotation support out of Spring 1.2. =20=
> After
> all, Hibernate annotations are still alpha anyway. The
> AnnotationSessionFactoryBean is pretty simple anyway, so it should be
> sufficient to put this integration code on the Wiki or the like.
> Essentially, if you stick to enumerating the names of annotated =20
> classes in
> standard "hibernate.cfg.xml", all you need is:
>
> public class AnnotationsSessionFactoryBean extends =20
> LocalSessionFactoryBean {
>
> protected Configuration newConfiguration() throws =
HibernateException {
> return new AnnotationConfiguration();
> }
> }
>
> and hibernate-annotation.jar on the class path. Actually, I'll =20
> probably add
> a "configurationClass" property to our default =20
> LocalSessionFactoryBean: then
> you wouldn't even need such a subclass but only a =20
> LocalSessionFactoryBean
> definition with:
>
> <bean id=3D"sessionFactory"
> class=3D"org.springframework.orm.hibernate3.LocalSessionFactoryBean">
> <property name=3D"configLocation">
> <value>classpath:hibernate.cfg.xml</value>
> </property>
> <property name=3D"configurationClass">
> <value>org.hibernate.cfg.AnnotationConfiguration</value>
> </property>
> </bean>
>
> That should be good enough for a start. Enumerating the names of =20
> annotated
> packages and classes on the LocalSessionFactoryBean itself is a =20
> convenience
> feature that we can arguably provide later; it's easy enough to do in =
a
> custom subclass of LocalSessionFactoryBean.
>
> Juergen
>
>
>
> -----Original Message-----
> From: spr...@li...
> [mailto:spr...@li...]On =
Behalf
> Of Colin Sampaleanu
> Sent: Friday, March 11, 2005 11:42 PM
> To: spr...@li...
> Subject: Re: [Springframework-developer] Hibernate 3 annotations in =
1.2
> rc1
>
>
> Parallel to the 'spring' module is a module called samples. Inside =20
> that is a
> tiger
> project which contains the transaction Annotations stuff, including a
> unit test, as well as some more experimental JMX Annotation stuff that
> Rob did. Also inside samples is a
> tiger-samples/jpetstore-annotations
> project which is a version of the JPetstore that is almost identical =
to
> the commons-attribute version of the petstore, except it uses the
> Annotations code. The latter depends on the code from the 'tiger' =20
> project.
>
> The ant builds and Eclipse projects for these both use and expect JDK
> 1.5. There's no IDEA projects, since I don't use IDEA.
>
> Colin
>
> Juergen Hoeller wrote:
>
>> Well, we could simply give this a try - we'll see whether defining
>> annotation classes and writing annotations access works with "-target =
=20
>> 1.3".
>> Generics shouldn't be a problem when just accessing an API - that =20
>> should
>> (hopefully) not require "-target 1.5". Anyway, let's give this a try!
>>
>> On this occasion: Where does the JDK 1.5 transaction annotation code
> reside?
>> I can't find it in Spring CVS yet... We need to proceed quickly here; =
=20
>> after
>> all, 1.2 RC1 is less than a week a way.
>>
>> Juergen
>>
>>
>> -----Original Message-----
>> From: spr...@li...
>> [mailto:spr...@li...]On =20
>> Behalf
>> Of Colin Sampaleanu
>> Sent: Friday, March 11, 2005 10:34 PM
>> To: spr...@li...
>> Subject: Re: [Springframework-developer] Hibernate 3 annotations in =20=
>> 1.2
>> rc1
>>
>>
>> We we do need to include the actual Annotation source files =20
>> somewhere...
>>
>> On top of that, yes, you access the actual annotations via calls like
>> Annotation ann =3D targetClass.getAnnotation(filter);
>> or
>> Annotation ann =3D targetMethod.getAnnotation(filter);
>>
>> Now Annotation itself is for the most part just a regular Interface, =20=
>> but
>> it does have a method in it
>> Class<? extends Annotation> annotationType();
>> which is 1.5 syntax specific, so I personally think 1.3 code is going =
=20
>> to
>> barf on trying to use this interface, never mind that in practice, =
any
>> code which gets the annotation will quickly try to see if it's a
>> specific type (subclass) of Annotation (since this is just a marker
>> interface that does nothing by itself), and do something with it, so
>> really the code that manipulates the Annotations themselves would =
have
>> to be compiled as 1.5 as well.
>>
>> Colin
>>
>> Juergen Hoeller wrote:
>>
>>
>>
>>> Well, we only want to *access* annotations through the corresponding =
=20
>>> JDK
>>>
>>>
>> 1.5
>>
>>
>>> API. That should be possible with -source 1.3 and -target 1.3 too, =20=
>>> if I
>>> understand the issue correctly.
>>>
>>> The only thing we can't do is include annotations in our sources and
> expect
>>> them to be compiled into the class files. Please let me know if I'm
>>> completely mistaken :-)
>>>
>>> Juergen
>>>
>>>
>>> -----Original Message-----
>>> From: spr...@li...
>>> [mailto:spr...@li...]On =20
>>> Behalf
>>> Of Colin Sampaleanu
>>> Sent: Friday, March 11, 2005 10:01 PM
>>> To: spr...@li...
>>> Subject: Re: [Springframework-developer] Hibernate 3 annotations in =20=
>>> 1.2
>>> rc1
>>>
>>>
>>> I think JDK 1.5 generating 1.3 compatible code would hopefully work
>>> fine. But realistically, we _do_ want to use annotations, as in the
>>> current Tx Annotations code... So there the problem becomes that if
>>> everything is in the same codebase, you can't really compile some =20=
>>> parts
>>> with -1.3, and some with -1.5.
>>>
>>> Juergen Hoeller wrote:
>>>
>>>
>>>
>>>
>>>
>>>> Well, as long as we just compile against JDK 1.5 API or jars built =20=
>>>> with
>>>>
>>>>
>> JDK
>>
>>
>>>> 1.5 (like hibernate-annotations.jar), we should be able to build
>>>> with -target 1.3 on JDK 1.5. Thinks just become hard if we intend =
to
>>>>
>>>>
>>>>
>>>>
>>> include
>>>
>>>
>>>
>>>
>>>> annotations in some of our files or use generics.
>>>>
>>>> Admittedly, I haven't played with JDK 1.5 generating 1.3-compatible =
=20
>>>> class
>>>> files yet...
>>>>
>>>> Juergen
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: spr...@li...
>>>> [mailto:spr...@li...]On =20=
>>>> Behalf
>>>> Of Colin Sampaleanu
>>>> Sent: Friday, March 11, 2005 12:51 AM
>>>> To: spr...@li...
>>>> Subject: Re: [Springframework-developer] Hibernate 3 annotations in =
=20
>>>> 1.2
>>>> rc1
>>>>
>>>>
>>>> Short of switching to separate source modules (hint hint :-) ), =20
>>>> that's
>>>> going to be pretty hard to do. We can compile with JDK 1.5, for =20
>>>> lower
>>>> target versions, but then if you don't specify a 1.5 target =20
>>>> version, the
>>>> annotations stuff would blow up.
>>>>
>>>>
>>>> Juergen Hoeller wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> Thanks for the suggestion, Dan! I've prototypically added such an
>>>>> AnnotationsSessionFactoryBean.
>>>>> However, the Hibernate3 annotations jar is built with JDK 1.5, so =20=
>>>>> 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 =20
>>>>> anyway,
>>>>> though, for our new transaction annotation feature that we'd like =20=
>>>>> 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=92ve attached an implementation of
>>>>> the bean definition I described below.
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Dan
>>>>>
>>>>> =20
>>>>> =
-------------------------------------------------------------------=20
>>>>> ---
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>> --
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> *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=92ve bean mucking around with Hibernate 3 (with annotations)
>>>>> support in nightly build. All is going well but I thought I would
>>>>> offer some feedback=85
>>>>>
>>>>> 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=85
>>>>>
>>>>> A provided extension of LocalSessionFactoryBean that had support
>>>>> for annotated classes would be nice. The bean definition could
>>>>> look something like:
>>>>>
>>>>> <bean id=3D"sessionFactory"
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>> =
class=3D"org.springframework.orm.hibernate3.AnnotationsLocalSessionFac=20=
>>>> toryB
> e
>>>>
>>>>
>> a
>>
>>
>>>>
>>>>
>>> n
>>>
>>>
>>>
>>>
>>>> ">
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> <property name=3D"dataSource">
>>>>>
>>>>> <ref local=3D"dataSource"/>
>>>>>
>>>>> </property>
>>>>>
>>>>> <property name=3D"mappingPackage">
>>>>>
>>>>> <value>some.package</value>
>>>>>
>>>>> </property>
>>>>>
>>>>> <property name=3D"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, =20
>>>>> viruses,
>>>>>
>>>>>
>>>>>
>>>>>
>>> loss
>>>
>>>
>>>
>>>
>>>>>
>>>>>
>>>> and/or damage arising from using, opening or transmitting this =20
>>>> email.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> If you are not the intended recipient you must not use, interfere =20=
>>>>> with,
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>> disclose, copy or retain this email and you should notify the =
sender
>>>> immediately by return email or by contacting Sensis Pty Ltd by =20
>>>> 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, =20
>>>>> viruses,
>>>>>
>>>>>
>>>>>
>>>>>
>>> loss
>>>
>>>
>>>
>>>
>>>>>
>>>>>
>>>> and/or damage arising from using, opening or transmitting this =20
>>>> email.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> If you are not the intended recipient you must not use, interfere =20=
>>>>> with,
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>> disclose, copy or retain this email and you should notify the =
sender
>>>> immediately by return email or by contacting Sensis Pty Ltd by =20
>>>> telephone
>>>>
>>>>
>> on
>>
>>
>>>> [+61 3 8653 5000]
>>>>
>>>>
>>>>
>>>>
>>
>>
>>
>> -------------------------------------------------------
>> SF email is sponsored by - The IT Product Guide
>> Read honest & candid reviews on hundreds of IT Products from real =20
>> users.
>> Discover which products truly live up to the hype. Start reading now.
>> http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick
>> _______________________________________________
>> Springframework-developer mailing list
>> Spr...@li...
>> =
https://lists.sourceforge.net/lists/listinfo/springframework-developer
>>
>>
>>
>> -------------------------------------------------------
>> SF email is sponsored by - The IT Product Guide
>> Read honest & candid reviews on hundreds of IT Products from real =20
>> users.
>> Discover which products truly live up to the hype. Start reading now.
>> http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick
>> _______________________________________________
>> Springframework-developer mailing list
>> Spr...@li...
>> =
https://lists.sourceforge.net/lists/listinfo/springframework-developer
>>
>>
>
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real =20
> users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real =20
> users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
|
|
From: Colin S. <col...@ex...> - 2005-03-12 18:54:04
|
TxAttribute was intentional. The problem with TransactionAttribute is
that that is what EJB3 uses. If we use that, then it would preclude a
file having both our and their Annotations, or they would have to be
spelled out in fully qualified form (with package). I think that's not
acceptable.
However, I just saw an AOP/Annotations article a few days ago (from
Adrian Coyler I think), where he made up an annotation called
'Transactional'. How about using that?
Colin
Thomas Risberg wrote:
> +1 for TransactionAttribute
>
> I also think that an add-on download would be OK to begin with, but
> we need to come up with a long-term strategy for targeting 1.3, 1.4
> and 5.0.
>
> Thomas
>
> On Mar 12, 2005, at 11:43 AM, Juergen Hoeller wrote:
>
>> I've just looked at the code in the "tiger" module. I haven't
>> considered
>> that annotation classes *themselves* use annotations too. This
>> indeeds needs
>> to be built with "-source 1.5" and consequently also with "-target
>> 1.5".
>>
>> Which means that it's not feasible to include this in the standard
>> Spring
>> 1.2 download. I guess it's best then to keep the standard download
>> buildable
>> on JDK 1.4, an of course runnable on JDK >= 1.3.
>>
>> There is also a couple of things worth considering from the
>> implementation
>> point of view. The JDK 1.5 enums for propagation behavior and isolation
>> level are pretty generic and would make sense in the transaction
>> package
>> itself in a full JDK 1.5 version of Spring, replacing
>> PlatformTransactionManager's constants completely.
>>
>> Furthermore, I would prefer "TransactionAttribute" or
>> "TransactionAnnotation" instead of "TxAttribute": we don't use "tx"
>> anywhere
>> else. I think this has already been discussed before, but I don't
>> remember
>> the result. Sure, we already have a TransactionAttribute class in the
>> "transaction.interceptor" package, but that wouldn't hurt if the JDK
>> 1.5
>> stuff is in a separate package.
>>
>> I would suggest to do a preview/add-on download of the JDK 1.5
>> transaction
>> annotation support plus the corresponding JPetStore version,
>> probably around
>> the time of Spring 1.2 final (alongside the Web Flow preview
>> download). No
>> problem to build with JDK 1.5 there!
>>
>> -----
>>
>> I'll also keep the Hibernate3 annotation support out of Spring 1.2.
>> After
>> all, Hibernate annotations are still alpha anyway. The
>> AnnotationSessionFactoryBean is pretty simple anyway, so it should be
>> sufficient to put this integration code on the Wiki or the like.
>> Essentially, if you stick to enumerating the names of annotated
>> classes in
>> standard "hibernate.cfg.xml", all you need is:
>>
>> public class AnnotationsSessionFactoryBean extends
>> LocalSessionFactoryBean {
>>
>> protected Configuration newConfiguration() throws
>> HibernateException {
>> return new AnnotationConfiguration();
>> }
>> }
>>
>> and hibernate-annotation.jar on the class path. Actually, I'll
>> probably add
>> a "configurationClass" property to our default
>> LocalSessionFactoryBean: then
>> you wouldn't even need such a subclass but only a
>> LocalSessionFactoryBean
>> definition with:
>>
>> <bean id="sessionFactory"
>> class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
>> <property name="configLocation">
>> <value>classpath:hibernate.cfg.xml</value>
>> </property>
>> <property name="configurationClass">
>> <value>org.hibernate.cfg.AnnotationConfiguration</value>
>> </property>
>> </bean>
>>
>> That should be good enough for a start. Enumerating the names of
>> annotated
>> packages and classes on the LocalSessionFactoryBean itself is a
>> convenience
>> feature that we can arguably provide later; it's easy enough to do in a
>> custom subclass of LocalSessionFactoryBean.
>>
>> Juergen
>>
>>
>>
>> -----Original Message-----
>> From: spr...@li...
>> [mailto:spr...@li...]On Behalf
>> Of Colin Sampaleanu
>> Sent: Friday, March 11, 2005 11:42 PM
>> To: spr...@li...
>> Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2
>> rc1
>>
>>
>> Parallel to the 'spring' module is a module called samples. Inside
>> that is a
>> tiger
>> project which contains the transaction Annotations stuff, including a
>> unit test, as well as some more experimental JMX Annotation stuff that
>> Rob did. Also inside samples is a
>> tiger-samples/jpetstore-annotations
>> project which is a version of the JPetstore that is almost identical to
>> the commons-attribute version of the petstore, except it uses the
>> Annotations code. The latter depends on the code from the 'tiger'
>> project.
>>
>> The ant builds and Eclipse projects for these both use and expect JDK
>> 1.5. There's no IDEA projects, since I don't use IDEA.
>>
>> Colin
>>
>> Juergen Hoeller wrote:
>>
>>> Well, we could simply give this a try - we'll see whether defining
>>> annotation classes and writing annotations access works with
>>> "-target 1.3".
>>> Generics shouldn't be a problem when just accessing an API - that
>>> should
>>> (hopefully) not require "-target 1.5". Anyway, let's give this a try!
>>>
>>> On this occasion: Where does the JDK 1.5 transaction annotation code
>>
>> reside?
>>
>>> I can't find it in Spring CVS yet... We need to proceed quickly
>>> here; after
>>> all, 1.2 RC1 is less than a week a way.
>>>
>>> Juergen
>>>
>>>
>>> -----Original Message-----
>>> From: spr...@li...
>>> [mailto:spr...@li...]On
>>> Behalf
>>> Of Colin Sampaleanu
>>> Sent: Friday, March 11, 2005 10:34 PM
>>> To: spr...@li...
>>> Subject: Re: [Springframework-developer] Hibernate 3 annotations in
>>> 1.2
>>> rc1
>>>
>>>
>>> We we do need to include the actual Annotation source files
>>> somewhere...
>>>
>>> On top of that, yes, you access the actual annotations via calls like
>>> Annotation ann = targetClass.getAnnotation(filter);
>>> or
>>> Annotation ann = targetMethod.getAnnotation(filter);
>>>
>>> Now Annotation itself is for the most part just a regular
>>> Interface, but
>>> it does have a method in it
>>> Class<? extends Annotation> annotationType();
>>> which is 1.5 syntax specific, so I personally think 1.3 code is
>>> going to
>>> barf on trying to use this interface, never mind that in practice, any
>>> code which gets the annotation will quickly try to see if it's a
>>> specific type (subclass) of Annotation (since this is just a marker
>>> interface that does nothing by itself), and do something with it, so
>>> really the code that manipulates the Annotations themselves would have
>>> to be compiled as 1.5 as well.
>>>
>>> Colin
>>>
>>> Juergen Hoeller wrote:
>>>
>>>
>>>
>>>> Well, we only want to *access* annotations through the
>>>> corresponding JDK
>>>>
>>>>
>>> 1.5
>>>
>>>
>>>> API. That should be possible with -source 1.3 and -target 1.3 too,
>>>> if I
>>>> understand the issue correctly.
>>>>
>>>> The only thing we can't do is include annotations in our sources and
>>>
>> expect
>>
>>>> them to be compiled into the class files. Please let me know if I'm
>>>> completely mistaken :-)
>>>>
>>>> Juergen
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: spr...@li...
>>>> [mailto:spr...@li...]On
>>>> Behalf
>>>> Of Colin Sampaleanu
>>>> Sent: Friday, March 11, 2005 10:01 PM
>>>> To: spr...@li...
>>>> Subject: Re: [Springframework-developer] Hibernate 3 annotations
>>>> in 1.2
>>>> rc1
>>>>
>>>>
>>>> I think JDK 1.5 generating 1.3 compatible code would hopefully work
>>>> fine. But realistically, we _do_ want to use annotations, as in the
>>>> current Tx Annotations code... So there the problem becomes that if
>>>> everything is in the same codebase, you can't really compile some
>>>> parts
>>>> with -1.3, and some with -1.5.
>>>>
>>>> Juergen Hoeller wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> Well, as long as we just compile against JDK 1.5 API or jars
>>>>> built with
>>>>>
>>>>>
>>> JDK
>>>
>>>
>>>>> 1.5 (like hibernate-annotations.jar), we should be able to build
>>>>> with -target 1.3 on JDK 1.5. Thinks just become hard if we intend to
>>>>>
>>>>>
>>>>>
>>>>>
>>>> include
>>>>
>>>>
>>>>
>>>>
>>>>> annotations in some of our files or use generics.
>>>>>
>>>>> Admittedly, I haven't played with JDK 1.5 generating
>>>>> 1.3-compatible class
>>>>> files yet...
>>>>>
>>>>> Juergen
>>>>>
>>>>>
>>>>> -----Original Message-----
>>>>> From: spr...@li...
>>>>> [mailto:spr...@li...]On
>>>>> Behalf
>>>>> Of Colin Sampaleanu
>>>>> Sent: Friday, March 11, 2005 12:51 AM
>>>>> To: spr...@li...
>>>>> Subject: Re: [Springframework-developer] Hibernate 3 annotations
>>>>> in 1.2
>>>>> rc1
>>>>>
>>>>>
>>>>> Short of switching to separate source modules (hint hint :-) ),
>>>>> that's
>>>>> going to be pretty hard to do. We can compile with JDK 1.5, for
>>>>> lower
>>>>> target versions, but then if you don't specify a 1.5 target
>>>>> version, the
>>>>> annotations stuff would blow up.
>>>>>
>>>>>
>>>>> Juergen Hoeller wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> 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.AnnotationsLocalSessionFac
>>>>> toryB
>>>>
>> e
>>
>>>>>
>>>>>
>>> a
>>>
>>>
>>>>>
>>>>>
>>>> n
>>>>
>>>>
>>>>
>>>>
>>>>> ">
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> <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]
>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>>
>>>
>>> -------------------------------------------------------
>>> SF email is sponsored by - The IT Product Guide
>>> Read honest & candid reviews on hundreds of IT Products from real
>>> users.
>>> Discover which products truly live up to the hype. Start reading now.
>>> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
>>> _______________________________________________
>>> Springframework-developer mailing list
>>> Spr...@li...
>>> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>>>
>>>
>>>
>>> -------------------------------------------------------
>>> SF email is sponsored by - The IT Product Guide
>>> Read honest & candid reviews on hundreds of IT Products from real
>>> users.
>>> Discover which products truly live up to the hype. Start reading now.
>>> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
>>> _______________________________________________
>>> Springframework-developer mailing list
>>> Spr...@li...
>>> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>>>
>>>
>>
>>
>>
>> -------------------------------------------------------
>> SF email is sponsored by - The IT Product Guide
>> Read honest & candid reviews on hundreds of IT Products from real
>> users.
>> Discover which products truly live up to the hype. Start reading now.
>> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
>> _______________________________________________
>> Springframework-developer mailing list
>> Spr...@li...
>> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>>
>>
>>
>> -------------------------------------------------------
>> SF email is sponsored by - The IT Product Guide
>> Read honest & candid reviews on hundreds of IT Products from real
>> users.
>> Discover which products truly live up to the hype. Start reading now.
>> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
>> _______________________________________________
>> Springframework-developer mailing list
>> Spr...@li...
>> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>>
>>
>
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
|
|
From: Erwin V. <erw...@er...> - 2005-03-12 19:02:49
|
+1 for "Transactional"
Not sure if there is a naming convention for attributes? It seems to make=
=20
sense that the name of the attribute expresses some 'property' of a class=
,=20
method, ...: e.g. "this method is transactional", "this class is=20
persistent", "this property is validated". If you follow that kind of nam=
ing=20
system Transactional actually makes more sense than TransactionAttribute.
Erwin
----- Original Message -----=20
From: "Colin Sampaleanu" <col...@ex...>
To: <spr...@li...>
Sent: Saturday, March 12, 2005 7:53 PM
Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2 r=
c1
> TxAttribute was intentional. The problem with TransactionAttribute is t=
hat=20
> that is what EJB3 uses. If we use that, then it would preclude a file=20
> having both our and their Annotations, or they would have to be spelled=
=20
> out in fully qualified form (with package). I think that's not acceptab=
le.
>
> However, I just saw an AOP/Annotations article a few days ago (from Adr=
ian=20
> Coyler I think), where he made up an annotation called 'Transactional'.=
=20
> How about using that?
>
> Colin
>
>
> Thomas Risberg wrote:
>
>> +1 for TransactionAttribute
>>
>> I also think that an add-on download would be OK to begin with, but we=
=20
>> need to come up with a long-term strategy for targeting 1.3, 1.4 and=20
>> 5.0.
>>
>> Thomas
>>
>> On Mar 12, 2005, at 11:43 AM, Juergen Hoeller wrote:
>>
>>> I've just looked at the code in the "tiger" module. I haven't=20
>>> considered
>>> that annotation classes *themselves* use annotations too. This indeed=
s=20
>>> needs
>>> to be built with "-source 1.5" and consequently also with "-target=20
>>> 1.5".
>>>
>>> Which means that it's not feasible to include this in the standard=20
>>> Spring
>>> 1.2 download. I guess it's best then to keep the standard download=20
>>> buildable
>>> on JDK 1.4, an of course runnable on JDK >=3D 1.3.
>>>
>>> There is also a couple of things worth considering from the=20
>>> implementation
>>> point of view. The JDK 1.5 enums for propagation behavior and isolati=
on
>>> level are pretty generic and would make sense in the transaction=20
>>> package
>>> itself in a full JDK 1.5 version of Spring, replacing
>>> PlatformTransactionManager's constants completely.
>>>
>>> Furthermore, I would prefer "TransactionAttribute" or
>>> "TransactionAnnotation" instead of "TxAttribute": we don't use "tx"=20
>>> anywhere
>>> else. I think this has already been discussed before, but I don't=20
>>> remember
>>> the result. Sure, we already have a TransactionAttribute class in the
>>> "transaction.interceptor" package, but that wouldn't hurt if the JDK=20
>>> 1.5
>>> stuff is in a separate package.
>>>
>>> I would suggest to do a preview/add-on download of the JDK 1.5=20
>>> transaction
>>> annotation support plus the corresponding JPetStore version, probably=
=20
>>> around
>>> the time of Spring 1.2 final (alongside the Web Flow preview downloa=
d).=20
>>> No
>>> problem to build with JDK 1.5 there!
>>>
>>> -----
>>>
>>> I'll also keep the Hibernate3 annotation support out of Spring 1.2.=20
>>> After
>>> all, Hibernate annotations are still alpha anyway. The
>>> AnnotationSessionFactoryBean is pretty simple anyway, so it should be
>>> sufficient to put this integration code on the Wiki or the like.
>>> Essentially, if you stick to enumerating the names of annotated clas=
ses=20
>>> in
>>> standard "hibernate.cfg.xml", all you need is:
>>>
>>> public class AnnotationsSessionFactoryBean extends=20
>>> LocalSessionFactoryBean {
>>>
>>> protected Configuration newConfiguration() throws HibernateExcept=
ion=20
>>> {
>>> return new AnnotationConfiguration();
>>> }
>>> }
>>>
>>> and hibernate-annotation.jar on the class path. Actually, I'll proba=
bly=20
>>> add
>>> a "configurationClass" property to our default LocalSessionFactoryBe=
an:=20
>>> then
>>> you wouldn't even need such a subclass but only a=20
>>> LocalSessionFactoryBean
>>> definition with:
>>>
>>> <bean id=3D"sessionFactory"
>>> class=3D"org.springframework.orm.hibernate3.LocalSessionFactoryBean">
>>> <property name=3D"configLocation">
>>> <value>classpath:hibernate.cfg.xml</value>
>>> </property>
>>> <property name=3D"configurationClass">
>>> <value>org.hibernate.cfg.AnnotationConfiguration</value>
>>> </property>
>>> </bean>
>>>
>>> That should be good enough for a start. Enumerating the names of=20
>>> annotated
>>> packages and classes on the LocalSessionFactoryBean itself is a=20
>>> convenience
>>> feature that we can arguably provide later; it's easy enough to do in=
a
>>> custom subclass of LocalSessionFactoryBean.
>>>
>>> Juergen
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: spr...@li...
>>> [mailto:spr...@li...]On Beha=
lf
>>> Of Colin Sampaleanu
>>> Sent: Friday, March 11, 2005 11:42 PM
>>> To: spr...@li...
>>> Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1=
.2
>>> rc1
>>>
>>>
>>> Parallel to the 'spring' module is a module called samples. Inside t=
hat=20
>>> is a
>>> tiger
>>> project which contains the transaction Annotations stuff, including a
>>> unit test, as well as some more experimental JMX Annotation stuff tha=
t
>>> Rob did. Also inside samples is a
>>> tiger-samples/jpetstore-annotations
>>> project which is a version of the JPetstore that is almost identical =
to
>>> the commons-attribute version of the petstore, except it uses the
>>> Annotations code. The latter depends on the code from the 'tiger'=20
>>> project.
>>>
>>> The ant builds and Eclipse projects for these both use and expect JDK
>>> 1.5. There's no IDEA projects, since I don't use IDEA.
>>>
>>> Colin
>>>
>>> Juergen Hoeller wrote:
>>>
>>>> Well, we could simply give this a try - we'll see whether defining
>>>> annotation classes and writing annotations access works with "-targe=
t=20
>>>> 1.3".
>>>> Generics shouldn't be a problem when just accessing an API - that=20
>>>> should
>>>> (hopefully) not require "-target 1.5". Anyway, let's give this a try=
!
>>>>
>>>> On this occasion: Where does the JDK 1.5 transaction annotation code
>>>
>>> reside?
>>>
>>>> I can't find it in Spring CVS yet... We need to proceed quickly here=
;=20
>>>> after
>>>> all, 1.2 RC1 is less than a week a way.
>>>>
>>>> Juergen
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: spr...@li...
>>>> [mailto:spr...@li...]On=20
>>>> Behalf
>>>> Of Colin Sampaleanu
>>>> Sent: Friday, March 11, 2005 10:34 PM
>>>> To: spr...@li...
>>>> Subject: Re: [Springframework-developer] Hibernate 3 annotations in=20
>>>> 1.2
>>>> rc1
>>>>
>>>>
>>>> We we do need to include the actual Annotation source files=20
>>>> somewhere...
>>>>
>>>> On top of that, yes, you access the actual annotations via calls lik=
e
>>>> Annotation ann =3D targetClass.getAnnotation(filter);
>>>> or
>>>> Annotation ann =3D targetMethod.getAnnotation(filter);
>>>>
>>>> Now Annotation itself is for the most part just a regular Interface,=
=20
>>>> but
>>>> it does have a method in it
>>>> Class<? extends Annotation> annotationType();
>>>> which is 1.5 syntax specific, so I personally think 1.3 code is goin=
g=20
>>>> to
>>>> barf on trying to use this interface, never mind that in practice, a=
ny
>>>> code which gets the annotation will quickly try to see if it's a
>>>> specific type (subclass) of Annotation (since this is just a marker
>>>> interface that does nothing by itself), and do something with it, so
>>>> really the code that manipulates the Annotations themselves would ha=
ve
>>>> to be compiled as 1.5 as well.
>>>>
>>>> Colin
>>>>
>>>> Juergen Hoeller wrote:
>>>>
>>>>
>>>>
>>>>> Well, we only want to *access* annotations through the correspondin=
g=20
>>>>> JDK
>>>>>
>>>>>
>>>> 1.5
>>>>
>>>>
>>>>> API. That should be possible with -source 1.3 and -target 1.3 too, =
if=20
>>>>> I
>>>>> understand the issue correctly.
>>>>>
>>>>> The only thing we can't do is include annotations in our sources an=
d
>>>>
>>> expect
>>>
>>>>> them to be compiled into the class files. Please let me know if I'm
>>>>> completely mistaken :-)
>>>>>
>>>>> Juergen
>>>>>
>>>>>
>>>>> -----Original Message-----
>>>>> From: spr...@li...
>>>>> [mailto:spr...@li...]On=20
>>>>> Behalf
>>>>> Of Colin Sampaleanu
>>>>> Sent: Friday, March 11, 2005 10:01 PM
>>>>> To: spr...@li...
>>>>> Subject: Re: [Springframework-developer] Hibernate 3 annotations in=
=20
>>>>> 1.2
>>>>> rc1
>>>>>
>>>>>
>>>>> I think JDK 1.5 generating 1.3 compatible code would hopefully work
>>>>> fine. But realistically, we _do_ want to use annotations, as in the
>>>>> current Tx Annotations code... So there the problem becomes that if
>>>>> everything is in the same codebase, you can't really compile some=20
>>>>> parts
>>>>> with -1.3, and some with -1.5.
>>>>>
>>>>> Juergen Hoeller wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Well, as long as we just compile against JDK 1.5 API or jars built=
=20
>>>>>> with
>>>>>>
>>>>>>
>>>> JDK
>>>>
>>>>
>>>>>> 1.5 (like hibernate-annotations.jar), we should be able to build
>>>>>> with -target 1.3 on JDK 1.5. Thinks just become hard if we intend =
to
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> include
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> annotations in some of our files or use generics.
>>>>>>
>>>>>> Admittedly, I haven't played with JDK 1.5 generating 1.3-compatibl=
e=20
>>>>>> class
>>>>>> files yet...
>>>>>>
>>>>>> Juergen
>>>>>>
>>>>>>
>>>>>> -----Original Message-----
>>>>>> From: spr...@li...
>>>>>> [mailto:spr...@li...]On=20
>>>>>> Behalf
>>>>>> Of Colin Sampaleanu
>>>>>> Sent: Friday, March 11, 2005 12:51 AM
>>>>>> To: spr...@li...
>>>>>> Subject: Re: [Springframework-developer] Hibernate 3 annotations i=
n=20
>>>>>> 1.2
>>>>>> rc1
>>>>>>
>>>>>>
>>>>>> Short of switching to separate source modules (hint hint :-) ),=20
>>>>>> that's
>>>>>> going to be pretty hard to do. We can compile with JDK 1.5, for=20
>>>>>> lower
>>>>>> target versions, but then if you don't specify a 1.5 target versi=
on,=20
>>>>>> the
>>>>>> annotations stuff would blow up.
>>>>>>
>>>>>>
>>>>>> Juergen Hoeller wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Thanks for the suggestion, Dan! I've prototypically added such an
>>>>>>> AnnotationsSessionFactoryBean.
>>>>>>> However, the Hibernate3 annotations jar is built with JDK 1.5, so=
=20
>>>>>>> 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=20
>>>>>>> anyway,
>>>>>>> though, for our new transaction annotation feature that we'd like=
=20
>>>>>>> to
>>>>>>> ship in Spring 1.2.
>>>>>>> Juergen
>>>>>>>
>>>>>>> -----Original Message-----
>>>>>>> *From:* spr...@li...
>>>>>>> [mailto:spr...@li...]*O=
n
>>>>>>> Behalf Of *Washusen, Dan
>>>>>>> *Sent:* Thursday, March 10, 2005 7:09 AM
>>>>>>> *To:* spr...@li...
>>>>>>> *Subject:* RE: [Springframework-developer] Hibernate 3 annotatio=
ns
>>>>>>> in 1.2 rc1
>>>>>>>
>>>>>>> Incase anyone is interested; I=92ve attached an implementation o=
f
>>>>>>> the bean definition I described below.
>>>>>>>
>>>>>>> Cheers,
>>>>>>>
>>>>>>> Dan
>>>>>>>
>>>>>>> ---------------------------------------------------------------=
----
>>>>>>> ---
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> --=20
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> *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 i=
n
>>>>>>> 1.2 rc1
>>>>>>>
>>>>>>> Hey guys,
>>>>>>>
>>>>>>> I=92ve bean mucking around with Hibernate 3 (with annotations)
>>>>>>> support in nightly build. All is going well but I thought I woul=
d
>>>>>>> offer some feedback=85
>>>>>>>
>>>>>>> 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=85
>>>>>>>
>>>>>>> A provided extension of LocalSessionFactoryBean that had support
>>>>>>> for annotated classes would be nice. The bean definition could
>>>>>>> look something like:
>>>>>>>
>>>>>>> <bean id=3D"sessionFactory"
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> class=3D"org.springframework.orm.hibernate3.AnnotationsLocalSessio=
nFac=20
>>>>>> toryB
>>>>>
>>> e
>>>
>>>>>>
>>>>>>
>>>> a
>>>>
>>>>
>>>>>>
>>>>>>
>>>>> n
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> ">
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> <property name=3D"dataSource">
>>>>>>>
>>>>>>> <ref local=3D"dataSource"/>
>>>>>>>
>>>>>>> </property>
>>>>>>>
>>>>>>> <property name=3D"mappingPackage">
>>>>>>>
>>>>>>> <value>some.package</value>
>>>>>>>
>>>>>>> </property>
>>>>>>>
>>>>>>> <property name=3D"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 t=
he
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> recipient and may be confidential and/or legally privileged.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Sensis Pty Ltd disclaims liability for any errors, omissions,=20
>>>>>>> viruses,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>> loss
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>>
>>>>>>>
>>>>>> and/or damage arising from using, opening or transmitting this=20
>>>>>> email.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> If you are not the intended recipient you must not use, interfere=
=20
>>>>>>> with,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> disclose, copy or retain this email and you should notify the send=
er
>>>>>> immediately by return email or by contacting Sensis Pty Ltd by=20
>>>>>> 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 t=
he
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> recipient and may be confidential and/or legally privileged.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Sensis Pty Ltd disclaims liability for any errors, omissions,=20
>>>>>>> viruses,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>> loss
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>>
>>>>>>>
>>>>>> and/or damage arising from using, opening or transmitting this=20
>>>>>> email.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> If you are not the intended recipient you must not use, interfere=
=20
>>>>>>> with,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> disclose, copy or retain this email and you should notify the send=
er
>>>>>> immediately by return email or by contacting Sensis Pty Ltd by=20
>>>>>> telephone
>>>>>>
>>>>>>
>>>> on
>>>>
>>>>
>>>>>> [+61 3 8653 5000]
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>>>
>>>> -------------------------------------------------------
>>>> SF email is sponsored by - The IT Product Guide
>>>> Read honest & candid reviews on hundreds of IT Products from real=20
>>>> users.
>>>> Discover which products truly live up to the hype. Start reading now=
.
>>>> http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick
>>>> _______________________________________________
>>>> Springframework-developer mailing list
>>>> Spr...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/springframework-develop=
er
>>>>
>>>>
>>>>
>>>> -------------------------------------------------------
>>>> SF email is sponsored by - The IT Product Guide
>>>> Read honest & candid reviews on hundreds of IT Products from real=20
>>>> users.
>>>> Discover which products truly live up to the hype. Start reading now=
.
>>>> http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick
>>>> _______________________________________________
>>>> Springframework-developer mailing list
>>>> Spr...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/springframework-develop=
er
>>>>
>>>>
>>>
>>>
>>>
>>> -------------------------------------------------------
>>> SF email is sponsored by - The IT Product Guide
>>> Read honest & candid reviews on hundreds of IT Products from real=20
>>> users.
>>> Discover which products truly live up to the hype. Start reading now.
>>> http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick
>>> _______________________________________________
>>> Springframework-developer mailing list
>>> Spr...@li...
>>> https://lists.sourceforge.net/lists/listinfo/springframework-develope=
r
>>>
>>>
>>>
>>> -------------------------------------------------------
>>> SF email is sponsored by - The IT Product Guide
>>> Read honest & candid reviews on hundreds of IT Products from real=20
>>> users.
>>> Discover which products truly live up to the hype. Start reading now.
>>> http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick
>>> _______________________________________________
>>> Springframework-developer mailing list
>>> Spr...@li...
>>> https://lists.sourceforge.net/lists/listinfo/springframework-develope=
r
>>>
>>>
>>
>>
>>
>> -------------------------------------------------------
>> SF email is sponsored by - The IT Product Guide
>> Read honest & candid reviews on hundreds of IT Products from real user=
s.
>> Discover which products truly live up to the hype. Start reading now.
>> http://ads.osdn.com/?ad_ide95&alloc_id=14396&op=3Dclick
>> _______________________________________________
>> Springframework-developer mailing list
>> Spr...@li...
>> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users=
.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>=20
|
|
From: Seth L. <set...@gm...> - 2005-03-12 22:39:05
|
On Sat, 12 Mar 2005 20:08:38 +0100, Erwin Vervaet <erw...@er...> wrote: > +1 for "Transactional" > > Not sure if there is a naming convention for attributes? It seems to make > sense that the name of the attribute expresses some 'property' of a class, > method, ...: e.g. "this method is transactional", "this class is > persistent", "this property is validated". If you follow that kind of naming > system Transactional actually makes more sense than TransactionAttribute. +1 for Transactional It reads better, like an adjective or adverb. Seth -- <a href="http://www.picklematrix.net/foaf.rdf">Seth Ladd's FOAF</a> <a href="http://www.foaf-project.org/">What is FOAF?</a> |
|
From: Keith D. <ke...@in...> - 2005-03-13 02:02:13
|
I like Transactional too - its obvious its metadata, describing something. I don't like annotations like Inject or TransactionAttribute. The former doesn't really describe anything, it's a verb for petes sake, and the latter seems redundant (we already know these things are attributes! ;-)) Keith -----Original Message----- From: spr...@li... [mailto:spr...@li...] On Behalf Of Seth Ladd Sent: Saturday, March 12, 2005 5:11 PM To: spr...@li... Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2 rc1 On Sat, 12 Mar 2005 20:08:38 +0100, Erwin Vervaet <erw...@er...> wrote: > +1 for "Transactional" > > Not sure if there is a naming convention for attributes? It seems to make > sense that the name of the attribute expresses some 'property' of a class, > method, ...: e.g. "this method is transactional", "this class is > persistent", "this property is validated". If you follow that kind of naming > system Transactional actually makes more sense than TransactionAttribute. +1 for Transactional It reads better, like an adjective or adverb. Seth -- <a href="http://www.picklematrix.net/foaf.rdf">Seth Ladd's FOAF</a> <a href="http://www.foaf-project.org/">What is FOAF?</a> ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Rod J. <ro...@in...> - 2005-03-14 18:30:04
|
+1 for Transactional > > It reads better, like an adjective or adverb. > > Seth |
|
From: Andreas S. <an...@sc...> - 2005-03-13 16:48:28
|
Colin Sampaleanu wrote: > TxAttribute was intentional. The problem with TransactionAttribute is > that that is what EJB3 uses. If we use that, then it would preclude a > file having both our and their Annotations, or they would have to be > spelled out in fully qualified form (with package). I think that's not > acceptable. Btw: Is it planned that Spring Transactions actually implement EJB3 Transactions? (the same way Hibernate3 implements and extends EJB3 entities) Regards, Andreas |
|
From: Colin S. <col...@ex...> - 2005-03-13 18:12:37
|
Andreas Schildbach wrote: >Colin Sampaleanu wrote: > > > >>TxAttribute was intentional. The problem with TransactionAttribute is >>that that is what EJB3 uses. If we use that, then it would preclude a >>file having both our and their Annotations, or they would have to be >>spelled out in fully qualified form (with package). I think that's not >>acceptable. >> >> > >Btw: Is it planned that Spring Transactions actually implement EJB3 >Transactions? (the same way Hibernate3 implements and extends EJB3 entities) > >Regards, > > I can't see that happening right now at least, as the EJB 3 code is not released. It might be a possibility later, as our transaction attributes are a superset of the EJB3 ones, which don't do a lot). Colin |
|
From: Rod J. <ro...@in...> - 2005-03-14 18:32:24
|
Juergen > I would suggest to do a preview/add-on download of the JDK 1.5 transaction > annotation support plus the corresponding JPetStore version, probably around > the time of Spring 1.2 final (alongside the Web Flow preview download). No > problem to build with JDK 1.5 there! Are you suggesting that transaction annotation support should essentially slip out of 1.2 proper? I'm not keen on this. I don't see why it should be a "preview" or why it should take that long to release. After all, 1.5 has been released for some time now. We don't need to "preview" stuff built on it. Rgds Rod |
|
From: Juergen H. <ju...@in...> - 2005-03-14 23:54:55
|
Good point regarding "preview" in conjunction with JDK 1.5. Preview is probably the wrong term anyway. This is essentially a building and packaging issue: The JDK 1.5 transaction annotation support must be built with "-target 1.5", while the rest of Spring obviously should be built with "-target 1.3". So there are just two options, as far as I see: * either turn the JDK 1.5 transaction annotations into a separate download, which will be built with JDK 1.5 as opposed to the main download * or create a separate source tree within the main download (e.g. "tiger/src" and "tiger/test"), built with "-target 1.5" as opposed to the main sources which get built with "-target 1.3" The latter option is fine with me too. The separate source tree would essentially just contain the packages "org.springframework.transaction.annotations" and "org.springframework.jmx.export.annotations" (which I would suggest as package names), compiled into a separate jar file in a separate build step. Of course, we also need to decide on a final naming strategy for annotations. "Transactional" sounds good to me. I would also suggest to rename the PropagationType enumeration to PropagationBehavior, for consistent naming - or go for "Propagation" and "Isolation" as enumeration names. BTW, I don't see much point in the AnnotationsAttributes implementation of our Attribute facade, as used in the AnnotationsJmxAttributeSource. Why not access the JDK 1.5 annotation API directly there? After all, the annotations have to be converted to the JmxAttributeSource return values anyway. The JDK 1.5 annotation model and our Attributes facade simply don't match well, so I guess we need to go forward with both in parallel. The Attributes facade provides value even for Commons Attributes as sole target (e.g. for testing). I must say I appreciate the ability to use existing attribute classes with Commons Attributes... So how do we move forward with this? We should move the code to the main CVS module ASAP, clarify the class naming, and also prepare the build script to handle the different target JDKs. I can certainly care for this, but I would appreciate some help. After all, 1.2 RC1 should go out this week! Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Rod Johnson Sent: Monday, March 14, 2005 7:32 PM To: spr...@li... Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2 rc1 Juergen > I would suggest to do a preview/add-on download of the JDK 1.5 transaction > annotation support plus the corresponding JPetStore version, probably around > the time of Spring 1.2 final (alongside the Web Flow preview download). No > problem to build with JDK 1.5 there! Are you suggesting that transaction annotation support should essentially slip out of 1.2 proper? I'm not keen on this. I don't see why it should be a "preview" or why it should take that long to release. After all, 1.5 has been released for some time now. We don't need to "preview" stuff built on it. Rgds Rod ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Colin S. <col...@ex...> - 2005-03-15 00:57:15
|
Juergen Hoeller wrote: >Good point regarding "preview" in conjunction with JDK 1.5. Preview is >probably the wrong term anyway. This is essentially a building and packaging >issue: The JDK 1.5 transaction annotation support must be built with >"-target 1.5", while the rest of Spring obviously should be built with >"-target 1.3". > >So there are just two options, as far as I see: > >* either turn the JDK 1.5 transaction annotations into a separate download, >which will be built with JDK 1.5 as opposed to the main download > >* or create a separate source tree within the main download (e.g. >"tiger/src" and "tiger/test"), built with "-target 1.5" as opposed to the >main sources which get built with "-target 1.3" > >The latter option is fine with me too. The separate source tree would >essentially just contain the packages >"org.springframework.transaction.annotations" and >"org.springframework.jmx.export.annotations" (which I would suggest as >package names), compiled into a separate jar file in a separate build step. > > > I'm not a big fan of the idea of having a separate source and test tree for 1.5 specific code within the main project. Where would the actual build file live, and how would it be called? Or is the main build file expected to be run under JDK 1.5 now, but using -1.3 for most source, and 1.5 for this? This is actually a step in the opposite direction which we mostly agreed we want to take for 1.3, which is to have separate source packages. If it makes things easier though, I can probably live with it for the 1.2 timeframe :-) >Of course, we also need to decide on a final naming strategy for >annotations. "Transactional" sounds good to me. I would also suggest to >rename the PropagationType enumeration to PropagationBehavior, for >consistent naming - or go for "Propagation" and "Isolation" as enumeration >names. > > Transactional is fine with me. Propagation by itself is probably ok. It's always going to be used as an attribute of Transactional Anyway. >BTW, I don't see much point in the AnnotationsAttributes implementation of >our Attribute facade, as used in the AnnotationsJmxAttributeSource. Why not >access the JDK 1.5 annotation API directly there? After all, the annotations >have to be converted to the JmxAttributeSource return values anyway. > >The JDK 1.5 annotation model and our Attributes facade simply don't match >well, so I guess we need to go forward with both in parallel. The Attributes >facade provides value even for Commons Attributes as sole target (e.g. for >testing). I must say I appreciate the ability to use existing attribute >classes with Commons Attributes... > > After I created the code last fall this is the same conversatoin I had with Rod. There is no real added value in accessing the Annotations through the Attributes interface, because the user of the Annotations has to know they are annotations anyway, it's not really compatible with getting generic classes through the interfaces as provided by commons-attributes. Now moving to something like Annogen is I think desireable, but it's probably not an option right now, as it doesn't support arrays properly. So I think what would work is to move the implementation to access Annotations directly, and then at some point make it work via a mapping lib like Annogen. That would basically be transparent to users. >So how do we move forward with this? We should move the code to the main CVS >module ASAP, clarify the class naming, and also prepare the build script to >handle the different target JDKs. I can certainly care for this, but I would >appreciate some help. After all, 1.2 RC1 should go out this week! > > I can do this. The code was mine after all. However I don' t know if I can do it in the next couple of days. I'm onsite at a client all week, and need to work on some stuff for them in the evenings, and can't see being able to do it before Thurs. or Fri. night. Colin |
|
From: Juergen H. <ju...@in...> - 2005-03-15 11:04:50
|
Well, the problem is that even with module separation, we would still have the problem that we need to build as much as possible with "-target 1.3". But our modules won't be that fine-granular: I assume that our JDK 1.5 annotations would live in the transaction and JMX modules, respectively. Which still involves the target JDK problem. It might even be necessary to keep JDK 1.5 dependent stuff in a separate source tree for a longer time - maybe for the entire Spring 1.x branch. This is not necessarily a big burden: We'd just need to figure out how to make the building with 1.3/1.5 targets as convenient as possible. The separation itself would be perfectly reasonable for users, I guess. We can certainly have a build script that it is able to build both when running on JDK 1.5 (with respective target values), which would be necessary for actual releases. However, it would be great if we could design the build script such that it would still be able to build the main sources when running on JDK 1.4. That should be possible with proper build targets. Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Colin Sampaleanu Sent: Tuesday, March 15, 2005 1:57 AM To: spr...@li... Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2 rc1 Juergen Hoeller wrote: >Good point regarding "preview" in conjunction with JDK 1.5. Preview is >probably the wrong term anyway. This is essentially a building and packaging >issue: The JDK 1.5 transaction annotation support must be built with >"-target 1.5", while the rest of Spring obviously should be built with >"-target 1.3". > >So there are just two options, as far as I see: > >* either turn the JDK 1.5 transaction annotations into a separate download, >which will be built with JDK 1.5 as opposed to the main download > >* or create a separate source tree within the main download (e.g. >"tiger/src" and "tiger/test"), built with "-target 1.5" as opposed to the >main sources which get built with "-target 1.3" > >The latter option is fine with me too. The separate source tree would >essentially just contain the packages >"org.springframework.transaction.annotations" and >"org.springframework.jmx.export.annotations" (which I would suggest as >package names), compiled into a separate jar file in a separate build step. > > > I'm not a big fan of the idea of having a separate source and test tree for 1.5 specific code within the main project. Where would the actual build file live, and how would it be called? Or is the main build file expected to be run under JDK 1.5 now, but using -1.3 for most source, and 1.5 for this? This is actually a step in the opposite direction which we mostly agreed we want to take for 1.3, which is to have separate source packages. If it makes things easier though, I can probably live with it for the 1.2 timeframe :-) >Of course, we also need to decide on a final naming strategy for >annotations. "Transactional" sounds good to me. I would also suggest to >rename the PropagationType enumeration to PropagationBehavior, for >consistent naming - or go for "Propagation" and "Isolation" as enumeration >names. > > Transactional is fine with me. Propagation by itself is probably ok. It's always going to be used as an attribute of Transactional Anyway. >BTW, I don't see much point in the AnnotationsAttributes implementation of >our Attribute facade, as used in the AnnotationsJmxAttributeSource. Why not >access the JDK 1.5 annotation API directly there? After all, the annotations >have to be converted to the JmxAttributeSource return values anyway. > >The JDK 1.5 annotation model and our Attributes facade simply don't match >well, so I guess we need to go forward with both in parallel. The Attributes >facade provides value even for Commons Attributes as sole target (e.g. for >testing). I must say I appreciate the ability to use existing attribute >classes with Commons Attributes... > > After I created the code last fall this is the same conversatoin I had with Rod. There is no real added value in accessing the Annotations through the Attributes interface, because the user of the Annotations has to know they are annotations anyway, it's not really compatible with getting generic classes through the interfaces as provided by commons-attributes. Now moving to something like Annogen is I think desireable, but it's probably not an option right now, as it doesn't support arrays properly. So I think what would work is to move the implementation to access Annotations directly, and then at some point make it work via a mapping lib like Annogen. That would basically be transparent to users. >So how do we move forward with this? We should move the code to the main CVS >module ASAP, clarify the class naming, and also prepare the build script to >handle the different target JDKs. I can certainly care for this, but I would >appreciate some help. After all, 1.2 RC1 should go out this week! > > I can do this. The code was mine after all. However I don' t know if I can do it in the next couple of days. I'm onsite at a client all week, and need to work on some stuff for them in the evenings, and can't see being able to do it before Thurs. or Fri. night. Colin ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Rod J. <ro...@in...> - 2005-03-15 11:55:20
|
I'm not too bothered about the build structure or the infrastructure to access annotations in the 1.2 timeframe. I think we need to: - Release a usable (non-preview) transaction annotation in 1.2. Ideally from RC1. People want to use this stuff. - Ensure source compatibility of application code using annotations moving forward. It doesn't matter if the internals change (e.g. we add Annogen or whatever) but we can't break code by changing the annotations. - Build the annotations into spring.jar somehow. So they're always available. I think this is core functionality; it's just that it can't be used in most environments. It doesn't add much size to the JAR, either. Besides these things I don't think it particularly matters how we build or access annotations at this point. One reason that I *don'* favour accessing annotations directly is that then there is no ability to override annotations. With transactions, this is a bit of a moot point: there is a strong argument that it makes no sense to override transactional behaviour. But essentially annotations *should* be overridable, and we clearly need a general solution for this problem. So we could add as an enhancement in 1.3 the ability to override transaction annotations, for example in XML. (Of course we could do this using our own API, not annotations-specific, but it would be much nicer to have an integrated solution.) The fact that no one on the annotations expert group seems to have thought about overriding is astounding IMO. *All* projects using annotations have faced this issue, and there is no really good way round it. Rgds Rod Juergen Hoeller wrote: > Well, the problem is that even with module separation, we would still have > the problem that we need to build as much as possible with "-target 1.3". > But our modules won't be that fine-granular: I assume that our JDK 1.5 > annotations would live in the transaction and JMX modules, respectively. > Which still involves the target JDK problem. > > It might even be necessary to keep JDK 1.5 dependent stuff in a separate > source tree for a longer time - maybe for the entire Spring 1.x branch. This > is not necessarily a big burden: We'd just need to figure out how to make > the building with 1.3/1.5 targets as convenient as possible. The separation > itself would be perfectly reasonable for users, I guess. > > We can certainly have a build script that it is able to build both when > running on JDK 1.5 (with respective target values), which would be necessary > for actual releases. However, it would be great if we could design the build > script such that it would still be able to build the main sources when > running on JDK 1.4. That should be possible with proper build targets. > > Juergen > > > > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...]On Behalf > Of Colin Sampaleanu > Sent: Tuesday, March 15, 2005 1:57 AM > To: spr...@li... > Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2 > rc1 > > > Juergen Hoeller wrote: > > >>Good point regarding "preview" in conjunction with JDK 1.5. Preview is >>probably the wrong term anyway. This is essentially a building and > > packaging > >>issue: The JDK 1.5 transaction annotation support must be built with >>"-target 1.5", while the rest of Spring obviously should be built with >>"-target 1.3". >> >>So there are just two options, as far as I see: >> >>* either turn the JDK 1.5 transaction annotations into a separate download, >>which will be built with JDK 1.5 as opposed to the main download >> >>* or create a separate source tree within the main download (e.g. >>"tiger/src" and "tiger/test"), built with "-target 1.5" as opposed to the >>main sources which get built with "-target 1.3" >> >>The latter option is fine with me too. The separate source tree would >>essentially just contain the packages >>"org.springframework.transaction.annotations" and >>"org.springframework.jmx.export.annotations" (which I would suggest as >>package names), compiled into a separate jar file in a separate build step. >> >> >> > > I'm not a big fan of the idea of having a separate source and test tree > for 1.5 specific code within the main project. Where would the actual > build file live, and how would it be called? Or is the main build file > expected to be run under JDK 1.5 now, but using -1.3 for most source, > and 1.5 for this? This is actually a step in the opposite direction > which we mostly agreed we want to take for 1.3, which is to have > separate source packages. If it makes things easier though, I can > probably live with it for the 1.2 timeframe :-) > > >>Of course, we also need to decide on a final naming strategy for >>annotations. "Transactional" sounds good to me. I would also suggest to >>rename the PropagationType enumeration to PropagationBehavior, for >>consistent naming - or go for "Propagation" and "Isolation" as enumeration >>names. >> >> > > Transactional is fine with me. Propagation by itself is probably ok. > It's always going to be used as an attribute of Transactional Anyway. > > >>BTW, I don't see much point in the AnnotationsAttributes implementation of >>our Attribute facade, as used in the AnnotationsJmxAttributeSource. Why not >>access the JDK 1.5 annotation API directly there? After all, the > > annotations > >>have to be converted to the JmxAttributeSource return values anyway. >> >>The JDK 1.5 annotation model and our Attributes facade simply don't match >>well, so I guess we need to go forward with both in parallel. The > > Attributes > >>facade provides value even for Commons Attributes as sole target (e.g. for >>testing). I must say I appreciate the ability to use existing attribute >>classes with Commons Attributes... >> >> > > After I created the code last fall this is the same conversatoin I had > with Rod. There is no real added value in accessing the Annotations > through the Attributes interface, because the user of the Annotations > has to know they are annotations anyway, it's not really compatible with > getting generic classes through the interfaces as provided by > commons-attributes. Now moving to something like Annogen is I think > desireable, but it's probably not an option right now, as it doesn't > support arrays properly. So I think what would work is to move the > implementation to access Annotations directly, and then at some point > make it work via a mapping lib like Annogen. That would basically be > transparent to users. > > >>So how do we move forward with this? We should move the code to the main > > CVS > >>module ASAP, clarify the class naming, and also prepare the build script to >>handle the different target JDKs. I can certainly care for this, but I > > would > >>appreciate some help. After all, 1.2 RC1 should go out this week! >> >> > > I can do this. The code was mine after all. However I don' t know if I > can do it in the next couple of days. I'm onsite at a client all week, > and need to work on some stuff for them in the evenings, and can't see > being able to do it before Thurs. or Fri. night. > > Colin > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > -- Rod Johnson Interface21 - Spring Services from the Source http://www.springframework.com Founder, Spring Framework: http://www.springframework.org Author, "Expert One-on-One J2EE Development Without EJB" (May 2004, with Juergen Hoeller). http://www.amazon.com/exec/obidos/ASIN/0764558315/ Author, "Expert One-on-One J2EE Design and Development" (October 2002). http://www.amazon.com/exec/obidos/tg/detail/-/0764543857/ ____________________________________________________ Interface21 Limited Registered Office Summit House, 2-2a Highfield Road, Dartford, Kent DA1 2JY Registered in England and Wales No. 5187766 ____________________________________________________ |
|
From: Juergen H. <ju...@in...> - 2005-03-15 15:00:41
|
I'm mainly concerned to get the source directory structure right. "tiger/src" and "tiger/test" directories sound appropriate to me, getting built by a "tiger.build" in the build script, with "-target 1.5" in contrast to the main sources. Building the annotations into spring jar is probably not a problem. The jar target could simply grab both the "-target 1.3" classes and the classes compiled from the "tiger" source tree and put them into a single jar. Regarding accessing annotations directly: Don't forget that we're always using specific facades in front, such as TransactionAttributeSource and JmxAttributeSource. Overriding can be done there nicely, at a higher level. Even if we tried to add overriding at the annotation level, how would that work? How can you create annotation objects other than reading them from a class file? It looks like there always has to be a facade for accessing specific attributes, using plain objects as attribute values, with annotation parsing going on in the background. My main point regarding AnnotationsAttributes is that it doesn't add any value, as long as it returns annotations objects as result. And wrapping annotations at a generic level is probably not desirable, when there's always a specific facade in front of it anyway. Juergen -----Original Message----- From: spr...@li... [mailto:spr...@li...]On Behalf Of Rod Johnson Sent: Tuesday, March 15, 2005 12:55 PM To: spr...@li... Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2 rc1 I'm not too bothered about the build structure or the infrastructure to access annotations in the 1.2 timeframe. I think we need to: - Release a usable (non-preview) transaction annotation in 1.2. Ideally from RC1. People want to use this stuff. - Ensure source compatibility of application code using annotations moving forward. It doesn't matter if the internals change (e.g. we add Annogen or whatever) but we can't break code by changing the annotations. - Build the annotations into spring.jar somehow. So they're always available. I think this is core functionality; it's just that it can't be used in most environments. It doesn't add much size to the JAR, either. Besides these things I don't think it particularly matters how we build or access annotations at this point. One reason that I *don'* favour accessing annotations directly is that then there is no ability to override annotations. With transactions, this is a bit of a moot point: there is a strong argument that it makes no sense to override transactional behaviour. But essentially annotations *should* be overridable, and we clearly need a general solution for this problem. So we could add as an enhancement in 1.3 the ability to override transaction annotations, for example in XML. (Of course we could do this using our own API, not annotations-specific, but it would be much nicer to have an integrated solution.) The fact that no one on the annotations expert group seems to have thought about overriding is astounding IMO. *All* projects using annotations have faced this issue, and there is no really good way round it. Rgds Rod Juergen Hoeller wrote: > Well, the problem is that even with module separation, we would still have > the problem that we need to build as much as possible with "-target 1.3". > But our modules won't be that fine-granular: I assume that our JDK 1.5 > annotations would live in the transaction and JMX modules, respectively. > Which still involves the target JDK problem. > > It might even be necessary to keep JDK 1.5 dependent stuff in a separate > source tree for a longer time - maybe for the entire Spring 1.x branch. This > is not necessarily a big burden: We'd just need to figure out how to make > the building with 1.3/1.5 targets as convenient as possible. The separation > itself would be perfectly reasonable for users, I guess. > > We can certainly have a build script that it is able to build both when > running on JDK 1.5 (with respective target values), which would be necessary > for actual releases. However, it would be great if we could design the build > script such that it would still be able to build the main sources when > running on JDK 1.4. That should be possible with proper build targets. > > Juergen > > > > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...]On Behalf > Of Colin Sampaleanu > Sent: Tuesday, March 15, 2005 1:57 AM > To: spr...@li... > Subject: Re: [Springframework-developer] Hibernate 3 annotations in 1.2 > rc1 > > > Juergen Hoeller wrote: > > >>Good point regarding "preview" in conjunction with JDK 1.5. Preview is >>probably the wrong term anyway. This is essentially a building and > > packaging > >>issue: The JDK 1.5 transaction annotation support must be built with >>"-target 1.5", while the rest of Spring obviously should be built with >>"-target 1.3". >> >>So there are just two options, as far as I see: >> >>* either turn the JDK 1.5 transaction annotations into a separate download, >>which will be built with JDK 1.5 as opposed to the main download >> >>* or create a separate source tree within the main download (e.g. >>"tiger/src" and "tiger/test"), built with "-target 1.5" as opposed to the >>main sources which get built with "-target 1.3" >> >>The latter option is fine with me too. The separate source tree would >>essentially just contain the packages >>"org.springframework.transaction.annotations" and >>"org.springframework.jmx.export.annotations" (which I would suggest as >>package names), compiled into a separate jar file in a separate build step. >> >> >> > > I'm not a big fan of the idea of having a separate source and test tree > for 1.5 specific code within the main project. Where would the actual > build file live, and how would it be called? Or is the main build file > expected to be run under JDK 1.5 now, but using -1.3 for most source, > and 1.5 for this? This is actually a step in the opposite direction > which we mostly agreed we want to take for 1.3, which is to have > separate source packages. If it makes things easier though, I can > probably live with it for the 1.2 timeframe :-) > > >>Of course, we also need to decide on a final naming strategy for >>annotations. "Transactional" sounds good to me. I would also suggest to >>rename the PropagationType enumeration to PropagationBehavior, for >>consistent naming - or go for "Propagation" and "Isolation" as enumeration >>names. >> >> > > Transactional is fine with me. Propagation by itself is probably ok. > It's always going to be used as an attribute of Transactional Anyway. > > >>BTW, I don't see much point in the AnnotationsAttributes implementation of >>our Attribute facade, as used in the AnnotationsJmxAttributeSource. Why not >>access the JDK 1.5 annotation API directly there? After all, the > > annotations > >>have to be converted to the JmxAttributeSource return values anyway. >> >>The JDK 1.5 annotation model and our Attributes facade simply don't match >>well, so I guess we need to go forward with both in parallel. The > > Attributes > >>facade provides value even for Commons Attributes as sole target (e.g. for >>testing). I must say I appreciate the ability to use existing attribute >>classes with Commons Attributes... >> >> > > After I created the code last fall this is the same conversatoin I had > with Rod. There is no real added value in accessing the Annotations > through the Attributes interface, because the user of the Annotations > has to know they are annotations anyway, it's not really compatible with > getting generic classes through the interfaces as provided by > commons-attributes. Now moving to something like Annogen is I think > desireable, but it's probably not an option right now, as it doesn't > support arrays properly. So I think what would work is to move the > implementation to access Annotations directly, and then at some point > make it work via a mapping lib like Annogen. That would basically be > transparent to users. > > >>So how do we move forward with this? We should move the code to the main > > CVS > >>module ASAP, clarify the class naming, and also prepare the build script to >>handle the different target JDKs. I can certainly care for this, but I > > would > >>appreciate some help. After all, 1.2 RC1 should go out this week! >> >> > > I can do this. The code was mine after all. However I don' t know if I > can do it in the next couple of days. I'm onsite at a client all week, > and need to work on some stuff for them in the evenings, and can't see > being able to do it before Thurs. or Fri. night. > > Colin > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > -- Rod Johnson Interface21 - Spring Services from the Source http://www.springframework.com Founder, Spring Framework: http://www.springframework.org Author, "Expert One-on-One J2EE Development Without EJB" (May 2004, with Juergen Hoeller). http://www.amazon.com/exec/obidos/ASIN/0764558315/ Author, "Expert One-on-One J2EE Design and Development" (October 2002). http://www.amazon.com/exec/obidos/tg/detail/-/0764543857/ ____________________________________________________ Interface21 Limited Registered Office Summit House, 2-2a Highfield Road, Dartford, Kent DA1 2JY Registered in England and Wales No. 5187766 ____________________________________________________ ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Rod J. <ro...@in...> - 2005-03-15 15:51:37
|
Juergen Hoeller wrote: > I'm mainly concerned to get the source directory structure right. > "tiger/src" and "tiger/test" directories sound appropriate to me, getting > built by a "tiger.build" in the build script, with "-target 1.5" in contrast > to the main sources. I think that's a reasonable option, at least for now. |