hibernate 3.0.x HQL 中文乱码问题

hibernate 3.0.x HQL 中文乱码问题
       前段时间碰到这个问题,今天记下来,我想在之后的版本中应该不会有这样的问题了?在网上找到了解决办法是这样的,在spring的配制文件里加入这样一句即可:
<prop key="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</prop>


<!--  配置sessionFactory, 注意这里引入的包的不同   -->
    
< bean  id ="sessionFactory"  class ="org.springframework.orm.hibernate3.LocalSessionFactoryBean" >
        
< property  name ="dataSource" >
            
< ref  local ="dataSource"   />
        
</ property >
        
< property  name ="mappingResources" >
            
< list >
                
< value > com/ihandy/airwap/beans/Hotflight.hbm.xml </ value >
                
< value > com/ihandy/airwap/beans/Area.hbm.xml </ value >
                
< value > com/ihandy/airwap/beans/AirAssociatorInfo.hbm.xml </ value >
                
< value > com/ihandy/airwap/beans/OrderDetail.hbm.xml </ value >
                
< value > com/ihandy/airwap/beans/OrderQuest.hbm.xml </ value >
            
</ list >
        
</ property >
        
< property  name ="hibernateProperties" >
            
< props >
                
< prop  key ="hibernate.dialect" > org.hibernate.dialect.SQLServerDialect </ prop >
                
< prop  key ="hibernate.show_sql" > true </ prop >
                
< prop  key ="hibernate.c3p0.minPoolSize" > 2 </ prop >
                
< prop  key ="hibernate.c3p0.maxPoolSize" > 5 </ prop >
                
< prop  key ="hibernate.c3p0.timeout" > 600 </ prop >
                
< prop  key ="hibernate.c3p0.max_statement" > 200 </ prop >
                
< prop  key ="hibernate.query.factory_class" > org.hibernate.hql.classic.ClassicQueryTranslatorFactory </ prop >
            
</ props >
        
</ property >
    
</ bean >

你可能感兴趣的:(hibernate 3.0.x HQL 中文乱码问题)