1
최대 절전 모드 도구는 javacode에서 부울 유형에 tinyint(1)
을 생성합니다. 기본값 : 0 false, 1 trueHibernate + MySQL 사용자 정의 부울 유형
하지만 1 : false 및 0 : true로 변경하려고합니다.
어떻게 할 수 있습니까?
내 datasource.xml에 <prop key="hibernate.query.substitutions">true 0, false 1</prop>
을 추가했지만 여전히 작동하지 않습니다.
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<!-- Read database connection from data source -->
<property name="dataSource">
<ref bean="dataSource" />
</property>
<!-- Config hibernate properties -->
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.format_sql">true</prop>
<!-- Minimum number of JDBC connections in the pool. Hibernate default: 1 -->
<prop key="hibernate.c3p0.min_size">5</prop>
<!-- Maximum number of JDBC connections in the pool. Hibernate default: 100 -->
<prop key="hibernate.c3p0.max_size">20</prop>
<!-- When an idle connection is removed from the pool (in second). Hibernate default: 0, never expire. -->
<prop key="hibernate.c3p0.timeout">300</prop>
<!-- Number of prepared statements will be cached. Increase performance. Hibernate default: 0 , caching is disable. -->
<prop key="hibernate.c3p0.max_statements">50</prop>
<!-- Hibernate.c3p0.idle_test_period – idle time in seconds before a connection is automatically validated. Hibernate default: 0 -->
<prop key="hibernate.c3p0.idle_test_period">3000</prop>
<prop key="hibernate.query.substitutions">true 0, false 1</prop>
</props>
</property>
도와주세요. 고맙습니다.
참조 : http : //stackoverflow.com/questions/1154833/configure-hibernate-using-jpa-to-store-yn-for-type-boolean-instead-of-0-1 – user23123412
당신 –