Quantcast
Channel: JetBrains Developer Community : Thread List - IntelliJ IDEA Users
Viewing all articles
Browse latest Browse all 5661

To Persistence Gurus: JPA and Hibernate with HSQLDB

$
0
0

Hello Gurus,

I am new with setting up a database, but for a day now, I have the auto generate hiberenate code working somewhat and connect to my HSQLDB database. The issue that I am having is that I am getting an error in the log with the for loop in the main that is auto generated by IntelliJ that includes:


final Query query = session.createQuery("from " + entityName);

                System.out.println("executing: " + query.getQueryString());

                for (Object o : query.list()) {

                    System.out.println("  " + o);


Caused by: java.sql.SQLException: Table not found in statement [select marioncrme0_.id as id0_, marioncrme0_.courseName as courseName0_, marioncrme0_.courseNumber as courseNu3_0_, marioncrme0_.c


My Class:

@javax.persistence.Table(name = "CRM", schema = "PUBLIC", catalog = "")

@Entity

public class MarionCrmEntity


Is this a dialect issue or what? It seems like it it is querying wrong with an usual syntax maybe... Do i need to set up or change my hibernate config file?


Hibernate config:

<hibernate-configuration>

    <session-factory>

        <property name="connection.url"><![CDATA[jdbc:hsqldb:file:./test]]></property>

        <property name="connection.driver_class">org.hsqldb.jdbcDriver</property>

        <property name="connection.username">SA</property>

        <property name="connection.password"></property>


        <mapping class="db.MarionCrmEntity"/>

        <!-- DB schema will be updated if needed -->

        <!-- <property name="hbm2ddl.auto">update</property> -->

    </session-factory>


Persitence file:

  <persistence-unit name="TestUnit">

        <class>db.MarionCrmEntity</class>

        <properties>

            <property name="hibernate.connection.url" value="jdbc:hsqldb:file:./test"/>

            <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>

            <property name="hibernate.connection.username" value="SA"/>

            <property name="hibernate.connection.password" value=""/>

        </properties>

    </persistence-unit>

 

Thanks for any help, and I love Intellij!!!


Viewing all articles
Browse latest Browse all 5661

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>