[jbpm-commits] JBoss JBPM SVN: r3787 - in jbpm3/trunk/modules/core: scripts and 8 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Feb 5 20:25:49 EST 2009


Author: alex.guizar at jboss.com
Date: 2009-02-05 20:25:49 -0500 (Thu, 05 Feb 2009)
New Revision: 3787

Added:
   jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/HibernateStringInstance.sybase.hbm.xml
   jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm2017/
   jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm2017/JBPM2017Test.java
   jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jbpm2017/
   jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jbpm2017/quote.txt
Removed:
   jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm2017/JBPM2017Test.java
   jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jbpm2017/quote.txt
Modified:
   jbpm3/trunk/modules/core/pom.xml
   jbpm3/trunk/modules/core/scripts/antrun-jbpm-config.xml
   jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/hibernate/TextType.java
   jbpm3/trunk/modules/core/src/main/resources/hibernate.cache.xml
   jbpm3/trunk/modules/core/src/main/resources/hibernate.mapping.default.xml
   jbpm3/trunk/modules/core/src/main/resources/hibernate.mapping.sybase.xml
   jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/HibernateStringInstance.hbm.xml
   jbpm3/trunk/modules/core/src/test/java/org/jbpm/context/exe/VariableQueryDbTest.java
Log:
JBPM-2017: merge r3786 from https://svn.jboss.org/repos/jbpm/jbpm3/branches/jbpm-3.2.5.SP

Modified: jbpm3/trunk/modules/core/pom.xml
===================================================================
--- jbpm3/trunk/modules/core/pom.xml	2009-02-06 00:35:08 UTC (rev 3786)
+++ jbpm3/trunk/modules/core/pom.xml	2009-02-06 01:25:49 UTC (rev 3787)
@@ -10,7 +10,7 @@
 <!-- ====================================================================== -->
 
 <!-- $Id$ -->
-  
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
@@ -47,10 +47,10 @@
       <groupId>dom4j</groupId>
       <artifactId>dom4j</artifactId>
       <exclusions>
-      	<exclusion>
-      	  <artifactId>xml-apis</artifactId>
-      	  <groupId>xml-apis</groupId>
-      	</exclusion>
+        <exclusion>
+          <artifactId>xml-apis</artifactId>
+          <groupId>xml-apis</groupId>
+        </exclusion>
       </exclusions>
     </dependency>
     <dependency>
@@ -112,7 +112,7 @@
       <artifactId>slf4j-log4j12</artifactId>
       <scope>test</scope>
     </dependency>
-    
+
     <!-- Remove this static dependency -->
     <dependency>
       <groupId>hsqldb</groupId>
@@ -332,7 +332,7 @@
           <plugin>
             <artifactId>maven-surefire-plugin</artifactId>
             <configuration>
-              <excludes>                
+              <excludes>
                 <!-- [JBPM-1810] Fix clean, drop, create schema with JbpmSchema  -->
                 <exclude>org/jbpm/db/JbpmSchemaDbTest.java</exclude>
               </excludes>

Modified: jbpm3/trunk/modules/core/scripts/antrun-jbpm-config.xml
===================================================================
--- jbpm3/trunk/modules/core/scripts/antrun-jbpm-config.xml	2009-02-06 00:35:08 UTC (rev 3786)
+++ jbpm3/trunk/modules/core/scripts/antrun-jbpm-config.xml	2009-02-06 01:25:49 UTC (rev 3787)
@@ -53,8 +53,12 @@
       <available property="@{database}.properties.available" file="${build.resources.directory}/hibernate.properties.@{database}.xml"/>
       <fail message="hibernate.properties.@{database}.xml not available" unless="@{database}.properties.available"/>
       
-      <echo message="Concat hibernate.cfg.@{database}.xml using hibernate.properties.@{database}.xml, hibernate.mapping.@{database}.xml" />
-
+      <condition property="hibernate.mapping.@{database}.xml" value="hibernate.mapping.@{database}.xml" else="hibernate.mapping.default.xml">
+        <available property="@{database}.mapping.available" file="${build.resources.directory}/hibernate.mapping.@{database}.xml"/>
+      </condition>
+      
+      <echo message="Concat hibernate.cfg.@{database}.xml using hibernate.properties.@{database}.xml, ${hibernate.mapping.@{database}.xml}" />
+      
       <!-- Concat hibernate.cfg.xml -->
       <concat destfile="${project.build.directory}/classes/hibernate.cfg.@{database}.xml">
         <header><![CDATA[<?xml version='1.0' encoding='utf-8'?>
@@ -67,8 +71,7 @@
 ]]></header>
         <fileset file="${build.resources.directory}/hibernate.properties.@{database}.xml" />
         <fileset file="${build.resources.directory}/hibernate.common.xml" />
-        <fileset file="${build.resources.directory}/hibernate.mapping.@{database}.xml" />
-      	<fileset file="${build.resources.directory}/hibernate.mapping.default.xml" />
+        <fileset file="${build.resources.directory}/${hibernate.mapping.@{database}.xml}" />
         <fileset file="${build.resources.directory}/hibernate.cache.xml" />
         <footer><![CDATA[  </session-factory>
 </hibernate-configuration>]]></footer>

Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/hibernate/TextType.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/hibernate/TextType.java	2009-02-06 00:35:08 UTC (rev 3786)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/db/hibernate/TextType.java	2009-02-06 01:25:49 UTC (rev 3787)
@@ -34,18 +34,18 @@
 import org.apache.commons.logging.LogFactory;
 import org.hibernate.HibernateException;
 import org.hibernate.type.Type;
-import org.hibernate.usertype.UserType;
+import org.hibernate.usertype.EnhancedUserType;
 import org.hibernate.util.EqualsHelper;
 import org.hibernate.util.StringHelper;
 
 /**
  * @author Alejandro Guizar
  */
-public class TextType implements UserType, Serializable {
+public class TextType implements EnhancedUserType, Serializable {
 
   private transient Log log;
-  private static final boolean IS_VALUE_TRACING_ENABLED = LogFactory.getLog(StringHelper
-      .qualifier(Type.class.getName())).isTraceEnabled();
+  private static final boolean IS_VALUE_TRACING_ENABLED = LogFactory.getLog(
+      StringHelper.qualifier(Type.class.getName())).isTraceEnabled();
 
   private static final long serialVersionUID = 1L;
 
@@ -127,8 +127,7 @@
     Reader charReader = rs.getCharacterStream(name);
 
     // if the corresponding SQL value is NULL, the reader we got is NULL as well
-    if (charReader == null || rs.wasNull())
-      return null;
+    if (charReader == null || rs.wasNull()) return null;
 
     // Fetch Reader content up to the end - and put characters in a StringBuffer
     StringBuffer sbuf = new StringBuffer();
@@ -173,19 +172,23 @@
       }
     }
     catch (RuntimeException re) {
-      log().info("could not bind value '" + nullSafeToString(value)
-          + "' to parameter: "
-          + index
-          + "; "
-          + re.getMessage());
+      log().info(
+          "could not bind value '"
+              + nullSafeToString(value)
+              + "' to parameter: "
+              + index
+              + "; "
+              + re.getMessage());
       throw re;
     }
     catch (SQLException se) {
-      log().info("could not bind value '" + nullSafeToString(value)
-          + "' to parameter: "
-          + index
-          + "; "
-          + se.getMessage());
+      log().info(
+          "could not bind value '"
+              + nullSafeToString(value)
+              + "' to parameter: "
+              + index
+              + "; "
+              + se.getMessage());
       throw se;
     }
   }
@@ -217,6 +220,18 @@
     return Types.CLOB;
   }
 
+  public String objectToSQLString(Object value) {
+    return '\'' + (String) value + '\'';
+  }
+
+  public Object fromXMLString(String xml) {
+    return xml == null || xml.length() == 0 ? null : fromStringValue(xml);
+  }
+
+  public String toXMLString(Object value) {
+    return toString(value);
+  }
+
   public String nullSafeToString(Object value) throws HibernateException {
     return value == null ? null : toString(value);
   }
@@ -224,4 +239,8 @@
   public String toString(Object val) {
     return (String) val;
   }
+
+  public Object fromStringValue(String xml) {
+    return xml;
+  }
 }

Modified: jbpm3/trunk/modules/core/src/main/resources/hibernate.cache.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/hibernate.cache.xml	2009-02-06 00:35:08 UTC (rev 3786)
+++ jbpm3/trunk/modules/core/src/main/resources/hibernate.cache.xml	2009-02-06 01:25:49 UTC (rev 3787)
@@ -1,10 +1,10 @@
 
-    <!-- ################################### -->
-    <!-- # cache settings                  # -->
-    <!-- # strategy="nonstrict-read-write" # -->
-    <!-- # can be used with hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider # -->
-    <!-- ################################### -->
+    <!-- ################## -->
+    <!-- # cache settings # -->
+    <!-- ##################-->
 
+    <!-- strategy="nonstrict-read-write" can be used with HashtableCacheProvider -->
+
     <class-cache class="org.jbpm.context.def.VariableAccess" usage="nonstrict-read-write" />
 
     <collection-cache collection="org.jbpm.file.def.FileDefinition.processFiles" usage="nonstrict-read-write" />

Modified: jbpm3/trunk/modules/core/src/main/resources/hibernate.mapping.default.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/hibernate.mapping.default.xml	2009-02-06 00:35:08 UTC (rev 3786)
+++ jbpm3/trunk/modules/core/src/main/resources/hibernate.mapping.default.xml	2009-02-06 01:25:49 UTC (rev 3787)
@@ -1,15 +1,16 @@
-
     <!-- ###################### -->
     <!-- # jbpm mapping files # -->
     <!-- ###################### -->
 
     <!-- hql queries -->
     <mapping resource="org/jbpm/db/hibernate.queries.hbm.xml" />
-    <!-- hql queries used in simulation for querying historical data
-        uncomment if you want to use the GetSimulationInputCommand
-        or maybe you also want to use the queries yourself
-        be patient: the queries need the stddev function to be enabled in your dialect
-        more information on this can be found here: http://www.camunda.com/business_process_simulation_news/mysql_and_stddev.html -->
+
+    <!-- hql queries used in simulation for querying historical data.
+         uncomment if you want to use the GetSimulationInputCommand
+         or you want to use the queries directly.
+         beware: the queries need the stddev function to be enabled in your dialect.
+         for more information, visit: 
+         http://www.camunda.com/business_process_simulation_news/mysql_and_stddev.html -->
     <!--
     <mapping resource="org/jbpm/sim/bam/hibernate.queries.hbm.xml" />
     -->
@@ -27,16 +28,13 @@
     <mapping resource="org/jbpm/graph/def/ExceptionHandler.hbm.xml"/>
     <mapping resource="org/jbpm/instantiation/Delegation.hbm.xml"/>
 
-    <!-- ############################################ -->
-    <!-- # another mapping file with external dependencies # -->
-    <!-- ############################################ -->
-    <!-- following mapping file has a dependency on   -->
-    <!-- 'bsh-{version}.jar'.                         -->
-    <!-- uncomment this if you don't have bsh on your -->
-    <!-- classpath.  you won't be able to use the     -->
-    <!-- script element in process definition files   -->
-    <!-- has to be defined below org/jbpm/graph/def/Action.hbm.xml -->
-    <!-- due to the inline collection-cache elements below -->
+    <!-- ########################################### -->
+    <!-- # mapping file with external dependencies # -->
+    <!-- ########################################### -->
+    <!-- the following mapping file has a dependency on 'bsh-{version}.jar'.
+         uncomment this if bsh is not in your classpath.
+         the script element will not be available in process definition files.
+         note: this mapping must appear below org/jbpm/graph/def/Action.hbm.xml -->
     <mapping resource="org/jbpm/graph/action/Script.hbm.xml"/>
 
     <!-- graph.node mapping files -->

Modified: jbpm3/trunk/modules/core/src/main/resources/hibernate.mapping.sybase.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/hibernate.mapping.sybase.xml	2009-02-06 00:35:08 UTC (rev 3786)
+++ jbpm3/trunk/modules/core/src/main/resources/hibernate.mapping.sybase.xml	2009-02-06 01:25:49 UTC (rev 3787)
@@ -1,2 +1,142 @@
+    <!-- ###################### -->
+    <!-- # jbpm mapping files # -->
+    <!-- ###################### -->
+
+    <!-- hql queries -->
+    <mapping resource="org/jbpm/db/hibernate.queries.hbm.xml" />
+
     <!-- sybase type mappings -->
-    <mapping resource="org/jbpm/db/hibernate.types.sybase.hbm.xml" />
\ No newline at end of file
+    <mapping resource="org/jbpm/db/hibernate.types.sybase.hbm.xml" />
+
+    <!-- hql queries used in simulation for querying historical data.
+         uncomment if you want to use the GetSimulationInputCommand
+         or you want to use the queries directly.
+         beware: the queries need the stddev function to be enabled in your dialect.
+         for more information, visit: 
+         http://www.camunda.com/business_process_simulation_news/mysql_and_stddev.html -->
+    <!--
+    <mapping resource="org/jbpm/sim/bam/hibernate.queries.hbm.xml" />
+    -->
+
+    <!-- graph.action mapping files -->
+    <mapping resource="org/jbpm/graph/action/MailAction.hbm.xml"/>
+
+    <!-- graph.def mapping files -->
+    <mapping resource="org/jbpm/graph/def/ProcessDefinition.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/def/Node.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/def/Transition.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/def/Event.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/def/Action.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/def/SuperState.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/def/ExceptionHandler.hbm.xml"/>
+    <mapping resource="org/jbpm/instantiation/Delegation.hbm.xml"/>
+
+    <!-- ########################################### -->
+    <!-- # mapping file with external dependencies # -->
+    <!-- ########################################### -->
+    <!-- the following mapping file has a dependency on 'bsh-{version}.jar'.
+         uncomment this if bsh is not in your classpath.
+         the script element will not be available in process definition files.
+         note: this mapping must appear below org/jbpm/graph/def/Action.hbm.xml -->
+    <mapping resource="org/jbpm/graph/action/Script.hbm.xml"/>
+
+    <!-- graph.node mapping files -->
+    <mapping resource="org/jbpm/graph/node/StartState.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/node/EndState.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/node/ProcessState.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/node/Decision.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/node/Fork.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/node/Join.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/node/MailNode.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/node/State.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/node/TaskNode.hbm.xml"/>
+
+    <!-- context.def mapping files -->
+    <mapping resource="org/jbpm/context/def/ContextDefinition.hbm.xml"/>
+    <mapping resource="org/jbpm/context/def/VariableAccess.hbm.xml"/>
+
+    <!-- bytes mapping files -->
+    <mapping resource="org/jbpm/bytes/ByteArray.hbm.xml"/>
+
+    <!-- module.def mapping files -->
+    <mapping resource="org/jbpm/module/def/ModuleDefinition.hbm.xml"/>
+
+    <!-- file.def mapping files -->
+    <mapping resource="org/jbpm/file/def/FileDefinition.hbm.xml"/>
+
+    <!-- taskmgmt.def mapping files -->
+    <mapping resource="org/jbpm/taskmgmt/def/TaskMgmtDefinition.hbm.xml"/>
+    <mapping resource="org/jbpm/taskmgmt/def/Swimlane.hbm.xml"/>
+    <mapping resource="org/jbpm/taskmgmt/def/Task.hbm.xml"/>
+    <mapping resource="org/jbpm/taskmgmt/def/TaskController.hbm.xml"/>
+
+    <!-- scheduler.def mapping files -->
+    <mapping resource="org/jbpm/scheduler/def/CreateTimerAction.hbm.xml"/>
+    <mapping resource="org/jbpm/scheduler/def/CancelTimerAction.hbm.xml"/>
+
+    <!-- graph.exe mapping files -->
+    <mapping resource="org/jbpm/graph/exe/Comment.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/exe/ProcessInstance.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/exe/Token.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/exe/RuntimeAction.hbm.xml"/>
+
+    <!-- module.exe mapping files -->
+    <mapping resource="org/jbpm/module/exe/ModuleInstance.hbm.xml"/>
+
+    <!-- context.exe mapping files -->
+    <mapping resource="org/jbpm/context/exe/ContextInstance.hbm.xml"/>
+    <mapping resource="org/jbpm/context/exe/TokenVariableMap.hbm.xml"/>
+    <mapping resource="org/jbpm/context/exe/VariableInstance.hbm.xml"/>
+    <mapping resource="org/jbpm/context/exe/variableinstance/ByteArrayInstance.hbm.xml"/>
+    <mapping resource="org/jbpm/context/exe/variableinstance/DateInstance.hbm.xml"/>
+    <mapping resource="org/jbpm/context/exe/variableinstance/DoubleInstance.hbm.xml"/>
+    <mapping resource="org/jbpm/context/exe/variableinstance/HibernateLongInstance.hbm.xml"/>
+    <mapping resource="org/jbpm/context/exe/variableinstance/HibernateStringInstance.sybase.hbm.xml" />
+    <mapping resource="org/jbpm/context/exe/variableinstance/LongInstance.hbm.xml"/>
+    <mapping resource="org/jbpm/context/exe/variableinstance/NullInstance.hbm.xml"/>
+    <mapping resource="org/jbpm/context/exe/variableinstance/StringInstance.hbm.xml"/>
+
+    <!-- job mapping files -->
+    <mapping resource="org/jbpm/job/Job.hbm.xml"/>
+    <mapping resource="org/jbpm/job/Timer.hbm.xml"/>
+    <mapping resource="org/jbpm/job/ExecuteNodeJob.hbm.xml"/>
+    <mapping resource="org/jbpm/job/ExecuteActionJob.hbm.xml"/>
+    <mapping resource="org/jbpm/job/CleanUpProcessJob.hbm.xml"/>
+
+    <!-- taskmgmt.exe mapping files -->
+    <mapping resource="org/jbpm/taskmgmt/exe/TaskMgmtInstance.hbm.xml"/>
+    <mapping resource="org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml"/>
+    <mapping resource="org/jbpm/taskmgmt/exe/PooledActor.hbm.xml"/>
+    <mapping resource="org/jbpm/taskmgmt/exe/SwimlaneInstance.hbm.xml"/>
+
+    <!-- logging mapping files -->
+    <mapping resource="org/jbpm/logging/log/ProcessLog.hbm.xml"/>
+    <mapping resource="org/jbpm/logging/log/MessageLog.hbm.xml"/>
+    <mapping resource="org/jbpm/logging/log/CompositeLog.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/log/ActionLog.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/log/NodeLog.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/log/ProcessInstanceCreateLog.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/log/ProcessInstanceEndLog.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/log/ProcessStateLog.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/log/SignalLog.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/log/TokenCreateLog.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/log/TokenEndLog.hbm.xml"/>
+    <mapping resource="org/jbpm/graph/log/TransitionLog.hbm.xml"/>
+    <mapping resource="org/jbpm/context/log/VariableLog.hbm.xml"/>
+    <mapping resource="org/jbpm/context/log/VariableCreateLog.hbm.xml"/>
+    <mapping resource="org/jbpm/context/log/VariableDeleteLog.hbm.xml"/>
+    <mapping resource="org/jbpm/context/log/VariableUpdateLog.hbm.xml"/>
+    <mapping resource="org/jbpm/context/log/variableinstance/ByteArrayUpdateLog.hbm.xml"/>
+    <mapping resource="org/jbpm/context/log/variableinstance/DateUpdateLog.hbm.xml"/>
+    <mapping resource="org/jbpm/context/log/variableinstance/DoubleUpdateLog.hbm.xml"/>
+    <mapping resource="org/jbpm/context/log/variableinstance/HibernateLongUpdateLog.hbm.xml"/>
+    <mapping resource="org/jbpm/context/log/variableinstance/HibernateStringUpdateLog.hbm.xml"/>
+    <mapping resource="org/jbpm/context/log/variableinstance/LongUpdateLog.hbm.xml"/>
+    <mapping resource="org/jbpm/context/log/variableinstance/StringUpdateLog.hbm.xml"/>
+    <mapping resource="org/jbpm/taskmgmt/log/TaskLog.hbm.xml"/>
+    <mapping resource="org/jbpm/taskmgmt/log/TaskCreateLog.hbm.xml"/>
+    <mapping resource="org/jbpm/taskmgmt/log/TaskAssignLog.hbm.xml"/>
+    <mapping resource="org/jbpm/taskmgmt/log/TaskEndLog.hbm.xml"/>
+    <mapping resource="org/jbpm/taskmgmt/log/SwimlaneLog.hbm.xml"/>
+    <mapping resource="org/jbpm/taskmgmt/log/SwimlaneCreateLog.hbm.xml"/>
+    <mapping resource="org/jbpm/taskmgmt/log/SwimlaneAssignLog.hbm.xml"/>

Modified: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/HibernateStringInstance.hbm.xml
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/HibernateStringInstance.hbm.xml	2009-02-06 00:35:08 UTC (rev 3786)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/HibernateStringInstance.hbm.xml	2009-02-06 01:25:49 UTC (rev 3787)
@@ -8,7 +8,7 @@
   <subclass name="org.jbpm.context.exe.variableinstance.HibernateStringInstance" 
             extends="org.jbpm.context.exe.VariableInstance" 
             discriminator-value="I">
-    <any name="value" id-type="string" cascade="save-update">
+    <any name="value" id-type="text" cascade="save-update">
       <column name="STRINGIDCLASS_" />
       <column name="STRINGVALUE_"/>
     </any>

Copied: jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/HibernateStringInstance.sybase.hbm.xml (from rev 3786, jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/HibernateStringInstance.sybase.hbm.xml)
===================================================================
--- jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/HibernateStringInstance.sybase.hbm.xml	                        (rev 0)
+++ jbpm3/trunk/modules/core/src/main/resources/org/jbpm/context/exe/variableinstance/HibernateStringInstance.sybase.hbm.xml	2009-02-06 01:25:49 UTC (rev 3787)
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
+    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping auto-import="false" default-access="field">
+  <subclass name="org.jbpm.context.exe.variableinstance.HibernateStringInstance" 
+            extends="org.jbpm.context.exe.VariableInstance" 
+            discriminator-value="I">
+    <!-- id-type seems to be unaware of type definitions -->
+    <any name="value" id-type="org.jbpm.db.hibernate.TextType" cascade="save-update">
+      <column name="STRINGIDCLASS_" />
+      <column name="STRINGVALUE_"/>
+    </any>
+  </subclass>
+</hibernate-mapping>

Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/context/exe/VariableQueryDbTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/context/exe/VariableQueryDbTest.java	2009-02-06 00:35:08 UTC (rev 3786)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/context/exe/VariableQueryDbTest.java	2009-02-06 01:25:49 UTC (rev 3787)
@@ -1,7 +1,7 @@
 package org.jbpm.context.exe;
 
+import java.util.Collections;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Set;
 
 import org.hibernate.Query;
@@ -9,18 +9,14 @@
 import org.jbpm.graph.def.ProcessDefinition;
 import org.jbpm.graph.exe.ProcessInstance;
 
-public class VariableQueryDbTest extends AbstractDbTestCase
-{
+public class VariableQueryDbTest extends AbstractDbTestCase {
 
-  public void testStringVariableQuery()
-  {
-    ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
-        "<process-definition name='variables'>" + 
-        "  <start-state name='start'/>" +
-        "</process-definition>");
+  public void testStringVariableQuery() {
+    ProcessDefinition processDefinition = ProcessDefinition.parseXmlString("<process-definition name='variables'>"
+        + "  <start-state name='start'/>"
+        + "</process-definition>");
     jbpmContext.deployProcessDefinition(processDefinition);
-    try
-    {
+    try {
       newTransaction();
 
       ProcessInstance one = jbpmContext.newProcessInstanceForUpdate("variables");
@@ -37,43 +33,41 @@
 
       newTransaction();
 
-      Query query = session.createQuery("select pi " + "from org.jbpm.context.exe.variableinstance.StringInstance si " + "     join si.processInstance pi "
-          + "where si.name = 'category'" + "  and si.value = 'overpaid'");
+      Query query = session.createQuery("select pi.id "
+          + "from org.jbpm.context.exe.variableinstance.StringInstance si "
+          + "join si.processInstance pi "
+          + "where si.name = 'category'"
+          + "  and si.value like 'overpaid'");
 
-      Set expectedPids = new HashSet();
-      expectedPids.add(new Long(one.getId()));
-      expectedPids.add(new Long(two.getId()));
+      Set<Long> expectedPids = new HashSet<Long>();
+      expectedPids.add(one.getId());
+      expectedPids.add(two.getId());
 
-      Set retrievedPids = new HashSet();
-      Iterator iter = query.list().iterator();
-      while (iter.hasNext())
-      {
-        ProcessInstance pi = (ProcessInstance)iter.next();
-        retrievedPids.add(new Long(pi.getId()));
+      Set<Long> retrievedPids = new HashSet<Long>();
+      for (Object result : query.list()) {
+        retrievedPids.add((Long) result);
       }
 
       assertEquals(expectedPids, retrievedPids);
 
       newTransaction();
 
-      query = session.createQuery("select pi from org.jbpm.context.exe.variableinstance.StringInstance si  join si.processInstance pi "
-          + "where si.name = 'category'  and si.value = 'underpaid'");
+      query = session.createQuery("select pi.id "
+          + "from org.jbpm.context.exe.variableinstance.StringInstance si "
+          + "join si.processInstance pi "
+          + "where si.name = 'category'"
+          + "  and si.value like 'underpaid'");
 
-      expectedPids = new HashSet();
-      expectedPids.add(new Long(three.getId()));
+      expectedPids = Collections.singleton(three.getId());
 
-      retrievedPids = new HashSet();
-      iter = query.list().iterator();
-      while (iter.hasNext())
-      {
-        ProcessInstance pi = (ProcessInstance)iter.next();
-        retrievedPids.add(new Long(pi.getId()));
+      retrievedPids = new HashSet<Long>();
+      for (Object result : query.list()) {
+        retrievedPids.add((Long) result);
       }
 
       assertEquals(expectedPids, retrievedPids);
     }
-    finally
-    {
+    finally {
       jbpmContext.getGraphSession().deleteProcessDefinition(processDefinition.getId());
     }
   }

Copied: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm2017 (from rev 3786, jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/jbpm2017)

Deleted: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm2017/JBPM2017Test.java
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/jbpm2017/JBPM2017Test.java	2009-02-06 00:35:08 UTC (rev 3786)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm2017/JBPM2017Test.java	2009-02-06 01:25:49 UTC (rev 3787)
@@ -1,72 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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 software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.jbpm2017;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.io.StringWriter;
-
-import org.jbpm.db.AbstractDbTestCase;
-import org.jbpm.graph.def.ProcessDefinition;
-import org.jbpm.graph.exe.ProcessInstance;
-
-/**
- * STRINGVALUE_ column in JBPM_VARIABLEINSTANCE table should be text, not varchar(255)
- * 
- * https://jira.jboss.org/jira/browse/JBPM-2017
- * 
- * @author Alejandro Guizar
- */
-public class JBPM2017Test extends AbstractDbTestCase {
-
-  public void testTextVariable() throws IOException {
-    String processName = getName();
-    ProcessDefinition processDefinition = ProcessDefinition.createNewProcessDefinition();
-    processDefinition.setName(processName);
-    jbpmContext.deployProcessDefinition(processDefinition);
-
-    newTransaction();
-    try {
-      ProcessInstance processInstance = jbpmContext.newProcessInstance(processName);
-      String quote = readString(getClass().getResourceAsStream("quote.txt"));
-      processInstance.getContextInstance().setVariable("quote", quote);
-
-      processInstance = saveAndReload(processInstance);
-      assertEquals(quote, processInstance.getContextInstance().getVariable("quote"));
-    }
-    finally {
-      graphSession.deleteProcessDefinition(processDefinition.getId());
-    }
-  }
-
-  private static String readString(InputStream in) throws IOException {
-    StringWriter writer = new StringWriter();
-    Reader reader = new InputStreamReader(in);
-    for (int ch; (ch = reader.read()) != -1;) {
-      writer.write(ch);
-    }
-    in.close();
-    return writer.toString();
-  }
-}

Copied: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm2017/JBPM2017Test.java (from rev 3786, jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/java/org/jbpm/jbpm2017/JBPM2017Test.java)
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm2017/JBPM2017Test.java	                        (rev 0)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm2017/JBPM2017Test.java	2009-02-06 01:25:49 UTC (rev 3787)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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 software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.jbpm2017;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.io.StringWriter;
+
+import org.jbpm.db.AbstractDbTestCase;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ProcessInstance;
+
+/**
+ * STRINGVALUE_ column in JBPM_VARIABLEINSTANCE table should be text, not varchar(255)
+ * 
+ * https://jira.jboss.org/jira/browse/JBPM-2017
+ * 
+ * @author Alejandro Guizar
+ */
+public class JBPM2017Test extends AbstractDbTestCase {
+
+  public void testTextVariable() throws IOException {
+    String processName = getName();
+    ProcessDefinition processDefinition = ProcessDefinition.createNewProcessDefinition();
+    processDefinition.setName(processName);
+    jbpmContext.deployProcessDefinition(processDefinition);
+
+    newTransaction();
+    try {
+      ProcessInstance processInstance = jbpmContext.newProcessInstance(processName);
+      String quote = readString(getClass().getResourceAsStream("quote.txt"));
+      processInstance.getContextInstance().setVariable("quote", quote);
+
+      processInstance = saveAndReload(processInstance);
+      assertEquals(quote, processInstance.getContextInstance().getVariable("quote"));
+    }
+    finally {
+      graphSession.deleteProcessDefinition(processDefinition.getId());
+    }
+  }
+
+  private static String readString(InputStream in) throws IOException {
+    StringWriter writer = new StringWriter();
+    Reader reader = new InputStreamReader(in);
+    for (int ch; (ch = reader.read()) != -1;) {
+      writer.write(ch);
+    }
+    in.close();
+    return writer.toString();
+  }
+}

Copied: jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jbpm2017 (from rev 3786, jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/resources/org/jbpm/jbpm2017)

Deleted: jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jbpm2017/quote.txt
===================================================================
--- jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/resources/org/jbpm/jbpm2017/quote.txt	2009-02-06 00:35:08 UTC (rev 3786)
+++ jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jbpm2017/quote.txt	2009-02-06 01:25:49 UTC (rev 3787)
@@ -1,12 +0,0 @@
-For the first time in a long time I thought about Maman. I felt as if I understood why at the end
-of her life she had taken a 'fiance', why she had played at beginning again. Even there, in that
-home where lives were fading out, evening was a kind of wistful respite. So close to death, Maman
-must have felt free then and ready to live it all again. Nobody, nobody had the right to cry over
-her. And I felt ready to live it all again too. As if the blind rage had washed me clean, rid me
-of hope; for the first time, in that night alive with signs and stars, I opened myself to the
-gentle indifference of the world. Finding it so much like myself - so like a brother, really - I 
-felt I had been happy and that I was happy again. For everything to be consummated, for me to feel
-less alone, I had only to wish that there be a large crowd of spectators the day of my execution 
-and that they greet me with cries of hate.
-
-From "The Stranger" by Albert Camus.
\ No newline at end of file

Copied: jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jbpm2017/quote.txt (from rev 3786, jbpm3/branches/jbpm-3.2.5.SP/modules/core/src/test/resources/org/jbpm/jbpm2017/quote.txt)
===================================================================
--- jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jbpm2017/quote.txt	                        (rev 0)
+++ jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jbpm2017/quote.txt	2009-02-06 01:25:49 UTC (rev 3787)
@@ -0,0 +1,12 @@
+For the first time in a long time I thought about Maman. I felt as if I understood why at the end
+of her life she had taken a 'fiance', why she had played at beginning again. Even there, in that
+home where lives were fading out, evening was a kind of wistful respite. So close to death, Maman
+must have felt free then and ready to live it all again. Nobody, nobody had the right to cry over
+her. And I felt ready to live it all again too. As if the blind rage had washed me clean, rid me
+of hope; for the first time, in that night alive with signs and stars, I opened myself to the
+gentle indifference of the world. Finding it so much like myself - so like a brother, really - I 
+felt I had been happy and that I was happy again. For everything to be consummated, for me to feel
+less alone, I had only to wish that there be a large crowd of spectators the day of my execution 
+and that they greet me with cries of hate.
+
+From "The Stranger" by Albert Camus.
\ No newline at end of file




More information about the jbpm-commits mailing list