2014-01-26 31 views
0

我試圖將GlassFish 4中的連接池從MySQL切換到Derby。我正在使用Spring-Data-JPA和JPA/Hibernate。問題是並非所有的表都是用德比池創建的。沒有創建至少有一個布爾型字段的實體表。未創建布爾字段的實體表

我在日誌文件中找不到任何東西。 :(

我的applicationContext.xml:

<beans 
    xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:context="http://www.springframework.org/schema/context" 
    xmlns:tx="http://www.springframework.org/schema/tx" 
    xmlns:jpa="http://www.springframework.org/schema/data/jpa" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd 
     http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.1.xsd 
     http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd 
     http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd"> 

    <context:annotation-config /> 

    <context:component-scan base-package="project" /> 

    <bean 
     id="dataSource" 
     class="org.springframework.jndi.JndiObjectFactoryBean"> 
     <property 
      name="jndiName" 
      value="serverPool" /> 
     <property 
      name="lookupOnStartup" 
      value="false" /> 
     <property 
      name="proxyInterface" 
      value="javax.sql.DataSource" /> 
    </bean> 

    <bean 
     id="hibernateJpaVendorAdapter" 
     class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> 
     <property 
      name="generateDdl" 
      value="true" /> 
     <property 
      name="showSql" 
      value="true" /> 
    </bean> 

    <bean 
     id="entityManagerFactory" 
     class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> 
     <property 
      name="dataSource" 
      ref="dataSource" /> 
     <property 
      name="jpaVendorAdapter" 
      ref="hibernateJpaVendorAdapter" /> 
     <property 
      name="packagesToScan" 
      value="project.model.entity" /> 
    </bean> 

    <bean 
     id="transactionManager" 
     class="org.springframework.orm.jpa.JpaTransactionManager"> 
     <property 
      name="entityManagerFactory" 
      ref="entityManagerFactory" /> 
    </bean> 
    <tx:annotation-driven transaction-manager="transactionManager" /> 

    <jpa:repositories base-package="project.model.repository" /> 
</beans> 
+0

布爾是德比的一個相對新近的增加。也許你的Derby副本有點太舊,或者你的Hibernate的Derby適配器副本有點太舊了? –

回答

0

好吧,我找到了解決辦法:我連接到Derby數據庫和exe cuted命令values syscs_util.syscs_get_database_property('DataDictionaryVersion');結果爲10.1,但版本10.7對於布爾支持是必需的。然後,我在GlassFish內部的Derby池中重命名了數據庫名稱(默認情況下爲sun-appserv-samples),現在創建了所有表。有了新的數據庫,命令給了我10.9版本。