Spring下使用Hibenrate annotation? * using Hibernate3 annotation support (initially only available a
Spring下使用Hibenrate annotation
? * using Hibernate3 annotation support (initially only available as
? * alpha download separate from the main Hibernate3 distribution).
? *
Annotated packages and annotated classes can be specified via the
? * corresponding tags in "hibernate.cfg.xml" then, so this will usually
? * be combined with a "configLocation" property that points at such a
? * standard Hibernate configuration file.
? * @see #setConfigLocation
? * @see org.hibernate.cfg.Configuration
? * @see org.hibernate.cfg.AnnotationConfiguration
? */
?public void setConfigurationClass(Class configurationClass) {
??if (configurationClass == null || !Configuration.class.isAssignableFrom(configurationClass)) {
???throw new IllegalArgumentException(
?????"configurationClass must be assignable to [org.hibernate.cfg.Configuration]");
??}
??this.configurationClass = configurationClass;
?}
? * using Hibernate3 annotation support (initially only available as<br/>
? * alpha download separate from the main Hibernate3 distribution).<br/>
? * </p>
<p>Annotated packages and annotated classes can be specified via the<br/>
? * corresponding tags in "hibernate.cfg.xml" then, so this will usually<br/>
? * be combined with a "configLocation" property that points at such a<br/>
? * standard Hibernate configuration file.<br/>
? * @see #setConfigLocation<br/>
? * @see org.hibernate.cfg.Configuration<br/>
? * @see org.hibernate.cfg.AnnotationConfiguration<br/>
? */<br/>
?public void setConfigurationClass(Class configurationClass) {<br/>
??if (configurationClass == null || !Configuration.class.isAssignableFrom(configurationClass)) {<br/>
???throw new IllegalArgumentException(<br/>
?????"configurationClass must be assignable to [org.hibernate.cfg.Configuration]");<br/>
??}<br/>
??this.configurationClass = configurationClass;<br/>
?}</p>
</font></div>
<br/>
<br/>
没弄懂lz要干什么!<br/>
<br/></div> 3 楼 ahuaxuan 2006-12-24 lz说话相当的言简意赅,我也是没有弄懂楼主的目的,楼主能否更详细点来描述一下:你要做什么,怎么做,为什么要这么做? 4 楼 温柔一刀 2006-12-24 楼主估计是想说Spring下使用Hibenrate annotation时sessionFactory的配置 5 楼 dylan_cherie 2006-12-30 不好意思没说明白,此文讲的是Hibenrate annotation在spring中使用的配置方法。