hsqldb

Hibernate @OneToMany throws MySQLSyntaxErrorException: You have an error in your SQL syntax

≯℡__Kan透↙ 提交于 2019-12-06 07:11:27
I try to retrieve a list with some fields from Contact and also a list of phones. For this, I'm using a query to Contacts; Also I've created a DTO with only that fields that I need. The query is: final StringBuilder query = new StringBuilder(); query.append("SELECT new com.tim.core.dto.client.MinimalContactDTO(c.id, c.version, c.name, c.title, c.email, c.createdDate, c.phones) " + " from CONTACT c "); query.append("where "); query.append("( c.localRecordStatus IS NULL "); query.append("OR c.localRecordStatus IN (:openStatusList) "); query.append(" ) "); return em.createQuery(query.toString(),

Can I use HSQLDB for junit testing cloning a mySQL database

谁说胖子不能爱 提交于 2019-12-06 06:58:42
问题 I am working on a spring webflow project and I am thinking can I use HSQLDB and not my mysql for junit testing? How can I clone my mysql database into HSQLDB 回答1: If you are using spring 3.1 or greater you could use spring profiles to achieve this. The default profile is loaded when no active profile is set. <beans profile="dev"> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="org.hsqldb.jdbcDriver" /> ..

Firebird vs HSQLDB at Java

廉价感情. 提交于 2019-12-06 06:24:59
问题 i wanna write a small (5-6 table) desktop app in java.I wanna use Firebird 2.1. database.But i googled and see HSQLDB.I wanna make a decision between firebird and hsqldb :) So which database i have to use ? 回答1: For a desktop application an embedded database should be enough. hsqldb or h2 are very well suited for this. You just have to add the JAR file to you applications classpath. Firebird looks more complex. Actually, H2 is more advanced than hsqldb. 回答2: Firebird runs in a process of its

populating in memory hsqldb database from script

跟風遠走 提交于 2019-12-06 06:00:55
问题 Is there a way that I can specify a script in the connection string pointing to my in memory hsqldb instance? I was looking at this article and it looks like it is possible, but I'm not sure how to formulate the string correctly or where to put the script file. Looking at the hsqldb documentation here it doesn't appear to be the case. What would my options here be for using this from java tests? This is related to a previous hsqldb question here starting and stopping hsqldb from unit tests

Copy data between different databases (both are jdbc supported)

余生颓废 提交于 2019-12-06 05:11:15
问题 I'd like to copy all data from my testing database (mysql) to a production database (hsqldb) I used hibernate and let it created tables in those database for me. So the structure/schema are the same. Using mysql dump i can copy data between two mysql databases. but in my case the database are different, and i heard the generated sql from mysqldump wont work with hsqldb. Since both database type are support by jdbc/hibernate, are there any way/method/java library to copy data between them? 回答1

JPA - transactions not being committed

霸气de小男生 提交于 2019-12-06 02:58:41
i'm working on a project in which i use JPA, Hibernate and all this stuff for the first time and i ran into problem with transactions not being committed. I use class User which looks like this: package org.tomasherman.JBTBackup.Resource.Entity; import javax.persistence.*; import java.io.Serializable; @Entity @Table(name = "users") public class User implements Serializable { @Id @GeneratedValue private int id; private String login; private String email; private String password; private int credit; public User() { } public User(String login, String email, String password, int credit) { setLogin

Execute Trigger on View?

南楼画角 提交于 2019-12-06 01:32:54
问题 I am not too familiar with database triggers and/or views. I am currently using PostgreSQL and HSQL; although the database is not too important. I am just wondering if any database offers something like this: I have an (example) table like this: CREATE TABLE DUMMY_TABLE (ID INTEGER, NUMBER INTEGER); I created a view like this: CREATE VIEW DUMMY_VIEW AS SELECT * FROM DUMMY_TABLE WHERE NUMBER > 5; I insert a couple of entities: INSERT INTO DUMMY_TABLE VALUES(1,2); INSERT INTO DUMMY_TABLE VALUES

Failover support for a DB

只谈情不闲聊 提交于 2019-12-06 00:12:08
We are currently evaluating failover support in different databases. We were earlier using HSQLDB but it seems that it does not have clustering/replication support. Our requirement is simply to have two database servers, one being only for synchronous backup but if the primary server is down, then the secondary should automatically start acting as the primary server. Has anyone evaluated MySQL, PostgreSQL or any other DB server for such a use case? Edit: We had thought of using MySQL cluster but it now seems that it is under GPL license which we won't be able to work with. Could anyone please

主页样式完成、初识ant,jpetstore

放肆的年华 提交于 2019-12-05 21:16:17
下午就已经把主页的样式写好了,还算比较满意。像模像样的,呵呵。下面就是加载动态内容上去了。 最近想把jpetstore这个spring演示项目研究研究,使用到了ant,用ant构建项目省心不少。只要build.xml文件中需要的文件夹,和文件都在相应位置存在,很顺利就构建好项目。已经成功放在tomcat里运行,这里改用了mysql数据库,并尝试把jpetstore部署到eclipse并发布测试,由于jpetstore默认使用了hsqldb 数据库,顺便也研究了一下,知道了怎么启动hsqldb和启动hsqldb可视化管理界面,这个可视化管理界面只提供了简单的执行语句功能。 下面是一个简单的ant教程,非常简单: http://topic.csdn.net/t/20030219/14/1443902.html 来源: oschina 链接: https://my.oschina.net/u/135304/blog/28041

Mapping a table called “group” in Hibernate for DB2 and HSQLDB

柔情痞子 提交于 2019-12-05 20:52:52
I have a table called group , that I am trying to map using hibernate for DB2 and HSQLDB . Table name group is a reserved word and it must be quoted in HSQLDB. However DB2 does not like quoted table name. So this mapping works in HSQLDB but not in DB2: @Entity @Table(name="`group`") public class Group { Mapping results in following error in DB2 (making a query that involves Group table): Caused by: com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: SCHEMA_NAME.group at com.ibm.db2.jcc.b.hh.c(hh.java:1662) at com.ibm.db2.jcc.b.hh.d(hh.java:1650) at com.ibm