Author: jeff.yuchang
Date: 2010-06-07 09:02:47 -0400 (Mon, 07 Jun 2010)
New Revision: 726
Removed:
branches/ODE/ODE-1.x-jpa/dao-hibernate/src/main/java/org/apache/ode/dao/hib/NativeHiLoGenerator.java
Modified:
branches/ODE/ODE-1.x-jpa/dao-hibernate-db/build.xml
branches/ODE/ODE-1.x-jpa/dao-hibernate-db/pom.xml
branches/ODE/ODE-1.x-jpa/dao-hibernate/pom.xml
branches/ODE/ODE-1.x-jpa/dao-hibernate/src/main/java/org/apache/ode/dao/hib/bpel/hobj/HObject.java
branches/ODE/ODE-1.x-jpa/scheduler-simple/src/main/java/org/apache/ode/scheduler/simple/JdbcDelegate.java
Log:
* merge the fix for Postgres from 2.1.x branch.
* fix the native hibernate impl in this jpa branch.
Modified: branches/ODE/ODE-1.x-jpa/dao-hibernate/pom.xml
===================================================================
--- branches/ODE/ODE-1.x-jpa/dao-hibernate/pom.xml 2010-06-07 08:58:12 UTC (rev 725)
+++ branches/ODE/ODE-1.x-jpa/dao-hibernate/pom.xml 2010-06-07 13:02:47 UTC (rev 726)
@@ -107,11 +107,11 @@
<configuration>
<source>
import java.io.File
- def process_instance_hbm_file = new
File('${project.build.outputDirectory}',
'org/apache/ode/dao/hib/bpel/hobj/HProcessInstance.hbm.xml')
+ def process_instance_hbm_file = new File(project.build.outputDirectory,
'org/apache/ode/dao/hib/bpel/hobj/HProcessInstance.hbm.xml')
def contents = process_instance_hbm_file.text
if (!contents.contains('not-found="ignore"')) {
- process_instance_hbm_file.text =
contents.replace('class="org.apache.ode.daohib.bpel.hobj.HProcess"',
- 'not-found="ignore"
class="org.apache.ode.daohib.bpel.hobj.HProcess"')
+ process_instance_hbm_file.text =
contents.replace('class="org.apache.ode.dao.hib.bpel.hobj.HProcess"',
+ 'not-found="ignore"
class="org.apache.ode.dao.hib.bpel.hobj.HProcess"')
}
</source>
</configuration>
Deleted:
branches/ODE/ODE-1.x-jpa/dao-hibernate/src/main/java/org/apache/ode/dao/hib/NativeHiLoGenerator.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/dao-hibernate/src/main/java/org/apache/ode/dao/hib/NativeHiLoGenerator.java 2010-06-07
08:58:12 UTC (rev 725)
+++
branches/ODE/ODE-1.x-jpa/dao-hibernate/src/main/java/org/apache/ode/dao/hib/NativeHiLoGenerator.java 2010-06-07
13:02:47 UTC (rev 726)
@@ -1,94 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.ode.dao.hib;
-
-import java.io.Serializable;
-import java.util.Properties;
-
-import org.hibernate.HibernateException;
-import org.hibernate.MappingException;
-import org.hibernate.dialect.Dialect;
-import org.hibernate.engine.SessionImplementor;
-import org.hibernate.id.Configurable;
-import org.hibernate.id.IdentifierGenerator;
-import org.hibernate.id.PersistentIdentifierGenerator;
-import org.hibernate.id.SequenceHiLoGenerator;
-import org.hibernate.id.TableHiLoGenerator;
-import org.hibernate.type.Type;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-public class NativeHiLoGenerator implements IdentifierGenerator,
PersistentIdentifierGenerator, Configurable {
- private static final Log __log = LogFactory.getLog(NativeHiLoGenerator.class);
- private IdentifierGenerator _proxy;
-
- public NativeHiLoGenerator() {
- super();
- }
-
- public Serializable generate(SessionImplementor session, Object object) throws
HibernateException {
- return _proxy.generate(session, object);
- }
-
- public Object generatorKey() {
- if (_proxy instanceof PersistentIdentifierGenerator)
- return ((PersistentIdentifierGenerator) _proxy).generatorKey();
- else
- return this;
- }
-
- public String[] sqlCreateStrings(Dialect dialect) throws HibernateException {
- if (_proxy instanceof PersistentIdentifierGenerator)
- return ((PersistentIdentifierGenerator) _proxy).sqlCreateStrings(dialect);
- else
- return new String[] {};
- }
-
- public String[] sqlDropStrings(Dialect dialect) throws HibernateException {
- if (_proxy instanceof PersistentIdentifierGenerator)
- return ((PersistentIdentifierGenerator) _proxy).sqlDropStrings(dialect);
- else
- return null;
- }
-
- public void configure(Type type, Properties params, Dialect dialect) throws
MappingException {
- Class generatorClass = null;
- if (dialect.supportsSequences()) {
- __log.debug("Using SequenceHiLoGenerator");
- generatorClass = SequenceHiLoGenerator.class;
- } else {
- generatorClass = TableHiLoGenerator.class;
- __log.debug("Using native dialect generator " + generatorClass);
- }
-
- IdentifierGenerator g = null;
- try {
- g = (IdentifierGenerator) generatorClass.newInstance();
- } catch (Exception e) {
- throw new MappingException("", e);
- }
-
- if (g instanceof Configurable)
- ((Configurable) g).configure(type, params, dialect);
-
- this._proxy = g;
- }
-}
Modified:
branches/ODE/ODE-1.x-jpa/dao-hibernate/src/main/java/org/apache/ode/dao/hib/bpel/hobj/HObject.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/dao-hibernate/src/main/java/org/apache/ode/dao/hib/bpel/hobj/HObject.java 2010-06-07
08:58:12 UTC (rev 725)
+++
branches/ODE/ODE-1.x-jpa/dao-hibernate/src/main/java/org/apache/ode/dao/hib/bpel/hobj/HObject.java 2010-06-07
13:02:47 UTC (rev 726)
@@ -54,9 +54,7 @@
/**
* Auto-generated primary key.
*
- * @hibernate.id
generator-class="org.apache.ode.dao.hib.NativeHiLoGenerator"
column="ID"
- * @hibernate.generator-param name="sequence"
value="hibernate_seqhilo"
- * @hibernate.generator-param name="max_lo" value="99"
+ * @hibernate.id generator-class="native" column="ID"
*/
public Long getId() {
return _id;
Modified: branches/ODE/ODE-1.x-jpa/dao-hibernate-db/build.xml
===================================================================
--- branches/ODE/ODE-1.x-jpa/dao-hibernate-db/build.xml 2010-06-07 08:58:12 UTC (rev 725)
+++ branches/ODE/ODE-1.x-jpa/dao-hibernate-db/build.xml 2010-06-07 13:02:47 UTC (rev 726)
@@ -22,7 +22,6 @@
<property name="db.scripts.dir" value="${basedir}/target" />
<property name="sql.dir" value="${basedir}/src/main/sql"/>
<property name="dao-hibernate.classes"
value="${basedir}/../dao-hibernate/target/classes" />
- <property name="bpel-store.classes"
value="${basedir}/../bpel-store/target/classes" />
<path id="classpath">
<pathelement path="${maven.runtime.classpath}"/>
@@ -88,9 +87,6 @@
<include name="**/*.hbm.xml"/>
<exclude name="**/HMessageExchangeProperty.hbm.xml"
/>
</fileset>
- <fileset dir="${bpel-store.classes}/">
- <include name="**/*.hbm.xml"/>
- </fileset>
</schemaexport>
<concat destfile="${db.scripts.dir}/scripts/(a){db}-hib.sql">
<fileset file="${sql.dir}/common.sql"/>
Modified: branches/ODE/ODE-1.x-jpa/dao-hibernate-db/pom.xml
===================================================================
--- branches/ODE/ODE-1.x-jpa/dao-hibernate-db/pom.xml 2010-06-07 08:58:12 UTC (rev 725)
+++ branches/ODE/ODE-1.x-jpa/dao-hibernate-db/pom.xml 2010-06-07 13:02:47 UTC (rev 726)
@@ -55,10 +55,6 @@
<groupId>org.apache.derby</groupId>
<artifactId>derbytools</artifactId>
</dependency>
- <dependency>
- <groupId>org.jboss.soa.bpel</groupId>
- <artifactId>riftsaw-dao-hibernate</artifactId>
- </dependency>
</dependencies>
<build>
@@ -66,14 +62,13 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
- <version>1.0</version>
<executions>
<execution>
<id>schemagen</id>
<phase>generate-sources</phase>
<configuration>
<tasks>
- <property name="maven.runtime.classpath"
refid="maven.compile.classpath"/>
+ <property name="maven.runtime.classpath"
refid="maven.compile.classpath"/>
<ant antfile="build.xml" target="create-schema"
inheritRefs="true"/>
</tasks>
</configuration>
Modified:
branches/ODE/ODE-1.x-jpa/scheduler-simple/src/main/java/org/apache/ode/scheduler/simple/JdbcDelegate.java
===================================================================
---
branches/ODE/ODE-1.x-jpa/scheduler-simple/src/main/java/org/apache/ode/scheduler/simple/JdbcDelegate.java 2010-06-07
08:58:12 UTC (rev 725)
+++
branches/ODE/ODE-1.x-jpa/scheduler-simple/src/main/java/org/apache/ode/scheduler/simple/JdbcDelegate.java 2010-06-07
13:02:47 UTC (rev 726)
@@ -214,7 +214,7 @@
ps.setObject(i++, details.inMem, Types.INTEGER);
if (details.detailsExt == null || details.detailsExt.size() == 0) {
- ps.setObject(i++, null, Types.BLOB);
+ ps.setBytes(i++, null);
} else {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
try {