You can still use a hibernate.cfg.xml file with spring.  Here's a sample
from my dao-context.xml:


<bean id="SessionFactory"

class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
        <property name="dataSource" ref="DataSource" />
        <property name="configLocation">
            <value>classpath:hibernate.cfg.xml</value>
        </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">${hibernate.dialect}</prop>
                <prop key="show-sql">${hibernate.show_sql}</prop>
                <prop
key="hibernate.hbm2dll.auto">${hibernate.hbm2ddl.auto}</prop>
            </props>
        </property>
    </bean>

It makes the Hibernate tools A LOT easier to use.  Plus I like keeping all
my mapping information (hibernate.cf.xml) separate from my application
context.  The *only* thing I place in my hibernate config file are my
mapping classes:
<hibernate-configuration>
    <session-factory>
        <mapping class="x.y.z"/>
        ...
    </session-factory>
</hibernate-configuration>

Hope that helps!

On Thu, Apr 10, 2008 at 8:16 AM, Johann Reyes <[EMAIL PROTECTED]> wrote:

> You could configure a database.properties file that your spring config
> reads it, and also the hibernate3 plugin
>
> Regards
>
> Johann Reyes
>

Reply via email to