hsqldb2.2-2.2.9.orig/ 0000755 0001750 0001750 00000000000 12007570424 012627 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/ 0000755 0001750 0001750 00000000000 12007570424 014104 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/stylesheets/ 0000755 0001750 0001750 00000000000 12007570424 016460 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/stylesheets/html-common.xsl 0000644 0001750 0001750 00000010632 12007547426 021452 0 ustar rene rene
hsqldb2.2-2.2.9.orig/hsqldb/stylesheets/fo.xsl 0000644 0001750 0001750 00000013200 12007547426 017616 0 ustar rene rene
0.5pt solid black
1pt
#FFE4E1
3pt
0.5pt solid gray
1pt
#F0F8FF
auto
wrap
8pt
#000080
pt
pt
pt
pt
pt
pt
pt
#000080
hsqldb2.2-2.2.9.orig/hsqldb/stylesheets/chunk.xsl 0000644 0001750 0001750 00000015413 12007547426 020332 0 ustar rene rene
hsqldb2.2-2.2.9.orig/hsqldb/stylesheets/html.xsl 0000644 0001750 0001750 00000001125 12007547426 020161 0 ustar rene rene
hsqldb2.2-2.2.9.orig/hsqldb/stylesheets/pagesetup.xsl 0000644 0001750 0001750 00000011073 12007547426 021215 0 ustar rene rene
,
,
-
-
../images/hypersql_logo2.png
hsqldb2.2-2.2.9.orig/hsqldb/integration/ 0000755 0001750 0001750 00000000000 12007557304 016431 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/integration/extAuthWithSpring/ 0000755 0001750 0001750 00000000000 12007557304 022072 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/integration/extAuthWithSpring/ivy-projsetup.xml 0000644 0001750 0001750 00000002561 12007547332 025460 0 ustar rene rene
Add Ivy jar file to Ant CLASSPATH.
Copy-and-paste this for any Bourne shell (inc. Bash):
export ANT_ARGS; ANT_ARGS='-lib ${basedir}/../../build/ivy-2.2.0.jar -noclasspath'
OR copy-and-paste this for any CMD-like Windows shell:
SET ANT_ARGS=-lib "${basedir}/../../build/ivy-2.2.0.jar" -noclasspath
hsqldb2.2-2.2.9.orig/hsqldb/integration/extAuthWithSpring/ivy.xml 0000644 0001750 0001750 00000004536 12007547332 023433 0 ustar rene rene
hsqldb2.2-2.2.9.orig/hsqldb/integration/extAuthWithSpring/readme.txt 0000644 0001750 0001750 00000003315 12007547332 024072 0 ustar rene rene $Id: readme.txt 3931 2010-12-06 05:10:50Z unsaved $
This is the home directory of the extAuthWithSpring sample.
It uses Spring to declaratively configure external authentication with a
master HyperSQL catalog, or with an LDAP server.
You will need Ant and a Java JDK installed. To get started, invoke
ant -Dauthentication.mode=HsqldbSlave
from this directory to run a JDBC app backed by an application database, with
authentication to the application database through another embedded master
database. Play with the Spring bean files in the resources subdirectory to
switch the application database or the masterdatabase, or anything else.
To play with a JAAS module, run
ant -Dauthentication.mode=JAAS
The file resources/jaas.cfg will be generated the first time that you run
anything with Ant. With mode set to "JAAS", the "demo" application
configuration in jaas.cfg will be used.
If you have an LDAP server, edit "resources/ldapbeans.xml" to set settings
according to your LDAP server then run ant with the authentication.mode set to
"LDAP".
To help determine and test the settings that will work with your LDAP server, I
recommend that you use the program org.hsqldb.auth.LdapAuthBean. See the
HyperSQL API Spec for org.hsqldb.auth.LdapAuthBean and the sample properties
file for it at "sample/ldap-exerciser.properties" in your HyperSQL distribution.
As an alternative to LDAP mode, you can use JAAS_LDAP mode. That works very
similarly, but uses Sun's JAAS LDAP module and suffers from its limitations.
It should be easy to figure out how to use by looking over the "sunLdap"
application settings in jaas.cfg, and the Spring bean definitions in
resources/jaasldapbeans.xml.
hsqldb2.2-2.2.9.orig/hsqldb/integration/extAuthWithSpring/ivysettings.xml 0000644 0001750 0001750 00000001075 12007547332 025207 0 ustar rene rene
hsqldb2.2-2.2.9.orig/hsqldb/integration/extAuthWithSpring/src/ 0000755 0001750 0001750 00000000000 12007557304 022661 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/integration/extAuthWithSpring/src/org/ 0000755 0001750 0001750 00000000000 12007557304 023450 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/integration/extAuthWithSpring/src/org/hsqldb/ 0000755 0001750 0001750 00000000000 12007557304 024725 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/integration/extAuthWithSpring/src/org/hsqldb/sample/ 0000755 0001750 0001750 00000000000 12007557304 026206 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/integration/extAuthWithSpring/src/org/hsqldb/sample/SpringExtAuth.java 0000644 0001750 0001750 00000017126 12007547332 031625 0 ustar rene rene /* Copyright (c) 2001-2010, The HSQL Development Group
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the HSQL Development Group nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG,
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.hsqldb.sample;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.DriverManager;
import java.sql.SQLException;
import org.springframework.beans.factory.ListableBeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.ApplicationContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* As you can tell by the class name, this class is purposefully Spring-aware,
* as it initiates the Spring Spring context load.
* In a web application, a lifecycle lister or other
* mechanism would eliminate the need for any custom Java code to load the
* context (like what we have here).
*/
public class SpringExtAuth {
private static Log log = LogFactory.getLog(SpringExtAuth.class);
private static final String SYNTAX_MSG = "SYNTAX: "
+ SpringExtAuth.class.getName()
+ " {LDAP|HsqldbSlave|JAAS|JAAS_LDAP}";
/**
* @throws SQLException If Setup of emulation database failed, or if the
* application JDBC work fails.
*/
static public void main(String[] sa) throws SQLException {
if (sa.length != 1) throw new IllegalArgumentException(SYNTAX_MSG);
String authSpringFile = null;
if (sa[0].equals("LDAP")) {
authSpringFile = "ldapbeans.xml";
} else if (sa[0].equals("JAAS")) {
authSpringFile = "jaasbeans.xml";
} else if (sa[0].equals("HsqldbSlave")) {
authSpringFile = "slavebeans.xml";
} else if (sa[0].equals("JAAS_LDAP")) {
authSpringFile = "jaasldapbeans.xml";
}
if (authSpringFile == null)
throw new IllegalArgumentException(SYNTAX_MSG);
SpringExtAuth.prepMemoryDatabases(!sa[0].equals("HsqldbSlave"));
ApplicationContext ctx =
new ClassPathXmlApplicationContext("beandefs.xml", authSpringFile);
ListableBeanFactory bf = (ListableBeanFactory) ctx;
JdbcAppClass appBean = bf.getBean("appBean", JdbcAppClass.class);
appBean.doJdbcWork();
}
/**
* This method prepares a memory-only catalog.
* After this method runs, a new Connection using the same JDBC URL will
* behave just like connecting to a populated, persistent catalog.
*
* Purposefully not using declarative settings here because this is purely
* emulation setup.
* A real application won't have any method corresponding to this method.
*
* @throws SQLException if setup failed
*/
private static void prepMemoryDatabases(boolean doLdap)
throws SQLException {
Connection c = null;
Statement st = null;
try {
c = DriverManager.getConnection(
"jdbc:hsqldb:mem:localDb", "SA", "");
// JDBC URL here must match that configured within the bean
// 'appBean' in "beandefs.xml" file
c.setAutoCommit(false);
st = c.createStatement();
st.executeUpdate("SET DATABASE UNIQUE NAME \"AUTHSAMPLEDBNAME\"");
st.executeUpdate(
"SET DATABASE AUTHENTICATION FUNCTION EXTERNAL NAME "
+ "'CLASSPATH:"
+ "org.hsqldb.auth.AuthBeanMultiplexer.authenticate'");
// DB Name here must match that configured in either
// "ldapbeans.xml" or "slavebean.xml", depending on whether you are
// running in LDAP or HsqldbSlave mode, correspondingly.
st.executeUpdate("SET PASSWORD 'SECRET5222173'");
st.executeUpdate("CREATE TABLE t1(i INTEGER)");
st.executeUpdate("GRANT SELECT ON t1 TO public");
st.executeUpdate("INSERT INTO t1 VALUES(456)");
// Table name and value must match what is expected by method
// JdbcAppClass.doJdbcWork.
c.commit();
} finally {
if (st != null) try {
st.close();
} catch (SQLException se) {
log.error("Failed to close emulation database setup Connection",
se);
} finally {
st = null; // Encourage GC
}
if (c != null) try {
c.close();
} catch (SQLException se) {
log.error("Failed to close emulation database setup Connection",
se);
} finally {
c = null; // Encourage GC
}
}
if (doLdap) return;
// Create an authentication master database
try {
c = DriverManager.getConnection(
"jdbc:hsqldb:mem:masterDb", "SA", "");
// JDBC URL here must match that configured for bean
// 'slaveSetup' in "slavebeans.xml" file
c.setAutoCommit(false);
st = c.createStatement();
st.executeUpdate("SET PASSWORD 'SECRET9123113'");
// This password will never be used again.
// Changing it from the default just for good security practice.
st.executeUpdate("CREATE USER \"straight\" PASSWORD 'pwd'");
// User name and password here must match those configured in file
// "beandefs.xml".
c.commit();
} finally {
if (st != null) try {
st.close();
} catch (SQLException se) {
log.error("Failed to close emulation database setup Connection",
se);
} finally {
st = null; // Encourage GC
}
if (c != null) try {
c.close();
} catch (SQLException se) {
log.error("Failed to close emulation database setup Connection",
se);
} finally {
c = null; // Encourage GC
}
}
}
}
hsqldb2.2-2.2.9.orig/hsqldb/integration/extAuthWithSpring/src/org/hsqldb/sample/JdbcAppClass.java 0000644 0001750 0001750 00000010232 12007547332 031340 0 ustar rene rene /* Copyright (c) 2001-2010, The HSQL Development Group
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Neither the name of the HSQL Development Group nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG,
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.hsqldb.sample;
import java.sql.SQLException;
import java.sql.ResultSet;
import java.sql.Connection;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.sql.DataSource;
/**
* An application class that performs some simple JDBC work.
*
* This class is purposefully not Spring-aware.
*/
public class JdbcAppClass {
private static Log log = LogFactory.getLog(JdbcAppClass.class);
private boolean initialized;
private DataSource ds;
public void init() {
if (ds == null) throw new IllegalStateException(
"Required property 'dataSource' not set");
initialized = true;
}
public void setDataSource(DataSource ds) {
this.ds = ds;
}
public void doJdbcWork() throws SQLException {
if (!initialized)
throw new IllegalStateException(JdbcAppClass.class.getName()
+ " instance not initialized");
Connection c = null;
ResultSet rs = null;
try {
c = ds.getConnection();
rs = c.createStatement().executeQuery("SELECT * FROM t1");
if (!rs.next()) {
log.error("App class failed to retrieve data from catalog");
return;
}
if (rs.getInt(1) != 456) {
log.error("App class retrieved wrong value: " + rs.getInt(1));
return;
}
if (rs.next()) {
log.error("App class failed too much data from catalog");
return;
}
} finally {
if (c != null) try {
c.rollback();
} catch (SQLException se) {
// Intentionally empty.
// We have done nothing that we want to commit, but want to
// aggressively free transactional resources.
}
if (rs != null) try {
rs.close();
} catch (SQLException se) {
log.error("Failed to close emulation database setup Connection",
se);
} finally {
rs = null; // Encourage GC
}
if (c != null) try {
c.close();
} catch (SQLException se) {
log.error("Failed to close emulation database setup Connection",
se);
} finally {
c = null; // Encourage GC
}
}
log.info("Application Success");
}
}
hsqldb2.2-2.2.9.orig/hsqldb/integration/extAuthWithSpring/jul.properties 0000644 0001750 0001750 00000001551 12007547332 025004 0 ustar rene rene # $Id: jul.properties 3914 2010-11-26 22:11:10Z unsaved $
# As this is a Java .properties file, use ISO-8859-1 encoding for any
# extended characters.
# See http://java.sun.com/javase/6/docs/technotes/guides/logging/overview.html
# for an overview of the JDK logging system, aka the Java Logging API or
# java.util.logging.
# If you want more, and easier, control, particularly over the format of
# output records, use Log4J instead.
# This is different from the default logging file provided by HyperSQL.
# Here, we purposefully turn up verbosity of the org.hsqldb.sample classes so
# the user can see what is going in the examples.
handlers=java.util.logging.ConsoleHandler
.level=WARNING
java.util.logging.ConsoleHandler.level=INFO
java.util.logging.ConsoleHandler.formatter=org.hsqldb.lib.BasicTextJdkLogFormatter
org.hsqldb.sample.level=INFO
hsqldb2.2-2.2.9.orig/hsqldb/integration/extAuthWithSpring/build.xml 0000644 0001750 0001750 00000010501 12007547332 023710 0 ustar rene rene
You must set Ant property 'authentication.mode' to either
"LDAP" or "JAAS" or "HsqldbSlave" or "JAAS_LDAP".
Ant property 'hsqldb.jarfile' is required.
To get it using Ivy, SEE COMMENTS THE BUILD FILE.
hsqldb2.2-2.2.9.orig/hsqldb/integration/extAuthWithSpring/resources/ 0000755 0001750 0001750 00000000000 12007557304 024104 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/integration/extAuthWithSpring/resources/jaasbeans.xml 0000644 0001750 0001750 00000002127 12007547332 026557 0 ustar rene rene
hsqldb2.2-2.2.9.orig/hsqldb/integration/extAuthWithSpring/resources/ldapbeans.xml 0000644 0001750 0001750 00000002616 12007547332 026564 0 ustar rene rene
hsqldb2.2-2.2.9.orig/hsqldb/integration/extAuthWithSpring/resources/slavebeans.xml 0000644 0001750 0001750 00000001760 12007547332 026755 0 ustar rene rene
hsqldb2.2-2.2.9.orig/hsqldb/integration/extAuthWithSpring/resources/beandefs.xml 0000644 0001750 0001750 00000002673 12007547332 026405 0 ustar rene rene
hsqldb2.2-2.2.9.orig/hsqldb/integration/extAuthWithSpring/resources/jaasldapbeans.xml 0000644 0001750 0001750 00000002120 12007547332 027411 0 ustar rene rene
hsqldb2.2-2.2.9.orig/hsqldb/integration/jackrabbit/ 0000755 0001750 0001750 00000000000 12007557304 020525 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/integration/jackrabbit/readme.txt 0000644 0001750 0001750 00000002633 12007547332 022527 0 ustar rene rene This directory contains access files for Apache Jackrabbit (http://jackrabbit.apache.org/)
The ddl file for jackrabbit version 2.x is located at:
resources/org/apache/jackrabbit/core/persistence/bundle/hsqldb.ddl
This ddl file can be used with the default BundleDbPersistenceManager
Copy the ddl file to the same directory in your Jackrabbit setup, alongside the existing
ddl files. For example jackrabbit-standalone-2.2.4/org/apache/jackrabbit/core/persistence/bundle
A sample configuration is given below. The DDL table definitions use BLOBs, which
are stored on disk.
If you are storing no more than several thousand objects, the non-blob fields can be stored in
memory for quicker access with hsqldb.default_table_type=memory. See the hsqldb documentation
at http://hsqldb.org/doc/2.0/ for different connection URL and other properties that can be used.
A ddl file for older versions of Jackrabbit is also included in the ...core/persistence/db directory.
All files are modified copies of existing Jackrabbit sources.
hsqldb2.2-2.2.9.orig/hsqldb/integration/jackrabbit/resources/ 0000755 0001750 0001750 00000000000 12007557304 022537 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/integration/jackrabbit/resources/org/ 0000755 0001750 0001750 00000000000 12007557304 023326 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/integration/jackrabbit/resources/org/apache/ 0000755 0001750 0001750 00000000000 12007557304 024547 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/integration/jackrabbit/resources/org/apache/jackrabbit/ 0000755 0001750 0001750 00000000000 12007557304 026643 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/integration/jackrabbit/resources/org/apache/jackrabbit/core/ 0000755 0001750 0001750 00000000000 12007557304 027573 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/integration/jackrabbit/resources/org/apache/jackrabbit/core/journal/ 0000755 0001750 0001750 00000000000 12007557304 031245 5 ustar rene rene ././@LongLink 0000000 0000000 0000000 00000000153 00000000000 011564 L ustar root root hsqldb2.2-2.2.9.orig/hsqldb/integration/jackrabbit/resources/org/apache/jackrabbit/core/journal/hsqldb.ddl hsqldb2.2-2.2.9.orig/hsqldb/integration/jackrabbit/resources/org/apache/jackrabbit/core/journal/hsql0000644 0001750 0001750 00000002702 12007547332 032140 0 ustar rene rene # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
create table ${schemaObjectPrefix}JOURNAL (REVISION_ID BIGINT NOT NULL, JOURNAL_ID varchar(255), PRODUCER_ID varchar(255), REVISION_DATA blob)
create unique index ${schemaObjectPrefix}JOURNAL_IDX on ${schemaObjectPrefix}JOURNAL (REVISION_ID)
create table ${schemaObjectPrefix}GLOBAL_REVISION (REVISION_ID BIGINT NOT NULL)
create unique index ${schemaObjectPrefix}GLOBAL_REVISION_IDX on ${schemaObjectPrefix}GLOBAL_REVISION (REVISION_ID)
create table ${schemaObjectPrefix}LOCAL_REVISIONS (JOURNAL_ID varchar(255) NOT NULL, REVISION_ID BIGINT NOT NULL)
# Inserting the one and only revision counter record now helps avoiding race conditions
insert into ${schemaObjectPrefix}GLOBAL_REVISION VALUES(0)
hsqldb2.2-2.2.9.orig/hsqldb/integration/jackrabbit/resources/org/apache/jackrabbit/core/persistence/0000755 0001750 0001750 00000000000 12007557304 032117 5 ustar rene rene ././@LongLink 0000000 0000000 0000000 00000000154 00000000000 011565 L ustar root root hsqldb2.2-2.2.9.orig/hsqldb/integration/jackrabbit/resources/org/apache/jackrabbit/core/persistence/bundle/ hsqldb2.2-2.2.9.orig/hsqldb/integration/jackrabbit/resources/org/apache/jackrabbit/core/persistence/0000755 0001750 0001750 00000000000 12007557304 032117 5 ustar rene rene ././@LongLink 0000000 0000000 0000000 00000000166 00000000000 011570 L ustar root root hsqldb2.2-2.2.9.orig/hsqldb/integration/jackrabbit/resources/org/apache/jackrabbit/core/persistence/bundle/hsqldb.ddl hsqldb2.2-2.2.9.orig/hsqldb/integration/jackrabbit/resources/org/apache/jackrabbit/core/persistence/0000644 0001750 0001750 00000002465 12007547332 032130 0 ustar rene rene # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Bundle persistence DDL script for the HSQLDB database engine (http://www.hsqldb.org)
#
create table ${schemaObjectPrefix}BUNDLE (NODE_ID binary(16) primary key, BUNDLE_DATA blob(2G) not null))
create table ${schemaObjectPrefix}REFS (NODE_ID binary(16) PRIMARY KEY primary key, REFS_DATA blob(2G) not null))
create table ${schemaObjectPrefix}BINVAL (BINVAL_ID char(64) PRIMARY KEY, BINVAL_DATA blob(2G) not null)
create table ${schemaObjectPrefix}NAMES (ID INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY, NAME varchar(255) not null)
././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root hsqldb2.2-2.2.9.orig/hsqldb/integration/jackrabbit/resources/org/apache/jackrabbit/core/persistence/db/ hsqldb2.2-2.2.9.orig/hsqldb/integration/jackrabbit/resources/org/apache/jackrabbit/core/persistence/0000755 0001750 0001750 00000000000 12007557304 032117 5 ustar rene rene ././@LongLink 0000000 0000000 0000000 00000000162 00000000000 011564 L ustar root root hsqldb2.2-2.2.9.orig/hsqldb/integration/jackrabbit/resources/org/apache/jackrabbit/core/persistence/db/hsqldb.ddl hsqldb2.2-2.2.9.orig/hsqldb/integration/jackrabbit/resources/org/apache/jackrabbit/core/persistence/0000644 0001750 0001750 00000002357 12007547332 032130 0 ustar rene rene # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# DDL script for the HSQLDB database engine (http://www.hsqldb.org)
#
create table ${schemaObjectPrefix}NODE (NODE_ID char(36) primary key, NODE_DATA blob not null)
create table ${schemaObjectPrefix}PROP (PROP_ID varchar(1024) primary key, PROP_DATA blob not null)
create table ${schemaObjectPrefix}REFS (NODE_ID char(36) primary key, REFS_DATA blob not null)
create table ${schemaObjectPrefix}BINVAL (BINVAL_ID varchar(1024) primary key, BINVAL_DATA blob not null)
hsqldb2.2-2.2.9.orig/hsqldb/integration/hibernate_3_3_1/ 0000755 0001750 0001750 00000000000 12007557304 021256 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/integration/hibernate_3_3_1/src/ 0000755 0001750 0001750 00000000000 12007557304 022045 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/integration/hibernate_3_3_1/src/org/ 0000755 0001750 0001750 00000000000 12007557304 022634 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/integration/hibernate_3_3_1/src/org/hibernate/ 0000755 0001750 0001750 00000000000 12007557304 024575 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/integration/hibernate_3_3_1/src/org/hibernate/dialect/ 0000755 0001750 0001750 00000000000 12007557304 026202 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/integration/hibernate_3_3_1/src/org/hibernate/dialect/HSQLDialect.java 0000644 0001750 0001750 00000062151 12007547332 031107 0 ustar rene rene /*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.dialect;
import java.sql.SQLException;
import java.sql.Types;
import java.io.Serializable;
import org.hibernate.Hibernate;
import org.hibernate.LockMode;
import org.hibernate.StaleObjectStateException;
import org.hibernate.JDBCException;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.persister.entity.Lockable;
import org.hibernate.cfg.Environment;
import org.hibernate.dialect.function.NoArgSQLFunction;
import org.hibernate.dialect.function.StandardSQLFunction;
import org.hibernate.dialect.function.VarArgsSQLFunction;
import org.hibernate.dialect.lock.LockingStrategy;
import org.hibernate.dialect.lock.SelectLockingStrategy;
import org.hibernate.exception.JDBCExceptionHelper;
import org.hibernate.exception.TemplatedViolatedConstraintNameExtracter;
import org.hibernate.exception.ViolatedConstraintNameExtracter;
import org.hibernate.util.ReflectHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* An SQL dialect compatible with HSQLDB (HyperSQL).
*
* Note this version supports HSQLDB version 1.8 and higher, only.
*
* Enhancements to version 3.3.1 GA dialect to provide basic support for both HSQLDB 1.8.x and 2.0.
* For version 3.6.0 GA and later use the dialect supplied with Hibernate.
*
* @author Christoph Sturm
* @author Phillip Baird
* @author Fred Toussi
*/
public class HSQLDialect extends Dialect {
private static final Logger log = LoggerFactory.getLogger( HSQLDialect.class );
/**
* version is 18 for 1.8 or 20 for 2.0
*/
private int hsqldbVersion = 18;
public HSQLDialect() {
super();
try {
Class props = ReflectHelper.classForName( "org.hsqldb.persist.HsqlDatabaseProperties" );
String versionString = (String) props.getDeclaredField( "THIS_VERSION" ).get( null );
hsqldbVersion = Integer.parseInt( versionString.substring( 0, 1 ) ) * 10;
hsqldbVersion += Integer.parseInt( versionString.substring( 2, 3 ) );
}
catch ( Throwable e ) {
// must be a very old version
}
registerColumnType( Types.BIGINT, "bigint" );
registerColumnType( Types.BINARY, "binary($l)" );
registerColumnType( Types.BIT, "bit" );
registerColumnType( Types.BOOLEAN, "boolean" );
registerColumnType( Types.CHAR, "char($l)" );
registerColumnType( Types.DATE, "date" );
registerColumnType( Types.DECIMAL, "decimal($p,$s)" );
registerColumnType( Types.DOUBLE, "double" );
registerColumnType( Types.FLOAT, "float" );
registerColumnType( Types.INTEGER, "integer" );
registerColumnType( Types.LONGVARBINARY, "longvarbinary" );
registerColumnType( Types.LONGVARCHAR, "longvarchar" );
registerColumnType( Types.SMALLINT, "smallint" );
registerColumnType( Types.TINYINT, "tinyint" );
registerColumnType( Types.TIME, "time" );
registerColumnType( Types.TIMESTAMP, "timestamp" );
registerColumnType( Types.VARCHAR, "varchar($l)" );
registerColumnType( Types.VARBINARY, "varbinary($l)" );
if ( hsqldbVersion < 20 ) {
registerColumnType( Types.NUMERIC, "numeric" );
}
else {
registerColumnType( Types.NUMERIC, "numeric($p,$s)" );
}
//HSQL has no Blob/Clob support .... but just put these here for now!
if ( hsqldbVersion < 20 ) {
registerColumnType( Types.BLOB, "longvarbinary" );
registerColumnType( Types.CLOB, "longvarchar" );
}
else {
registerColumnType( Types.BLOB, "blob" );
registerColumnType( Types.CLOB, "clob" );
}
registerFunction( "ascii", new StandardSQLFunction( "ascii", Hibernate.INTEGER ) );
registerFunction( "char", new StandardSQLFunction( "char", Hibernate.CHARACTER ) );
registerFunction( "length", new StandardSQLFunction( "length", Hibernate.LONG ) );
registerFunction( "lower", new StandardSQLFunction( "lower" ) );
registerFunction( "upper", new StandardSQLFunction( "upper" ) );
registerFunction( "lcase", new StandardSQLFunction( "lcase" ) );
registerFunction( "ucase", new StandardSQLFunction( "ucase" ) );
registerFunction( "soundex", new StandardSQLFunction( "soundex", Hibernate.STRING ) );
registerFunction( "ltrim", new StandardSQLFunction( "ltrim" ) );
registerFunction( "rtrim", new StandardSQLFunction( "rtrim" ) );
registerFunction( "reverse", new StandardSQLFunction( "reverse" ) );
registerFunction( "space", new StandardSQLFunction( "space", Hibernate.STRING ) );
registerFunction( "rawtohex", new StandardSQLFunction( "rawtohex" ) );
registerFunction( "hextoraw", new StandardSQLFunction( "hextoraw" ) );
registerFunction( "user", new NoArgSQLFunction( "user", Hibernate.STRING ) );
registerFunction( "database", new NoArgSQLFunction( "database", Hibernate.STRING ) );
registerFunction( "current_date", new NoArgSQLFunction( "current_date", Hibernate.DATE, false ) );
registerFunction( "curdate", new NoArgSQLFunction( "curdate", Hibernate.DATE ) );
registerFunction( "current_timestamp", new NoArgSQLFunction( "current_timestamp", Hibernate.TIMESTAMP, false ) );
registerFunction( "now", new NoArgSQLFunction( "now", Hibernate.TIMESTAMP ) );
registerFunction( "current_time", new NoArgSQLFunction( "current_time", Hibernate.TIME, false ) );
registerFunction( "curtime", new NoArgSQLFunction( "curtime", Hibernate.TIME ) );
registerFunction( "day", new StandardSQLFunction( "day", Hibernate.INTEGER ) );
registerFunction( "dayofweek", new StandardSQLFunction( "dayofweek", Hibernate.INTEGER ) );
registerFunction( "dayofyear", new StandardSQLFunction( "dayofyear", Hibernate.INTEGER ) );
registerFunction( "dayofmonth", new StandardSQLFunction( "dayofmonth", Hibernate.INTEGER ) );
registerFunction( "month", new StandardSQLFunction( "month", Hibernate.INTEGER ) );
registerFunction( "year", new StandardSQLFunction( "year", Hibernate.INTEGER ) );
registerFunction( "week", new StandardSQLFunction( "week", Hibernate.INTEGER ) );
registerFunction( "quater", new StandardSQLFunction( "quater", Hibernate.INTEGER ) );
registerFunction( "hour", new StandardSQLFunction( "hour", Hibernate.INTEGER ) );
registerFunction( "minute", new StandardSQLFunction( "minute", Hibernate.INTEGER ) );
registerFunction( "second", new StandardSQLFunction( "second", Hibernate.INTEGER ) );
registerFunction( "dayname", new StandardSQLFunction( "dayname", Hibernate.STRING ) );
registerFunction( "monthname", new StandardSQLFunction( "monthname", Hibernate.STRING ) );
registerFunction( "abs", new StandardSQLFunction( "abs" ) );
registerFunction( "sign", new StandardSQLFunction( "sign", Hibernate.INTEGER ) );
registerFunction( "acos", new StandardSQLFunction( "acos", Hibernate.DOUBLE ) );
registerFunction( "asin", new StandardSQLFunction( "asin", Hibernate.DOUBLE ) );
registerFunction( "atan", new StandardSQLFunction( "atan", Hibernate.DOUBLE ) );
registerFunction( "cos", new StandardSQLFunction( "cos", Hibernate.DOUBLE ) );
registerFunction( "cot", new StandardSQLFunction( "cot", Hibernate.DOUBLE ) );
registerFunction( "exp", new StandardSQLFunction( "exp", Hibernate.DOUBLE ) );
registerFunction( "log", new StandardSQLFunction( "log", Hibernate.DOUBLE ) );
registerFunction( "log10", new StandardSQLFunction( "log10", Hibernate.DOUBLE ) );
registerFunction( "sin", new StandardSQLFunction( "sin", Hibernate.DOUBLE ) );
registerFunction( "sqrt", new StandardSQLFunction( "sqrt", Hibernate.DOUBLE ) );
registerFunction( "tan", new StandardSQLFunction( "tan", Hibernate.DOUBLE ) );
registerFunction( "pi", new NoArgSQLFunction( "pi", Hibernate.DOUBLE ) );
registerFunction( "rand", new StandardSQLFunction( "rand", Hibernate.FLOAT ) );
registerFunction( "radians", new StandardSQLFunction( "radians", Hibernate.DOUBLE ) );
registerFunction( "degrees", new StandardSQLFunction( "degrees", Hibernate.DOUBLE ) );
registerFunction( "roundmagic", new StandardSQLFunction( "roundmagic" ) );
registerFunction( "ceiling", new StandardSQLFunction( "ceiling" ) );
registerFunction( "floor", new StandardSQLFunction( "floor" ) );
// Multi-param dialect functions...
registerFunction( "mod", new StandardSQLFunction( "mod", Hibernate.INTEGER ) );
// function templates
registerFunction( "concat", new VarArgsSQLFunction( Hibernate.STRING, "(", "||", ")" ) );
getDefaultProperties().setProperty( Environment.STATEMENT_BATCH_SIZE, DEFAULT_BATCH_SIZE );
}
public String getAddColumnString() {
return "add column";
}
public boolean supportsIdentityColumns() {
return true;
}
public String getIdentityColumnString() {
return "generated by default as identity (start with 1)"; //not null is implicit
}
public String getIdentitySelectString() {
return "call identity()";
}
public String getIdentityInsertString() {
return hsqldbVersion < 20 ? "null" : "default";
}
public boolean supportsLockTimeouts() {
return false;
}
public String getForUpdateString() {
return "";
}
public boolean supportsUnique() {
return false;
}
public boolean supportsLimit() {
return true;
}
public String getLimitString(String sql, boolean hasOffset) {
if ( hsqldbVersion < 20 ) {
return new StringBuffer( sql.length() + 10 )
.append( sql )
.insert(
sql.toLowerCase().indexOf( "select" ) + 6,
hasOffset ? " limit ? ?" : " top ?"
)
.toString();
}
else {
return new StringBuffer( sql.length() + 20 )
.append( sql )
.append( hasOffset ? " offset ? limit ?" : " limit ?" )
.toString();
}
}
public boolean bindLimitParametersFirst() {
return hsqldbVersion < 20;
}
public boolean supportsIfExistsAfterTableName() {
return true;
}
public boolean supportsColumnCheck() {
return hsqldbVersion >= 20;
}
public boolean supportsSequences() {
return true;
}
public boolean supportsPooledSequences() {
return true;
}
protected String getCreateSequenceString(String sequenceName) {
return "create sequence " + sequenceName;
}
protected String getDropSequenceString(String sequenceName) {
return "drop sequence " + sequenceName;
}
public String getSelectSequenceNextValString(String sequenceName) {
return "next value for " + sequenceName;
}
public String getSequenceNextValString(String sequenceName) {
return "call next value for " + sequenceName;
}
public String getQuerySequencesString() {
// this assumes schema support, which is present in 1.8.0 and later...
return "select sequence_name from information_schema.system_sequences";
}
public ViolatedConstraintNameExtracter getViolatedConstraintNameExtracter() {
return hsqldbVersion < 20 ? EXTRACTER_18 : EXTRACTER_20;
}
private static ViolatedConstraintNameExtracter EXTRACTER_18 = new TemplatedViolatedConstraintNameExtracter() {
/**
* Extract the name of the violated constraint from the given SQLException.
*
* @param sqle The exception that was the result of the constraint violation.
* @return The extracted constraint name.
*/
public String extractConstraintName(SQLException sqle) {
String constraintName = null;
int errorCode = JDBCExceptionHelper.extractErrorCode( sqle );
if ( errorCode == -8 ) {
constraintName = extractUsingTemplate(
"Integrity constraint violation ", " table:", sqle.getMessage()
);
}
else if ( errorCode == -9 ) {
constraintName = extractUsingTemplate(
"Violation of unique index: ", " in statement [", sqle.getMessage()
);
}
else if ( errorCode == -104 ) {
constraintName = extractUsingTemplate(
"Unique constraint violation: ", " in statement [", sqle.getMessage()
);
}
else if ( errorCode == -177 ) {
constraintName = extractUsingTemplate(
"Integrity constraint violation - no parent ", " table:",
sqle.getMessage()
);
}
return constraintName;
}
};
/**
* HSQLDB 2.0 messages have changed
* messages may be localized - therefore use the common, non-locale element " table: "
*/
private static ViolatedConstraintNameExtracter EXTRACTER_20 = new TemplatedViolatedConstraintNameExtracter() {
public String extractConstraintName(SQLException sqle) {
String constraintName = null;
int errorCode = JDBCExceptionHelper.extractErrorCode( sqle );
if ( errorCode == -8 ) {
constraintName = extractUsingTemplate(
"; ", " table: ", sqle.getMessage()
);
}
else if ( errorCode == -9 ) {
constraintName = extractUsingTemplate(
"; ", " table: ", sqle.getMessage()
);
}
else if ( errorCode == -104 ) {
constraintName = extractUsingTemplate(
"; ", " table: ", sqle.getMessage()
);
}
else if ( errorCode == -177 ) {
constraintName = extractUsingTemplate(
"; ", " table: ", sqle.getMessage()
);
}
return constraintName;
}
};
public String getSelectClauseNullString(int sqlType) {
String literal;
switch ( sqlType ) {
case Types.VARCHAR:
case Types.CHAR:
literal = "cast(null as varchar(100))";
break;
case Types.DATE:
literal = "cast(null as date)";
break;
case Types.TIMESTAMP:
literal = "cast(null as timestamp)";
break;
case Types.TIME:
literal = "cast(null as time)";
break;
default:
literal = "cast(null as int)";
}
return literal;
}
public boolean supportsUnionAll() {
return true;
}
// temporary table support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Hibernate uses this information for temporary tables that it uses for its own operations
// therefore the appropriate strategy is taken with different versions of HSQLDB
// All versions of HSQLDB support GLOBAL TEMPORARY tables where the table
// definition is shared by all users but data is private to the session
// HSQLDB 2.0 also supports session-based LOCAL TEMPORARY tables where
// the definition and data is private to the session and table declaration
// can happen in the middle of a transaction
/**
* Does this dialect support temporary tables?
*
* @return True if temp tables are supported; false otherwise.
*/
public boolean supportsTemporaryTables() {
return true;
}
/**
* With HSQLDB 2.0, the table name is qualified with MODULE to assist the drop
* statement (in-case there is a global name beginning with HT_)
*
* @param baseTableName The table name from which to base the temp table name.
*
* @return The generated temp table name.
*/
public String generateTemporaryTableName(String baseTableName) {
if ( hsqldbVersion < 20 ) {
return "HT_" + baseTableName;
}
else {
return "MODULE.HT_" + baseTableName;
}
}
/**
* Command used to create a temporary table.
*
* @return The command used to create a temporary table.
*/
public String getCreateTemporaryTableString() {
if ( hsqldbVersion < 20 ) {
return "create global temporary table";
}
else {
return "declare local temporary table";
}
}
/**
* No fragment is needed if data is not needed beyond commit, otherwise
* should add "on commit preserve rows"
*
* @return Any required postfix.
*/
public String getCreateTemporaryTablePostfix() {
return "";
}
/**
* Command used to drop a temporary table.
*
* @return The command used to drop a temporary table.
*/
public String getDropTemporaryTableString() {
return "drop table";
}
/**
* Different behavior for GLOBAL TEMPORARY (1.8) and LOCAL TEMPORARY (2.0)
*
* Possible return values and their meanings:
* - {@link Boolean#TRUE} - Unequivocally, perform the temporary table DDL
* in isolation.
* - {@link Boolean#FALSE} - Unequivocally, do not perform the
* temporary table DDL in isolation.
* - null - defer to the JDBC driver response in regards to
* {@link java.sql.DatabaseMetaData#dataDefinitionCausesTransactionCommit()}
*
*
* @return see the result matrix above.
*/
public Boolean performTemporaryTableDDLInIsolation() {
if ( hsqldbVersion < 20 ) {
return Boolean.TRUE;
}
else {
return Boolean.FALSE;
}
}
/**
* Do we need to drop the temporary table after use?
*
* todo - clarify usage by Hibernate
*
* Version 1.8 GLOBAL TEMPORARY table definitions persist beyond the end
* of the session (by default, data is cleared at commit). If there are
* not too many such tables, perhaps we can avoid dropping them and reuse
* the table next time?
*
* Version 2.x LOCAL TEMPORARY table definitions do not persist beyond
* the end of the session (by default, data is cleared at commit).
*
* @return True if the table should be dropped.
*/
public boolean dropTemporaryTableAfterUse() {
if ( hsqldbVersion < 20 ) {
return Boolean.TRUE;
}
else {
return Boolean.FALSE;
}
}
// current timestamp support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/**
* HSQLDB 1.8.x requires CALL CURRENT_TIMESTAMP but this should not
* be treated as a callable statement. It is equivalent to
* "select current_timestamp from dual" in some databases.
* HSQLDB 2.0 also supports VALUES CURRENT_TIMESTAMP
*
* @return True if the current timestamp can be retrieved; false otherwise.
*/
public boolean supportsCurrentTimestampSelection() {
return true;
}
/**
* Should the value returned by {@link #getCurrentTimestampSelectString}
* be treated as callable. Typically this indicates that JDBC escape
* syntax is being used...
*
* CALL CURRENT_TIMESTAMP is used but this should not
* be treated as a callable statement.
*
* @return True if the {@link #getCurrentTimestampSelectString} return
* is callable; false otherwise.
*/
public boolean isCurrentTimestampSelectStringCallable() {
return false;
}
/**
* Retrieve the command used to retrieve the current timestamp from the
* database.
*
* @return The command.
*/
public String getCurrentTimestampSelectString() {
return "call current_timestamp";
}
/**
* The name of the database-specific SQL function for retrieving the
* current timestamp.
*
* @return The function name.
*/
public String getCurrentTimestampSQLFunctionName() {
// the standard SQL function name is current_timestamp...
return "current_timestamp";
}
/**
* For HSQLDB 2.0, this is a copy of the base class implementation.
* For HSQLDB 1.8, only READ_UNCOMMITTED is supported.
*
* @param lockable The persister for the entity to be locked.
* @param lockMode The type of lock to be acquired.
*
* @return The appropriate locking strategy.
*
* @since 3.2
*/
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
if ( hsqldbVersion < 20 ) {
return new ReadUncommittedLockingStrategy( lockable, lockMode );
}
else {
return new SelectLockingStrategy( lockable, lockMode );
}
}
public static class ReadUncommittedLockingStrategy extends SelectLockingStrategy {
public ReadUncommittedLockingStrategy(Lockable lockable, LockMode lockMode) {
super( lockable, lockMode );
}
public void lock(Serializable id, Object version, Object object, SessionImplementor session)
throws StaleObjectStateException, JDBCException {
if ( getLockMode().greaterThan( LockMode.READ ) ) {
log.warn( "HSQLDB supports only READ_UNCOMMITTED isolation" );
}
super.lock( id, version, object, session );
}
}
// Overridden informational metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
public boolean supportsEmptyInList() {
return false;
}
/**
* todo - needs usage clarification
*
* If the SELECT statement is always part of a UNION, then the type of
* parameter is resolved by v. 2.0, but not v. 1.8 (assuming the other
* SELECT in the UNION has a column reference in the same position and
* can be type-resolved).
*
* On the other hand if the SELECT statement is isolated, all versions of
* HSQLDB require casting for "select ? from .." to work.
*
* @return True if select clause parameter must be cast()ed
*
* @since 3.2
*/
public boolean requiresCastingOfParametersInSelectClause() {
return true;
}
/**
* For the underlying database, is READ_COMMITTED isolation implemented by
* forcing readers to wait for write locks to be released?
*
* @return True if writers block readers to achieve READ_COMMITTED; false otherwise.
*/
public boolean doesReadCommittedCauseWritersToBlockReaders() {
return hsqldbVersion >= 20;
}
/**
* For the underlying database, is REPEATABLE_READ isolation implemented by
* forcing writers to wait for read locks to be released?
*
* @return True if readers block writers to achieve REPEATABLE_READ; false otherwise.
*/
public boolean doesRepeatableReadCauseReadersToBlockWriters() {
return hsqldbVersion >= 20;
}
public boolean supportsLobValueChangePropogation() {
return false;
}
public String toBooleanValueString(boolean bool) {
return String.valueOf( bool );
}
public boolean supportsTupleDistinctCounts() {
return false;
}
}
hsqldb2.2-2.2.9.orig/hsqldb/integration/readme.txt 0000644 0001750 0001750 00000000367 12007547332 020435 0 ustar rene rene $Id: readme.txt 3900 2010-11-17 03:59:50Z unsaved $
Each subdirectory of this directory is a home directory to a sample integration
application.
See the "readme.txt" file in each subdirectory to see the purpose of that
particular sample.
hsqldb2.2-2.2.9.orig/hsqldb/integration/hibernate/ 0000755 0001750 0001750 00000000000 12007557304 020372 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/integration/hibernate/src/ 0000755 0001750 0001750 00000000000 12007557304 021161 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/integration/hibernate/src/org/ 0000755 0001750 0001750 00000000000 12007557304 021750 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/integration/hibernate/src/org/hibernate/ 0000755 0001750 0001750 00000000000 12007557304 023711 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/integration/hibernate/src/org/hibernate/dialect/ 0000755 0001750 0001750 00000000000 12007557304 025316 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/integration/hibernate/src/org/hibernate/dialect/HSQLDialect.java 0000644 0001750 0001750 00000076120 12007547332 030224 0 ustar rene rene /*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.dialect;
import java.sql.SQLException;
import java.sql.Types;
import java.io.Serializable;
import org.hibernate.LockMode;
import org.hibernate.StaleObjectStateException;
import org.hibernate.JDBCException;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.persister.entity.Lockable;
import org.hibernate.cfg.Environment;
import org.hibernate.dialect.function.AvgWithArgumentCastFunction;
import org.hibernate.dialect.function.SQLFunctionTemplate;
import org.hibernate.dialect.function.NoArgSQLFunction;
import org.hibernate.dialect.function.StandardSQLFunction;
import org.hibernate.dialect.function.VarArgsSQLFunction;
import org.hibernate.dialect.lock.*;
import org.hibernate.exception.JDBCExceptionHelper;
import org.hibernate.exception.TemplatedViolatedConstraintNameExtracter;
import org.hibernate.exception.ViolatedConstraintNameExtracter;
import org.hibernate.type.StandardBasicTypes;
import org.hibernate.util.ReflectHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* An SQL dialect compatible with HSQLDB (HyperSQL).
*
* Note this version supports HSQLDB version 1.8 and higher, only.
*
* Enhancements to version 3.5.0 GA to provide basic support for both HSQLDB 1.8.x and 2.x
* Does not works with Hibernate 3.2 - 3.4 without alteration.
*
* @author Christoph Sturm
* @author Phillip Baird
* @author Fred Toussi
*/
public class HSQLDialect extends Dialect {
private static final Logger log = LoggerFactory.getLogger( HSQLDialect.class );
/**
* version is 18 for 1.8 or 20 for 2.0
*/
private int hsqldbVersion = 18;
public HSQLDialect() {
super();
try {
Class props = ReflectHelper.classForName( "org.hsqldb.persist.HsqlDatabaseProperties" );
String versionString = (String) props.getDeclaredField( "THIS_VERSION" ).get( null );
hsqldbVersion = Integer.parseInt( versionString.substring( 0, 1 ) ) * 10;
hsqldbVersion += Integer.parseInt( versionString.substring( 2, 3 ) );
}
catch ( Throwable e ) {
// must be a very old version
}
registerColumnType( Types.BIGINT, "bigint" );
registerColumnType( Types.BINARY, "binary($l)" );
registerColumnType( Types.BIT, "bit" );
registerColumnType( Types.BOOLEAN, "boolean" );
registerColumnType( Types.CHAR, "char($l)" );
registerColumnType( Types.DATE, "date" );
registerColumnType( Types.DECIMAL, "decimal($p,$s)" );
registerColumnType( Types.DOUBLE, "double" );
registerColumnType( Types.FLOAT, "float" );
registerColumnType( Types.INTEGER, "integer" );
registerColumnType( Types.LONGVARBINARY, "longvarbinary" );
registerColumnType( Types.LONGVARCHAR, "longvarchar" );
registerColumnType( Types.SMALLINT, "smallint" );
registerColumnType( Types.TINYINT, "tinyint" );
registerColumnType( Types.TIME, "time" );
registerColumnType( Types.TIMESTAMP, "timestamp" );
registerColumnType( Types.VARCHAR, "varchar($l)" );
registerColumnType( Types.VARBINARY, "varbinary($l)" );
if ( hsqldbVersion < 20 ) {
registerColumnType( Types.NUMERIC, "numeric" );
}
else {
registerColumnType( Types.NUMERIC, "numeric($p,$s)" );
}
//HSQL has no Blob/Clob support .... but just put these here for now!
if ( hsqldbVersion < 20 ) {
registerColumnType( Types.BLOB, "longvarbinary" );
registerColumnType( Types.CLOB, "longvarchar" );
}
else {
registerColumnType( Types.BLOB, "blob" );
registerColumnType( Types.CLOB, "clob" );
}
// aggregate functions
registerFunction( "avg", new AvgWithArgumentCastFunction( "double" ) );
// string functions
registerFunction( "ascii", new StandardSQLFunction( "ascii", StandardBasicTypes.INTEGER ) );
registerFunction( "char", new StandardSQLFunction( "char", StandardBasicTypes.CHARACTER ) );
registerFunction( "lower", new StandardSQLFunction( "lower" ) );
registerFunction( "upper", new StandardSQLFunction( "upper" ) );
registerFunction( "lcase", new StandardSQLFunction( "lcase" ) );
registerFunction( "ucase", new StandardSQLFunction( "ucase" ) );
registerFunction( "soundex", new StandardSQLFunction( "soundex", StandardBasicTypes.STRING ) );
registerFunction( "ltrim", new StandardSQLFunction( "ltrim" ) );
registerFunction( "rtrim", new StandardSQLFunction( "rtrim" ) );
registerFunction( "reverse", new StandardSQLFunction( "reverse" ) );
registerFunction( "space", new StandardSQLFunction( "space", StandardBasicTypes.STRING ) );
registerFunction( "str", new SQLFunctionTemplate( StandardBasicTypes.STRING, "cast(?1 as varchar(256))" ) );
registerFunction( "rawtohex", new StandardSQLFunction( "rawtohex" ) );
registerFunction( "hextoraw", new StandardSQLFunction( "hextoraw" ) );
// system functions
registerFunction( "user", new NoArgSQLFunction( "user", StandardBasicTypes.STRING ) );
registerFunction( "database", new NoArgSQLFunction( "database", StandardBasicTypes.STRING ) );
// datetime functions
if ( hsqldbVersion < 20 ) {
registerFunction( "sysdate", new NoArgSQLFunction( "sysdate", StandardBasicTypes.DATE, false ) );
} else {
registerFunction( "sysdate", new NoArgSQLFunction( "sysdate", StandardBasicTypes.TIMESTAMP, false ) );
}
registerFunction( "current_date", new NoArgSQLFunction( "current_date", StandardBasicTypes.DATE, false ) );
registerFunction( "curdate", new NoArgSQLFunction( "curdate", StandardBasicTypes.DATE ) );
registerFunction(
"current_timestamp", new NoArgSQLFunction( "current_timestamp", StandardBasicTypes.TIMESTAMP, false )
);
registerFunction( "now", new NoArgSQLFunction( "now", StandardBasicTypes.TIMESTAMP ) );
registerFunction( "current_time", new NoArgSQLFunction( "current_time", StandardBasicTypes.TIME, false ) );
registerFunction( "curtime", new NoArgSQLFunction( "curtime", StandardBasicTypes.TIME ) );
registerFunction( "day", new StandardSQLFunction( "day", StandardBasicTypes.INTEGER ) );
registerFunction( "dayofweek", new StandardSQLFunction( "dayofweek", StandardBasicTypes.INTEGER ) );
registerFunction( "dayofyear", new StandardSQLFunction( "dayofyear", StandardBasicTypes.INTEGER ) );
registerFunction( "dayofmonth", new StandardSQLFunction( "dayofmonth", StandardBasicTypes.INTEGER ) );
registerFunction( "month", new StandardSQLFunction( "month", StandardBasicTypes.INTEGER ) );
registerFunction( "year", new StandardSQLFunction( "year", StandardBasicTypes.INTEGER ) );
registerFunction( "week", new StandardSQLFunction( "week", StandardBasicTypes.INTEGER ) );
registerFunction( "quarter", new StandardSQLFunction( "quarter", StandardBasicTypes.INTEGER ) );
registerFunction( "hour", new StandardSQLFunction( "hour", StandardBasicTypes.INTEGER ) );
registerFunction( "minute", new StandardSQLFunction( "minute", StandardBasicTypes.INTEGER ) );
registerFunction( "second", new SQLFunctionTemplate( StandardBasicTypes.INTEGER, "cast(second(?1) as int)" ) );
registerFunction( "dayname", new StandardSQLFunction( "dayname", StandardBasicTypes.STRING ) );
registerFunction( "monthname", new StandardSQLFunction( "monthname", StandardBasicTypes.STRING ) );
// numeric functions
registerFunction( "abs", new StandardSQLFunction( "abs" ) );
registerFunction( "sign", new StandardSQLFunction( "sign", StandardBasicTypes.INTEGER ) );
registerFunction( "acos", new StandardSQLFunction( "acos", StandardBasicTypes.DOUBLE ) );
registerFunction( "asin", new StandardSQLFunction( "asin", StandardBasicTypes.DOUBLE ) );
registerFunction( "atan", new StandardSQLFunction( "atan", StandardBasicTypes.DOUBLE ) );
registerFunction( "cos", new StandardSQLFunction( "cos", StandardBasicTypes.DOUBLE ) );
registerFunction( "cot", new StandardSQLFunction( "cot", StandardBasicTypes.DOUBLE ) );
registerFunction( "exp", new StandardSQLFunction( "exp", StandardBasicTypes.DOUBLE ) );
registerFunction( "log", new StandardSQLFunction( "log", StandardBasicTypes.DOUBLE ) );
registerFunction( "log10", new StandardSQLFunction( "log10", StandardBasicTypes.DOUBLE ) );
registerFunction( "sin", new StandardSQLFunction( "sin", StandardBasicTypes.DOUBLE ) );
registerFunction( "sqrt", new StandardSQLFunction( "sqrt", StandardBasicTypes.DOUBLE ) );
registerFunction( "tan", new StandardSQLFunction( "tan", StandardBasicTypes.DOUBLE ) );
registerFunction( "pi", new NoArgSQLFunction( "pi", StandardBasicTypes.DOUBLE ) );
registerFunction( "rand", new StandardSQLFunction( "rand", StandardBasicTypes.FLOAT ) );
registerFunction( "radians", new StandardSQLFunction( "radians", StandardBasicTypes.DOUBLE ) );
registerFunction( "degrees", new StandardSQLFunction( "degrees", StandardBasicTypes.DOUBLE ) );
registerFunction( "round", new StandardSQLFunction( "round" ) );
registerFunction( "roundmagic", new StandardSQLFunction( "roundmagic" ) );
registerFunction( "truncate", new StandardSQLFunction( "truncate" ) );
registerFunction( "ceiling", new StandardSQLFunction( "ceiling" ) );
registerFunction( "floor", new StandardSQLFunction( "floor" ) );
// special functions
// from v. 2.2.0 ROWNUM() is supported in all modes as the equivalent of Oracle ROWNUM
if ( hsqldbVersion > 21 ) {
registerFunction("rownum",
new NoArgSQLFunction("rownum", StandardBasicTypes.INTEGER));
}
// function templates
registerFunction( "concat", new VarArgsSQLFunction( StandardBasicTypes.STRING, "(", "||", ")" ) );
getDefaultProperties().setProperty( Environment.STATEMENT_BATCH_SIZE, DEFAULT_BATCH_SIZE );
}
public String getAddColumnString() {
return "add column";
}
public boolean supportsIdentityColumns() {
return true;
}
public String getIdentityColumnString() {
return "generated by default as identity (start with 1)"; //not null is implicit
}
public String getIdentitySelectString() {
return "call identity()";
}
public String getIdentityInsertString() {
return hsqldbVersion < 20 ? "null" : "default";
}
public boolean supportsLockTimeouts() {
return false;
}
public String getForUpdateString() {
return "";
}
public boolean supportsUnique() {
return false;
}
public boolean supportsLimit() {
return true;
}
public String getLimitString(String sql, boolean hasOffset) {
if ( hsqldbVersion < 20 ) {
return new StringBuffer( sql.length() + 10 )
.append( sql )
.insert(
sql.toLowerCase().indexOf( "select" ) + 6,
hasOffset ? " limit ? ?" : " top ?"
)
.toString();
}
else {
return new StringBuffer( sql.length() + 20 )
.append( sql )
.append( hasOffset ? " offset ? limit ?" : " limit ?" )
.toString();
}
}
public boolean bindLimitParametersFirst() {
return hsqldbVersion < 20;
}
public boolean supportsIfExistsAfterTableName() {
return true;
}
public boolean supportsColumnCheck() {
return hsqldbVersion >= 20;
}
public boolean supportsSequences() {
return true;
}
public boolean supportsPooledSequences() {
return true;
}
protected String getCreateSequenceString(String sequenceName) {
return "create sequence " + sequenceName;
}
protected String getDropSequenceString(String sequenceName) {
return "drop sequence " + sequenceName;
}
public String getSelectSequenceNextValString(String sequenceName) {
return "next value for " + sequenceName;
}
public String getSequenceNextValString(String sequenceName) {
return "call next value for " + sequenceName;
}
public String getQuerySequencesString() {
// this assumes schema support, which is present in 1.8.0 and later...
return "select sequence_name from information_schema.system_sequences";
}
public ViolatedConstraintNameExtracter getViolatedConstraintNameExtracter() {
return hsqldbVersion < 20 ? EXTRACTER_18 : EXTRACTER_20;
}
private static ViolatedConstraintNameExtracter EXTRACTER_18 = new TemplatedViolatedConstraintNameExtracter() {
/**
* Extract the name of the violated constraint from the given SQLException.
*
* @param sqle The exception that was the result of the constraint violation.
* @return The extracted constraint name.
*/
public String extractConstraintName(SQLException sqle) {
String constraintName = null;
int errorCode = JDBCExceptionHelper.extractErrorCode( sqle );
if ( errorCode == -8 ) {
constraintName = extractUsingTemplate(
"Integrity constraint violation ", " table:", sqle.getMessage()
);
}
else if ( errorCode == -9 ) {
constraintName = extractUsingTemplate(
"Violation of unique index: ", " in statement [", sqle.getMessage()
);
}
else if ( errorCode == -104 ) {
constraintName = extractUsingTemplate(
"Unique constraint violation: ", " in statement [", sqle.getMessage()
);
}
else if ( errorCode == -177 ) {
constraintName = extractUsingTemplate(
"Integrity constraint violation - no parent ", " table:",
sqle.getMessage()
);
}
return constraintName;
}
};
/**
* HSQLDB 2.0 messages have changed
* messages may be localized - therefore use the common, non-locale element " table: "
*/
private static ViolatedConstraintNameExtracter EXTRACTER_20 = new TemplatedViolatedConstraintNameExtracter() {
public String extractConstraintName(SQLException sqle) {
String constraintName = null;
int errorCode = JDBCExceptionHelper.extractErrorCode( sqle );
if ( errorCode == -8 ) {
constraintName = extractUsingTemplate(
"; ", " table: ", sqle.getMessage()
);
}
else if ( errorCode == -9 ) {
constraintName = extractUsingTemplate(
"; ", " table: ", sqle.getMessage()
);
}
else if ( errorCode == -104 ) {
constraintName = extractUsingTemplate(
"; ", " table: ", sqle.getMessage()
);
}
else if ( errorCode == -177 ) {
constraintName = extractUsingTemplate(
"; ", " table: ", sqle.getMessage()
);
}
return constraintName;
}
};
public String getSelectClauseNullString(int sqlType) {
String literal;
switch ( sqlType ) {
case Types.LONGVARCHAR:
case Types.VARCHAR:
case Types.CHAR:
literal = "cast(null as varchar(100))";
break;
case Types.LONGVARBINARY:
case Types.VARBINARY:
case Types.BINARY:
literal = "cast(null as varbinary(100))";
break;
case Types.CLOB:
literal = "cast(null as clob)";
break;
case Types.BLOB:
literal = "cast(null as blob)";
break;
case Types.DATE:
literal = "cast(null as date)";
break;
case Types.TIMESTAMP:
literal = "cast(null as timestamp)";
break;
case Types.BOOLEAN:
literal = "cast(null as boolean)";
break;
case Types.BIT:
literal = "cast(null as bit)";
break;
case Types.TIME:
literal = "cast(null as time)";
break;
default:
literal = "cast(null as int)";
}
return literal;
}
public boolean supportsUnionAll() {
return true;
}
// temporary table support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Hibernate uses this information for temporary tables that it uses for its own operations
// therefore the appropriate strategy is taken with different versions of HSQLDB
// All versions of HSQLDB support GLOBAL TEMPORARY tables where the table
// definition is shared by all users but data is private to the session
// HSQLDB 2.0 also supports session-based LOCAL TEMPORARY tables where
// the definition and data is private to the session and table declaration
// can happen in the middle of a transaction
/**
* Does this dialect support temporary tables?
*
* @return True if temp tables are supported; false otherwise.
*/
public boolean supportsTemporaryTables() {
return true;
}
/**
* With HSQLDB 2.0, the table name is qualified with MODULE to assist the drop
* statement (in-case there is a global name beginning with HT_)
*
* @param baseTableName The table name from which to base the temp table name.
*
* @return The generated temp table name.
*/
public String generateTemporaryTableName(String baseTableName) {
if ( hsqldbVersion < 20 ) {
return "HT_" + baseTableName;
}
else {
return "MODULE.HT_" + baseTableName;
}
}
/**
* Command used to create a temporary table.
*
* @return The command used to create a temporary table.
*/
public String getCreateTemporaryTableString() {
if ( hsqldbVersion < 20 ) {
return "create global temporary table";
}
else {
return "declare local temporary table";
}
}
/**
* No fragment is needed if data is not needed beyond commit, otherwise
* should add "on commit preserve rows"
*
* @return Any required postfix.
*/
public String getCreateTemporaryTablePostfix() {
return "";
}
/**
* Command used to drop a temporary table.
*
* @return The command used to drop a temporary table.
*/
public String getDropTemporaryTableString() {
return "drop table";
}
/**
* Different behavior for GLOBAL TEMPORARY (1.8) and LOCAL TEMPORARY (2.0)
*
* Possible return values and their meanings:
* - {@link Boolean#TRUE} - Unequivocally, perform the temporary table DDL
* in isolation.
* - {@link Boolean#FALSE} - Unequivocally, do not perform the
* temporary table DDL in isolation.
* - null - defer to the JDBC driver response in regards to
* {@link java.sql.DatabaseMetaData#dataDefinitionCausesTransactionCommit()}
*
*
* @return see the result matrix above.
*/
public Boolean performTemporaryTableDDLInIsolation() {
if ( hsqldbVersion < 20 ) {
return Boolean.TRUE;
}
else {
return Boolean.FALSE;
}
}
/**
* Do we need to drop the temporary table after use?
*
* todo - clarify usage by Hibernate
*
* Version 1.8 GLOBAL TEMPORARY table definitions persist beyond the end
* of the session (by default, data is cleared at commit).
*
* Version 2.x LOCAL TEMPORARY table definitions do not persist beyond
* the end of the session (by default, data is cleared at commit).
*
* @return True if the table should be dropped.
*/
public boolean dropTemporaryTableAfterUse() {
if ( hsqldbVersion < 20 ) {
return Boolean.TRUE;
}
else {
return Boolean.FALSE;
}
}
// current timestamp support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/**
* HSQLDB 1.8.x requires CALL CURRENT_TIMESTAMP but this should not
* be treated as a callable statement. It is equivalent to
* "select current_timestamp from dual" in some databases.
* HSQLDB 2.0 also supports VALUES CURRENT_TIMESTAMP
*
* @return True if the current timestamp can be retrieved; false otherwise.
*/
public boolean supportsCurrentTimestampSelection() {
return true;
}
/**
* Should the value returned by {@link #getCurrentTimestampSelectString}
* be treated as callable. Typically this indicates that JDBC escape
* syntax is being used...
*
* CALL CURRENT_TIMESTAMP is used but this should not
* be treated as a callable statement.
*
* @return True if the {@link #getCurrentTimestampSelectString} return
* is callable; false otherwise.
*/
public boolean isCurrentTimestampSelectStringCallable() {
return false;
}
/**
* Retrieve the command used to retrieve the current timestamp from the
* database.
*
* @return The command.
*/
public String getCurrentTimestampSelectString() {
return "call current_timestamp";
}
/**
* The name of the database-specific SQL function for retrieving the
* current timestamp.
*
* @return The function name.
*/
public String getCurrentTimestampSQLFunctionName() {
// the standard SQL function name is current_timestamp...
return "current_timestamp";
}
/**
* For HSQLDB 2.0, this is a copy of the base class implementation.
* For HSQLDB 1.8, only READ_UNCOMMITTED is supported.
*
* @param lockable The persister for the entity to be locked.
* @param lockMode The type of lock to be acquired.
*
* @return The appropriate locking strategy.
*
* @since 3.2
*/
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) {
if ( lockMode == LockMode.PESSIMISTIC_FORCE_INCREMENT ) {
return new PessimisticForceIncrementLockingStrategy( lockable, lockMode );
}
else if ( lockMode == LockMode.PESSIMISTIC_WRITE ) {
return new PessimisticWriteSelectLockingStrategy( lockable, lockMode );
}
else if ( lockMode == LockMode.PESSIMISTIC_READ ) {
return new PessimisticReadSelectLockingStrategy( lockable, lockMode );
}
else if ( lockMode == LockMode.OPTIMISTIC ) {
return new OptimisticLockingStrategy( lockable, lockMode );
}
else if ( lockMode == LockMode.OPTIMISTIC_FORCE_INCREMENT ) {
return new OptimisticForceIncrementLockingStrategy( lockable, lockMode );
}
if ( hsqldbVersion < 20 ) {
return new ReadUncommittedLockingStrategy( lockable, lockMode );
}
else {
return new SelectLockingStrategy( lockable, lockMode );
}
}
public static class ReadUncommittedLockingStrategy extends SelectLockingStrategy {
public ReadUncommittedLockingStrategy(Lockable lockable, LockMode lockMode) {
super( lockable, lockMode );
}
public void lock(Serializable id, Object version, Object object, int timeout, SessionImplementor session)
throws StaleObjectStateException, JDBCException {
if ( getLockMode().greaterThan( LockMode.READ ) ) {
log.warn( "HSQLDB supports only READ_UNCOMMITTED isolation" );
}
super.lock( id, version, object, timeout, session );
}
}
public boolean supportsCommentOn() {
return hsqldbVersion >= 20;
}
// Overridden informational metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@Override
public boolean supportsEmptyInList() {
return false;
}
/**
* todo - needs usage clarification
*
* If the SELECT statement is always part of a UNION, then the type of
* parameter is resolved by v. 2.0, but not v. 1.8 (assuming the other
* SELECT in the UNION has a column reference in the same position and
* can be type-resolved).
*
* On the other hand if the SELECT statement is isolated, all versions of
* HSQLDB require casting for "select ? from .." to work.
*
* @return True if select clause parameter must be cast()ed
*
* @since 3.2
*/
public boolean requiresCastingOfParametersInSelectClause() {
return true;
}
/**
* For the underlying database, is READ_COMMITTED isolation implemented by
* forcing readers to wait for write locks to be released?
*
* @return True if writers block readers to achieve READ_COMMITTED; false otherwise.
*/
public boolean doesReadCommittedCauseWritersToBlockReaders() {
return hsqldbVersion >= 20;
}
/**
* For the underlying database, is REPEATABLE_READ isolation implemented by
* forcing writers to wait for read locks to be released?
*
* @return True if readers block writers to achieve REPEATABLE_READ; false otherwise.
*/
public boolean doesRepeatableReadCauseReadersToBlockWriters() {
return hsqldbVersion >= 20;
}
public boolean supportsLobValueChangePropogation() {
return false;
}
public String toBooleanValueString(boolean bool) {
return String.valueOf( bool );
}
public boolean supportsTupleDistinctCounts() {
return false;
}
}
hsqldb2.2-2.2.9.orig/hsqldb/readme.txt 0000644 0001750 0001750 00000000471 12007553066 016107 0 ustar rene rene Readme File
2012/08/05-22:23:15
This package contains HyperSQL v. 2.2.9
HyperSQL is a relational database engine and a set of tools written in Java.
HyperSQL is also known as HSQLDB.
The file "index.html" explains the contents of this distribution and has
links to documentation and support resources.
hsqldb2.2-2.2.9.orig/hsqldb/lib/ 0000755 0001750 0001750 00000000000 12121705166 014652 5 ustar rene rene hsqldb2.2-2.2.9.orig/hsqldb/lib/sqltool.jar 0000644 0001750 0001750 00000440010 12007570420 017040 0 ustar rene rene PK
9A¦ù ë META-INF/MANIFEST.MF…ÁKÃ0ÅïüßQ ]:{Û:Хū¤É7›‘&]’ ûïM§·<æýÞûÞ#•°zƒ!²7ôA;[ÀŒg”,ìe1Ù!$-Á9Ï))=ŠˆŠ-£ÿŽgï³9k³{¸©÷*-½‡±°¶’ßRR(õFKÓIÖèh°€§úõyµ¼„§ÞœçüaJr¾€&-ó°ÂO4nè1Í{ôn?P²îƒ£pÖVïLãœÒè„&®ËÚ þ¿·Ú²Òˆ
pþƒwagTËe¯Œ¶È¤ï-ìEÄ®€o;–òðGa«Zy!©¶O×Çç/ Nì,y%C %_PK
0Aî~=÷; ^ META-INF/hsqldb_lic.txt•SAnÛ0¼È=5…š¤9¶'Z¢e²¨’T‰nX¢AÒ òû.)N[¤@a fÈÝÙ™ÙñõgÈíáÅ™Ÿ>õ—p{sóõËíÍ×ÛÔ£†•üQA¡ŸôÞF=(=.>Àg û=¤>N{ížôpңЃñÁ™‡c0v‚nàè5˜ ¼=º^§›3uîvÖ>ƒgÁºôm!ÁŒv0;Ów$ƒÎi8h7šô gŸÌ€‡ðØü£h¿·Ïfú ½›|juøö5v÷Ê©·Ö}@A¡C®´{°OñéÕ¤ÉÓëߌOx{D‹ ogNÄpd¿į̈Ý{ùhÎG^‰ ÌáˆäþÁ%¡E>ÿËNÛãv“Ï
»®q_Œ]ÐÎt{ö<-+µ¾‘p–Vk“:cÅÔ:r
ïÆ uœKÓBL˜½E3ºui¼ÀƒŽ9BEô4àŽ‘AZ£
f¯0òÅ<ÂΛòvžcNÐ}Ì6š˜<“5Íóþ7EjÅ$H¾T"(à¹üŽ´€Å)ä¼Ù
V®¬xUP!ÔÞÖJ°E«8^|$;?ο|$õè}#¨”À°uS1Ä ‚ÔŠQ™«óª-X]f€ Ps[3…eŠgqpBû»øÖTä+ü—,XÅÔ6Í\2UÇyKH !B±¼ˆ€¦
—3\”X0™W„iq…,p2Ð;Z++RU§EâMÅ›u¼.o›,Ý‹+.Ê9•8å7ù“EEgh@ÁÍUTz>åh,Ò®2
ͽ§¨“ˆmv•ôG‹…X Y“eú·c W—·‚&Þh“lR1Õ*
%çEÚ…¤âŽåT~O
—ÉÐVÒ')’ º)¿Çó¢•,ùÊjE…hÅx}‰QØ GÈ•`k\x1»R'é¸=.¶8z’v”ÁfEñ^DÏ“s$Z"ÑÁ\½-Ùh¨JpgÍPÓ²b%s+xDÚ0I/q¥LÆ6ÞœÛ&ù1¼Èn>2™_ƒž¥¥[)îX”pjÀ¨HvŠU²0_V~2×âçPK
0A>Z¶íä ±
META-INF/hypersonic_lic.txtíUMoÛ8½èôÔÚ|=´=Ém%•¤’ú([tCT
INà¿”c§»I€ÝÛbL‘œ7óÞg.>½GŸhj;z°Ý/ªô½®íVW´ÚÓp§i.¿'»nšuv·ýꬼed·ûÎü¼èãúŒ®//¯þ¸¾¼ºH½hìíº&o×S§{ÝÝëêü*teú¡3«Ý`lKe[Ñ®×dZêí®[k¿³2mÙíic»¦èÁwäXàßîÓØÊl̺t •¦î3 ·í콩°îÊÁ3ÝØº¶¦ýIkÛVÆõÞ¨ÑÃ×BëÉncZÛ
wwý BC‰Xh¹²÷îèQ¤Öfœ™ÞãÕ@s O}¶Õ_‚Ëu]šFw/iÔ;qž(òhV;÷J,ÍÅóOc¡ÇÊ®w.»^g«äÂâ´£¦tgʺ?iî“åMŸP8QKµñ–îF[6ÚÅôr-‚ÇéªOˆFmÁcD·]0ö´Ò®ŽÀÈ’n+ìjW2«±ƒ¦Q+d…xQ´ÁÁ)S½Ý®%FýV¯]}ÁиÊë\eµcõýoŒÔœK’ÙT݆‚Ö¹ÈnxÌbš,qÈ(Êò¥à³¹¢y–ÄLH
Ó»©|R¨B ËãëÁa˜.‰ýÈ“’2A|‘'€ð ÂTq&âi”1Og„ÒLQÂ\ášÊçØ£ýÝ”²)-˜ˆæø'<ájé}N¹J¿)†”‡Bñ¨HBAy!òLŽpŽbÌe”„|ÁâsDÏÄnXªHÎÃ$9$;I–/ÜöLdEøýxrž‰ÙX•ðò›†øÃIÂÆ @Ì‹”czZEa'ÉœEÆ~0ðÅ28àJö½ÀE\ 8\„3Ðþøºb©‹
Á|ÜI©¸*£Y–Å>’‰1ùÍ$™ô‚’ð¤B ` ¦üæÖ“Br¯+O¢ÈÏÒ3”Â-4B¬!L]ÂãQ•ÔSGö2±tÀNŸ£€nçûÂiî•$
Fêé5ø„ ÊÃ8SÊf Ÿ±4bîFæn¹dgH)—î]߆ð[xú®xݸäÒ#>zà“N|Ja|Ã…ƒJEòCYy £ù!Ç's|:ÇÑdѵÐàêzÿÌ”ÚãÕõ¶Åct¥õꌺúòå3fÔååaF=czþ6¢ÞFÔ¿QÏTÓÛ€úÏ
(Çx¾ÌA3Ky4¦Ò¨·±ôÿKèBÇ—†Ü£?øG}oë:ºÛñYûþÔ”hº˜SMÙîÑ*ƒ³C¯ñp+}W֛׈÷~ñþûý PK
8AAfþV ` + org/hsqldb/cmdline/SqlFile$BadSpecial.class}’ÛnÓ@†ÿµ“:1)M(iÊÁ”rh1â¶åPÒ"µ¢â"!½@ÚØKââکס9௹íó g·âÈzëµCªº‚И;¯öø ‚“wÔêgMyÚý(½ZëäP@1‡<æJ“°Í?oÝŽ¢0b¸³7”±å¨Ú¢¡[¸Û‡ c/î[A¬Cß·…”¼'·¡¦C9Œzv_ùn×v]J/ìÖ‘ÿØSU¬æ°†Û+ÿ¾T™dc0§ÜNˆ¨é«ÖJ†å)†ïuíÍÁ@®ª~û#ªît»H›3úuJާÝáĉso’™aÁÒ‹„û·k¤T<”I‡÷aÑw2é{i(ár %ë|¾¤úN{É@'h·N¶Fk¹Þ½‡v‚ùÆ7Ì~†þ¼!ýõÒûhžû‰Eh\Piz@ …^ª7VG˜ù?© Heè¿IA9–ư ¾ã#2'0Ro‘Ò?@›0ÒÐfÒ§Æ-2LZ³0pæ/PK
8AÙõð © ) org/hsqldb/cmdline/SqlFile$BadSubst.class}P±NA}‡pè)"ÄX˜Hhrj‹±5ÁÐ]¼~á6°fÙ“ÛÅøVþ„…1±ðlü+À¸ÒЈÅÌ{“y™73ï߯o ŽP_B+E8ð]¬¹¨|ÍSÁdÄS-uÕ=#Ð%¡ÜI”6L™ˆÉ)ÏñǯÏðãþ7#¡„^’ƒ‘žÈ¸Æ±ŠáD^ÉÛVw,”0'„ÃæÂÞ5»edj„&jØÞN'‰¹‡"J