zoukankan      html  css  js  c++  java
  • 格式化Hibernate的SQL输出语句

    在 applicationContent.xml 文件中加入以下程序代码,及可以Console中看到 hibernate 执行sql 语句

    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
            <property name="driverClassName" value="com.mysql.jdbc.Driver">
            </property>
            <property name="url" value="jdbc:mysql://127.0.0.1:3306/pecope">
            </property>
            <property name="username" value="root"></property>
            <property name="password" value="root"></property>
        </bean>
        <bean id="sessionFactory"
            class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
            <property name="dataSource">
                <ref bean="dataSource" />
            </property>
            <property name="hibernateProperties">
                
                <props>
                    <prop key="hibernate.dialect">
                        org.hibernate.dialect.MySQLDialect
                    </prop>
                    <prop key="hibernate.show_sql">true</prop>
                    <prop key="hibernate.format_sql">true</prop>
                    <prop key="hibernate.use_sql_comments">false</prop>
                </props>
            </property>
            <property name="annotatedClasses">
                <list>
                    <value>com.zbb.entity.Salesman</value>
                    <value>com.zbb.entity.Plan</value>
                    <value>com.zbb.entity.Schedule</value>
                    <value>com.zbb.entity.Room</value>
                    <value>com.zbb.entity.Customer</value>
                    <value>com.zbb.entity.Message</value>
                    <value>com.zbb.entity.Material</value>
                    <value>com.zbb.entity.Project</value>
                    <value>com.zbb.entity.Bargain</value>
                    <value>com.zbb.entity.Plan2</value>
                </list>
            </property>
        </bean>
  • 相关阅读:
    JMF:Screen Grabber [DataSource]
    ImageUtilities.loadImage第二个参数的说明
    PipeStateListener和PipeEventListener
    as3 htmlText常用标签
    jsfl批量导出swf
    java socket安全策略文件
    模拟EventCenter,flash自带的事件机制的一个解耦框架,callback回调方式用于模块之间的通信
    flashDevelop快捷键和几个实用的插架
    as3 用StyleSheet css 设置文本样式
    as3 位图九宫格
  • 原文地址:https://www.cnblogs.com/super-admin/p/5515882.html
Copyright © 2011-2022 走看看