在哪里可以找到使用注释将hibernate与SpringMVC3.0集成的好教程?

在哪里可以找到使用注释将hibernate与SpringMVC3.0集成的好教程?,hibernate,model-view-controller,spring,jsp,postgresql,Hibernate,Model View Controller,Spring,Jsp,Postgresql,我正在使用JSP和SpringMVC3.0开发一个动态网站,但我无法让hibernate使用它。另外,我使用PostgreSQL作为我的数据库。我不知道我应该放在哪个图书馆。我对这项技术很陌生。有人能帮我吗?谢谢这些库取决于您可能想要实现的功能 <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate</artifactId&

我正在使用JSP和SpringMVC3.0开发一个动态网站,但我无法让hibernate使用它。另外,我使用PostgreSQL作为我的数据库。我不知道我应该放在哪个图书馆。我对这项技术很陌生。有人能帮我吗?谢谢

这些库取决于您可能想要实现的功能

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate</artifactId>
        <version>3.2.7.ga</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-annotations</artifactId>
        <version>3.3.0.ga</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-commons-annotations</artifactId>
        <version>3.3.0.ga</version>
    </dependency>
    <dependency>
        <groupId>postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>8.3-603.jdbc3</version>
    </dependency>
    <dependency>
        <groupId>c3p0</groupId>
        <artifactId>c3p0</artifactId>
        <version>0.9.1</version>
    </dependency>

org.hibernate

干杯

<bean id="propertyConfigurer"
      class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
      p:location="/WEB-INF/jdbc.properties" />

<!-- Uses mchange connection pooling -->
<bean id="dataSource"
    class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"
    p:driverClass="${jdbc.driverClassName}"
    p:jdbcUrl="${jdbc.url}"
    p:user="${jdbc.username}"
    p:password="${jdbc.password}" />

<bean id="hibernateProps" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
    <property name="properties">
        <props>
            <prop key="hibernate.hbm2ddl.auto">update</prop>
            <prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop>
            <prop key="hibernate.show_sql">false</prop>
            <prop key="hibernate.c3p0.minPoolSize">5</prop>
            <prop key="hibernate.c3p0.maxPoolSize">20</prop>
            <prop key="hibernate.c3p0.idleTestPeriod">300</prop>
            <prop key="hibernate.c3p0.timeout">600</prop>
            <prop key="hibernate.c3p0.max_statement">50</prop>
            <prop key="hibernate.c3p0.testConnectionOnCheckout">false</prop>
            <prop key="hibernate.c3p0.preferredTestQuery">select 1;</prop>
        </props>
    </property>
</bean>

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
      p:dataSource-ref="dataSource"
      p:packagesToScan="package.with.your.domain.objects.in.it"
      p:hibernateProperties-ref="hibernateProps" />