-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: problems with hbm2ddl using hsqldb
PostPosted: Wed Jan 23, 2008 2:06 am 
Newbie

Joined: Wed Jan 23, 2008 1:36 am
Posts: 1
hi,everyone. i meet some problems when i try to run my tests.i try to resolve it myself,but ..
i am now using jboss seam and generate my project using seam-gen,i get my entitiy like this

Hibernate Tools 3.2.0.b10

Code:
package org.domain.demo.entity;
// Generated 2007/12/13 11:52:33 by Hibernate Tools 3.2.0.b10

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
* Kokyaku generated by hbm2java
*/
@Entity
@Table(name = "kokyaku", catalog = "demo")
public class Kokyaku implements java.io.Serializable {

   private String kokyakuCd;
   private Shain shain;
   private String kokyakuName;
   private String kokyakuKana;
   private String kokyakuAddr;
   private String kokyakuTel;
   private String kokyakuFax;
   private String kokyakuMail;
   private String kokyakuNinzu;
   private String kokyakuPresidentName;
   private Double kokyakuShihon;
   private Date kokyakuDate;
   private String kokyakuGyosyu;
   private String kokyakuNaiyo;
   private Date createDate;
   private Date applyDate;
   private Date startDate;
   private Set<Torihiki> torihikis = new HashSet<Torihiki>(0);

   public Kokyaku() {
   }

   public Kokyaku(String kokyakuCd) {
      this.kokyakuCd = kokyakuCd;
   }
   public Kokyaku(String kokyakuCd, Shain shain, String kokyakuName,
         String kokyakuKana, String kokyakuAddr, String kokyakuTel,
         String kokyakuFax, String kokyakuMail, String kokyakuNinzu,
         String kokyakuPresidentName, Double kokyakuShihon,
         Date kokyakuDate, String kokyakuGyosyu, String kokyakuNaiyo,
         Date createDate, Date applyDate, Date startDate,
         Set<Torihiki> torihikis) {
      this.kokyakuCd = kokyakuCd;
      this.shain = shain;
      this.kokyakuName = kokyakuName;
      this.kokyakuKana = kokyakuKana;
      this.kokyakuAddr = kokyakuAddr;
      this.kokyakuTel = kokyakuTel;
      this.kokyakuFax = kokyakuFax;
      this.kokyakuMail = kokyakuMail;
      this.kokyakuNinzu = kokyakuNinzu;
      this.kokyakuPresidentName = kokyakuPresidentName;
      this.kokyakuShihon = kokyakuShihon;
      this.kokyakuDate = kokyakuDate;
      this.kokyakuGyosyu = kokyakuGyosyu;
      this.kokyakuNaiyo = kokyakuNaiyo;
      this.createDate = createDate;
      this.applyDate = applyDate;
      this.startDate = startDate;
      this.torihikis = torihikis;
   }

   @Id
   @Column(name = "kokyaku_cd", unique = true, nullable = false, length = 6)
   @NotNull
   @Length(max = 6)
   public String getKokyakuCd() {
      return this.kokyakuCd;
   }

   public void setKokyakuCd(String kokyakuCd) {
      this.kokyakuCd = kokyakuCd;
   }
   @ManyToOne(fetch = FetchType.LAZY)
   @JoinColumn(name = "tanto_cd")
   public Shain getShain() {
      return this.shain;
   }

   public void setShain(Shain shain) {
      this.shain = shain;
   }

   @Column(name = "kokyaku_name", length = 50)
   @Length(max = 50)
   public String getKokyakuName() {
      return this.kokyakuName;
   }

   public void setKokyakuName(String kokyakuName) {
      this.kokyakuName = kokyakuName;
   }

   @Column(name = "kokyaku_kana", length = 50)
   @Length(max = 50)
   public String getKokyakuKana() {
      return this.kokyakuKana;
   }

   public void setKokyakuKana(String kokyakuKana) {
      this.kokyakuKana = kokyakuKana;
   }

   @Column(name = "kokyaku_addr", length = 50)
   @Length(max = 50)
   public String getKokyakuAddr() {
      return this.kokyakuAddr;
   }

   public void setKokyakuAddr(String kokyakuAddr) {
      this.kokyakuAddr = kokyakuAddr;
   }

   @Column(name = "kokyaku_tel", length = 12)
   @Length(max = 12)
   public String getKokyakuTel() {
      return this.kokyakuTel;
   }

   public void setKokyakuTel(String kokyakuTel) {
      this.kokyakuTel = kokyakuTel;
   }

   @Column(name = "kokyaku_fax", length = 12)
   @Length(max = 12)
   public String getKokyakuFax() {
      return this.kokyakuFax;
   }

   public void setKokyakuFax(String kokyakuFax) {
      this.kokyakuFax = kokyakuFax;
   }

   @Column(name = "kokyaku_mail", length = 50)
   @Length(max = 50)
   public String getKokyakuMail() {
      return this.kokyakuMail;
   }

   public void setKokyakuMail(String kokyakuMail) {
      this.kokyakuMail = kokyakuMail;
   }

   @Column(name = "kokyaku_ninzu", length = 1)
   @Length(max = 1)
   public String getKokyakuNinzu() {
      return this.kokyakuNinzu;
   }

   public void setKokyakuNinzu(String kokyakuNinzu) {
      this.kokyakuNinzu = kokyakuNinzu;
   }

   @Column(name = "kokyaku_president_name", length = 20)
   @Length(max = 20)
   public String getKokyakuPresidentName() {
      return this.kokyakuPresidentName;
   }

   public void setKokyakuPresidentName(String kokyakuPresidentName) {
      this.kokyakuPresidentName = kokyakuPresidentName;
   }

   @Column(name = "kokyaku_shihon", precision = 12, scale = 0)
   public Double getKokyakuShihon() {
      return this.kokyakuShihon;
   }

   public void setKokyakuShihon(Double kokyakuShihon) {
      this.kokyakuShihon = kokyakuShihon;
   }
   @Temporal(TemporalType.DATE)
   @Column(name = "kokyaku_date", length = 0)
   public Date getKokyakuDate() {
      return this.kokyakuDate;
   }

   public void setKokyakuDate(Date kokyakuDate) {
      this.kokyakuDate = kokyakuDate;
   }

   @Column(name = "kokyaku_gyosyu", length = 20)
   @Length(max = 20)
   public String getKokyakuGyosyu() {
      return this.kokyakuGyosyu;
   }

   public void setKokyakuGyosyu(String kokyakuGyosyu) {
      this.kokyakuGyosyu = kokyakuGyosyu;
   }

   @Column(name = "kokyaku_naiyo", length = 100)
   @Length(max = 100)
   public String getKokyakuNaiyo() {
      return this.kokyakuNaiyo;
   }

   public void setKokyakuNaiyo(String kokyakuNaiyo) {
      this.kokyakuNaiyo = kokyakuNaiyo;
   }
   @Temporal(TemporalType.DATE)
   @Column(name = "create_date", length = 0)
   public Date getCreateDate() {
      return this.createDate;
   }

   public void setCreateDate(Date createDate) {
      this.createDate = createDate;
   }
   @Temporal(TemporalType.DATE)
   @Column(name = "apply_date", length = 0)
   public Date getApplyDate() {
      return this.applyDate;
   }

   public void setApplyDate(Date applyDate) {
      this.applyDate = applyDate;
   }
   @Temporal(TemporalType.DATE)
   @Column(name = "start_date", length = 0)
   public Date getStartDate() {
      return this.startDate;
   }

   public void setStartDate(Date startDate) {
      this.startDate = startDate;
   }
   @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "kokyaku")
   public Set<Torihiki> getTorihikis() {
      return this.torihikis;
   }

   public void setTorihikis(Set<Torihiki> torihikis) {
      this.torihikis = torihikis;
   }

}


and my persistence.xml like this
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Persistence deployment descriptor for dev profile -->
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
             version="1.0">
             
   <persistence-unit name="demo" transaction-type="JTA">
      <provider>org.hibernate.ejb.HibernatePersistence</provider>
      <jta-data-source>java:/DefaultDS</jta-data-source>
      <properties>
         <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
         <property name="hibernate.show_sql" value="true"/>
         <property name="hibernate.cache.use_second_level_cache" value="false"/>
         <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
      </properties>
   </persistence-unit>
   
</persistence>


also my data source
Code:
<?xml version="1.0" encoding="UTF-8"?>

<!-- The Hypersonic embedded database JCA connection factory config -->

<!-- $Id: hsqldb-ds.xml,v 1.1 2007/06/15 05:20:58 gavin Exp $ -->

<datasources>
   <local-tx-datasource>

      <!-- The jndi name of the DataSource, it is prefixed with java:/ -->
      <!-- Datasources are not available outside the virtual machine -->
      <jndi-name>DefaultDS</jndi-name>

      <!-- For server mode db, allowing other processes to use hsqldb over tcp.
      This requires the org.jboss.jdbc.HypersonicDatabase mbean.
      <connection-url>jdbc:hsqldb:hsql://${jboss.bind.address}:1701</connection-url>
      -->
      <!-- For totally in-memory db, not saved when jboss stops.
      The org.jboss.jdbc.HypersonicDatabase mbean is required for proper db shutdown
      <connection-url>jdbc:hsqldb:.</connection-url>
      -->
      <!-- For in-process persistent db, saved when jboss stops.
      The org.jboss.jdbc.HypersonicDatabase mbean is required for proper db shutdown
      -->
      <connection-url>jdbc:hsqldb:mem:.</connection-url>

      <!-- The driver class -->
      <driver-class>org.hsqldb.jdbcDriver</driver-class>

      <!-- The login and password -->
      <user-name>sa</user-name>
      <password></password>

      <!--example of how to specify class that determines if exception means connection should be destroyed-->
      <!--exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyExceptionSorter</exception-sorter-class-name-->

      <!-- this will be run before a managed connection is removed from the pool for use by a client-->
      <!--<check-valid-connection-sql>select * from something</check-valid-connection-sql> -->

      <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
      <min-pool-size>0</min-pool-size>

      <!-- The maximum connections in a pool/sub-pool -->
      <max-pool-size>20</max-pool-size>

      <!-- The time before an unused connection is destroyed -->
      <!-- NOTE: This is the check period. It will be destroyed somewhere between 1x and 2x this timeout after last use -->
      <!-- TEMPORARY FIX! - Disable idle connection removal, HSQLDB has a problem with not reaping threads on closed connections -->
      <idle-timeout-minutes>0</idle-timeout-minutes>

      <!-- sql to call when connection is created
        <new-connection-sql>some arbitrary sql</new-connection-sql>
      -->

      <!-- sql to call on an existing pooled connection when it is obtained from pool
         <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
      -->

      <!-- example of how to specify a class that determines a connection is valid before it is handed out from the pool
         <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyValidConnectionChecker</valid-connection-checker-class-name>
      -->

      <!-- Whether to check all statements are closed when the connection is returned to the pool,
           this is a debugging feature that should be turned off in production -->
      <track-statements/>

      <!-- Use the getConnection(user, pw) for logins
        <application-managed-security/>
      -->

      <!-- Use the security domain defined in conf/login-config.xml -->
      <security-domain>HsqlDbRealm</security-domain>

      <!-- Use the security domain defined in conf/login-config.xml or the
           getConnection(user, pw) for logins. The security domain takes precedence.
        <security-domain-and-application>HsqlDbRealm</security-domain-and-application>
      -->

      <!-- HSQL DB benefits from prepared statement caching -->
      <prepared-statement-cache-size>32</prepared-statement-cache-size>

      <!-- When using in-process (standalone) mode -->
      <depends>jboss:service=Hypersonic,database=localDB</depends>
      <!-- Uncomment when using hsqldb in server mode
      <depends>jboss:service=Hypersonic</depends>
      -->
   </local-tx-datasource>

   <!-- Uncomment if you want hsqldb accessed over tcp (server mode)
   <mbean code="org.jboss.jdbc.HypersonicDatabase"
     name="jboss:service=Hypersonic">
     <attribute name="Port">1701</attribute>
     <attribute name="BindAddress">${jboss.bind.address}</attribute>     
     <attribute name="Silent">true</attribute>
     <attribute name="Database">default</attribute>
     <attribute name="Trace">false</attribute>
     <attribute name="No_system_exit">true</attribute>
   </mbean>
   -->

   <!-- For hsqldb accessed from jboss only, in-process (standalone) mode -->
   <mbean code="org.jboss.jdbc.HypersonicDatabase"
     name="jboss:service=Hypersonic,database=localDB">
     <attribute name="Database">localDB</attribute>
     <attribute name="InProcessMode">true</attribute>
   </mbean>
   
</datasources>


my import.sql
Code:
INSERT INTO KOKYAKU (KOKYAKU_CD,APPLY_DATE ,CREATE_DATE ,KOKYAKU_ADDR,KOKYAKU_DATE,KOKYAKU_FAX,KOKYAKU_GYOSYU,KOKYAKU_KANA,KOKYAKU_MAIL,KOKYAKU_NAIYO,KOKYAKU_NAME,KOKYAKU_NINZU,KOKYAKU_PRESIDENT_NAME,KOKYAKU_SHIHON,KOKYAKU_TEL,START_DATE,TANTO_CD) VALUES('1','2008-12-12','2008-12-12','test','2008-12-12','123','test1','test1','luc@hotmial.com','adfaf','yuanxiaocheng','1','ajakd',14.2E0,'uw','2008-12-12','2342')
INSERT INTO KOKYAKU (KOKYAKU_CD,APPLY_DATE ,CREATE_DATE ,KOKYAKU_ADDR,KOKYAKU_DATE,KOKYAKU_FAX,KOKYAKU_GYOSYU,KOKYAKU_KANA,KOKYAKU_MAIL,KOKYAKU_NAIYO,KOKYAKU_NAME,KOKYAKU_NINZU,KOKYAKU_PRESIDENT_NAME,KOKYAKU_SHIHON,KOKYAKU_TEL,START_DATE,TANTO_CD) VALUES('2','2007-08-01','2007-08-01','run','2007-08-01','456','test2','test1','yuanxiaocheng@hotmail.com',NULL,'TESTNAME1',NULL,NULL,NULL,NULL,'2008-12-12',NULL)
INSERT INTO SHAIN (SYAIN_CD,SYAIN_NAME,SYAIN_PWD) VALUES('1','gu','123456')
INSERT INTO SHAIN (SYAIN_CD,SYAIN_NAME,SYAIN_PWD) VALUES('2','lu','123456')
INSERT INTO SHOHIN (SYOHIN_CD,SIIRE_PRICE,SYOHIN_NAME) VALUES('1',12.2E0,'yxc')
INSERT INTO TORIHIKI (URIAGE_NO,ARARI_AMOUNT,BIKO,NEBIKI_AMOUNT,TAX,URIAGE_AMOUNT,URIAGE_COUNT,URIAGE_DATE,URIAGE_PRICE,URIAGE_STATUS,KOKYAKU_CD,SYOHIN_CD) VALUES('1',12.3E0,'kd',12.2E0,13.2E0,52.2E0,52.1E0,'2007-12-12',12.7E0,'1','1','1')


i write a simple test just retrieve all kokyaku.
but i got exception like this
Code:
[Parser] Running:
  H:\Agile\05_Coding\SeamDemo\demo\temp-testng-customsuite.xml

Hibernate: select top ? kokyaku0_.kokyaku_cd as kokyaku1_9_, kokyaku0_.apply_date as apply2_9_, kokyaku0_.create_date as create3_9_, kokyaku0_.kokyaku_addr as kokyaku4_9_, kokyaku0_.kokyaku_date as kokyaku5_9_, kokyaku0_.kokyaku_fax as kokyaku6_9_, kokyaku0_.kokyaku_gyosyu as kokyaku7_9_, kokyaku0_.kokyaku_kana as kokyaku8_9_, kokyaku0_.kokyaku_mail as kokyaku9_9_, kokyaku0_.kokyaku_naiyo as kokyaku10_9_, kokyaku0_.kokyaku_name as kokyaku11_9_, kokyaku0_.kokyaku_ninzu as kokyaku12_9_, kokyaku0_.kokyaku_president_name as kokyaku13_9_, kokyaku0_.kokyaku_shihon as kokyaku14_9_, kokyaku0_.kokyaku_tel as kokyaku15_9_, kokyaku0_.tanto_cd as tanto17_9_, kokyaku0_.start_date as start16_9_ from demo.kokyaku kokyaku0_ where lower(kokyaku0_.kokyaku_cd) like (lower(?))
Hibernate: select top ? kokyaku0_.kokyaku_cd as kokyaku1_9_, kokyaku0_.apply_date as apply2_9_, kokyaku0_.create_date as create3_9_, kokyaku0_.kokyaku_addr as kokyaku4_9_, kokyaku0_.kokyaku_date as kokyaku5_9_, kokyaku0_.kokyaku_fax as kokyaku6_9_, kokyaku0_.kokyaku_gyosyu as kokyaku7_9_, kokyaku0_.kokyaku_kana as kokyaku8_9_, kokyaku0_.kokyaku_mail as kokyaku9_9_, kokyaku0_.kokyaku_naiyo as kokyaku10_9_, kokyaku0_.kokyaku_name as kokyaku11_9_, kokyaku0_.kokyaku_ninzu as kokyaku12_9_, kokyaku0_.kokyaku_president_name as kokyaku13_9_, kokyaku0_.kokyaku_shihon as kokyaku14_9_, kokyaku0_.kokyaku_tel as kokyaku15_9_, kokyaku0_.tanto_cd as tanto17_9_, kokyaku0_.start_date as start16_9_ from demo.kokyaku kokyaku0_
FAILED: testSearchSingle
java.lang.AssertionError: javax.el.ELException: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
   at org.jboss.seam.mock.BaseSeamTest$Request.onException(BaseSeamTest.java:475)
   at org.jboss.seam.mock.BaseSeamTest$Request$2.doFilter(BaseSeamTest.java:526)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
   at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
   at org.jboss.seam.mock.BaseSeamTest$Request.run(BaseSeamTest.java:514)
   at org.domain.demo.integrationTest.SearchTest.testSearchSingle(SearchTest.java:76)
Caused by: javax.el.ELException: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
   at javax.el.BeanELResolver.getValue(BeanELResolver.java:297)
   at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
   at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
   at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53)
   at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
   at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
   at org.jboss.seam.jsf.SeamApplication.evaluateExpressionGet(SeamApplication.java:333)
   at org.jboss.seam.mock.BaseSeamTest$Request.getValue(BaseSeamTest.java:441)
   at org.domain.demo.integrationTest.SearchTest$3.renderResponse(SearchTest.java:69)
   at org.jboss.seam.mock.BaseSeamTest$Request.renderResponsePhase(BaseSeamTest.java:627)
   at org.jboss.seam.mock.BaseSeamTest$Request.emulateJsfLifecycle(BaseSeamTest.java:611)
   at org.jboss.seam.mock.BaseSeamTest$Request.access$300(BaseSeamTest.java:185)
   at org.jboss.seam.mock.BaseSeamTest$Request$2.doFilter(BaseSeamTest.java:519)
   ... 36 more
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
   at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:630)
   at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:75)
   at org.jboss.seam.framework.EntityQuery.initResultList(EntityQuery.java:74)
   at org.jboss.seam.framework.EntityQuery.getResultList(EntityQuery.java:65)
   at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
   at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
   at org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:48)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
   at org.jboss.seam.util.Work.workInTransaction(Work.java:40)
   at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
   at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:155)
   at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:91)
   at org.domain.demo.session.KokyakuList_$$_javassist_0.getResultList(KokyakuList_$$_javassist_0.java)
   at javax.el.BeanELResolver.getValue(BeanELResolver.java:292)
   ... 48 more
Caused by: org.hibernate.exception.GenericJDBCException: could not execute query
   at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
   at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
   at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
   at org.hibernate.loader.Loader.doList(Loader.java:2223)
   at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
   at org.hibernate.loader.Loader.list(Loader.java:2099)
   at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
   at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
   at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
   at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
   at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
   at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:66)
   ... 76 more
Caused by: java.sql.SQLException: invalid schema name: DEMO in statement [select top ? kokyaku0_.kokyaku_cd as kokyaku1_9_, kokyaku0_.apply_date as apply2_9_, kokyaku0_.create_date as create3_9_, kokyaku0_.kokyaku_addr as kokyaku4_9_, kokyaku0_.kokyaku_date as kokyaku5_9_, kokyaku0_.kokyaku_fax as kokyaku6_9_, kokyaku0_.kokyaku_gyosyu as kokyaku7_9_, kokyaku0_.kokyaku_kana as kokyaku8_9_, kokyaku0_.kokyaku_mail as kokyaku9_9_, kokyaku0_.kokyaku_naiyo as kokyaku10_9_, kokyaku0_.kokyaku_name as kokyaku11_9_, kokyaku0_.kokyaku_ninzu as kokyaku12_9_, kokyaku0_.kokyaku_president_name as kokyaku13_9_, kokyaku0_.kokyaku_shihon as kokyaku14_9_, kokyaku0_.kokyaku_tel as kokyaku15_9_, kokyaku0_.tanto_cd as tanto17_9_, kokyaku0_.start_date as start16_9_ from demo.kokyaku kokyaku0_ where lower(kokyaku0_.kokyaku_cd) like (lower(?))]
   at org.hsqldb.jdbc.Util.throwError(Unknown Source)
   at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(Unknown Source)
   at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)
   at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.doPrepareStatement(BaseWrapperManagedConnection.java:386)
   at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.prepareStatement(BaseWrapperManagedConnection.java:374)
   at org.jboss.resource.adapter.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:187)
   at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:505)
   at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:423)
   at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
   at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
   at org.hibernate.loader.Loader.doQuery(Loader.java:673)
   at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
   at org.hibernate.loader.Loader.doList(Loader.java:2220)
   ... 84 more
... Removed 30 stack frames
FAILED: testSearchAll
java.lang.AssertionError: javax.el.ELException: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
   at org.jboss.seam.mock.BaseSeamTest$Request.onException(BaseSeamTest.java:475)
   at org.jboss.seam.mock.BaseSeamTest$Request$2.doFilter(BaseSeamTest.java:526)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
   at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
   at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
   at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
   at org.jboss.seam.mock.BaseSeamTest$Request.run(BaseSeamTest.java:514)
   at org.domain.demo.integrationTest.SearchTest.testSearchAll(SearchTest.java:45)
Caused by: javax.el.ELException: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
   at javax.el.BeanELResolver.getValue(BeanELResolver.java:297)
   at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
   at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
   at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53)
   at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
   at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
   at org.jboss.seam.jsf.SeamApplication.evaluateExpressionGet(SeamApplication.java:333)
   at org.jboss.seam.mock.BaseSeamTest$Request.getValue(BaseSeamTest.java:441)
   at org.domain.demo.integrationTest.SearchTest$2.renderResponse(SearchTest.java:35)
   at org.jboss.seam.mock.BaseSeamTest$Request.renderResponsePhase(BaseSeamTest.java:627)
   at org.jboss.seam.mock.BaseSeamTest$Request.emulateJsfLifecycle(BaseSeamTest.java:611)
   at org.jboss.seam.mock.BaseSeamTest$Request.access$300(BaseSeamTest.java:185)
   at org.jboss.seam.mock.BaseSeamTest$Request$2.doFilter(BaseSeamTest.java:519)
   ... 36 more
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
   at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:630)
   at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:75)
   at org.jboss.seam.framework.EntityQuery.initResultList(EntityQuery.java:74)
   at org.jboss.seam.framework.EntityQuery.getResultList(EntityQuery.java:65)
   at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
   at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
   at org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:48)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
   at org.jboss.seam.util.Work.workInTransaction(Work.java:40)
   at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
   at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
   at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
   at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:155)
   at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:91)
   at org.domain.demo.session.KokyakuList_$$_javassist_0.getResultList(KokyakuList_$$_javassist_0.java)
   at javax.el.BeanELResolver.getValue(BeanELResolver.java:292)
   ... 48 more
Caused by: org.hibernate.exception.GenericJDBCException: could not execute query
   at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
   at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
   at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
   at org.hibernate.loader.Loader.doList(Loader.java:2223)
   at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
   at org.hibernate.loader.Loader.list(Loader.java:2099)
   at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
   at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
   at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
   at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
   at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
   at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:66)
   ... 76 more
Caused by: java.sql.SQLException: invalid schema name: DEMO in statement [select top ? kokyaku0_.kokyaku_cd as kokyaku1_9_, kokyaku0_.apply_date as apply2_9_, kokyaku0_.create_date as create3_9_, kokyaku0_.kokyaku_addr as kokyaku4_9_, kokyaku0_.kokyaku_date as kokyaku5_9_, kokyaku0_.kokyaku_fax as kokyaku6_9_, kokyaku0_.kokyaku_gyosyu as kokyaku7_9_, kokyaku0_.kokyaku_kana as kokyaku8_9_, kokyaku0_.kokyaku_mail as kokyaku9_9_, kokyaku0_.kokyaku_naiyo as kokyaku10_9_, kokyaku0_.kokyaku_name as kokyaku11_9_, kokyaku0_.kokyaku_ninzu as kokyaku12_9_, kokyaku0_.kokyaku_president_name as kokyaku13_9_, kokyaku0_.kokyaku_shihon as kokyaku14_9_, kokyaku0_.kokyaku_tel as kokyaku15_9_, kokyaku0_.tanto_cd as tanto17_9_, kokyaku0_.start_date as start16_9_ from demo.kokyaku kokyaku0_]
   at org.hsqldb.jdbc.Util.throwError(Unknown Source)
   at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(Unknown Source)
   at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)
   at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.doPrepareStatement(BaseWrapperManagedConnection.java:386)
   at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.prepareStatement(BaseWrapperManagedConnection.java:374)
   at org.jboss.resource.adapter.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:187)
   at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:505)
   at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:423)
   at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
   at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547)
   at org.hibernate.loader.Loader.doQuery(Loader.java:673)
   at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
   at org.hibernate.loader.Loader.doList(Loader.java:2220)
   ... 84 more
... Removed 30 stack frames

===============================================
    org.domain.demo.integrationTest.SearchTest
    Tests run: 2, Failures: 2, Skips: 0
===============================================


===============================================
demo
Total tests run: 2, Failures: 2, Skips: 0
===============================================


invalid schema name: DEMO in statement,it seems hibernate does not generate the schema for my memory hsqldb.then i add


Code:
CREATE SCHEMA DEMO AUTHORIZATION DBA

just at the front of my import.sql.then this exception does not appear.but my data import.sql is not inserted,i got my list with 0 record.

and i also try delete catalog or set catalog="" in the @table annotation,all works correctly

my question is when there is catalog or schema in entity ,how to make it work in memory hsqldb.thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.