Ich habe Hibernate Transaction Manager in Spring MVC-Controller konfiguriert.Erhalten Sie Dialekt innerhalb einer Klasse innerhalb Spring MVC + Hibernate-Anwendung
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="org.postgresql.Driver" />
<property name="url" value="jdbc:postgresql://127.0.0.1/doolloop2" />
<property name="username" value="doolloop2" />
<property name="password" value="doolloop" />
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="mappingLocations">
<list>
<value>WEB-INF/mapping/User.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
</props>
</property>
</bean>
<bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
Darüber hinaus habe ich einige Klasse, die Hibernate Dialekt innerhalb es Methode bekommen muss. Ist die Klasse in Spring Framework nicht als Bean konfiguriert?
Wie kann ich Hibernate Dialekt-Eigenschaft von dieser Klasse zugreifen? Ich glaube, es sollte eine statische Klasse sein, aber ich weiß nicht, wie ich das machen kann. Bitte helfen Sie.