Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
f71bae8b
F
Flowable Engine
项目概览
开发团队
/
Flowable Engine
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Flowable Engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f71bae8b
编写于
9月 30, 2010
作者:
C
cmuelder
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ACT-187: fixed postgres scripts (postgres 8.4)
上级
549a0562
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
486 addition
and
245 deletion
+486
-245
modules/activiti-engine/pom.xml
modules/activiti-engine/pom.xml
+238
-243
modules/activiti-engine/src/main/java/org/activiti/engine/impl/db/DbManagementSession.java
...java/org/activiti/engine/impl/db/DbManagementSession.java
+13
-0
modules/activiti-engine/src/main/java/org/activiti/engine/impl/db/DbMetaDataHandler.java
...n/java/org/activiti/engine/impl/db/DbMetaDataHandler.java
+27
-0
modules/activiti-engine/src/main/java/org/activiti/engine/impl/db/DbSqlSessionFactory.java
...java/org/activiti/engine/impl/db/DbSqlSessionFactory.java
+8
-0
modules/activiti-engine/src/main/java/org/activiti/engine/impl/db/PostgresDbMetaDataHandler.java
...rg/activiti/engine/impl/db/PostgresDbMetaDataHandler.java
+51
-0
modules/activiti-engine/src/main/java/org/activiti/engine/impl/db/StdDbMetaDataHandler.java
...ava/org/activiti/engine/impl/db/StdDbMetaDataHandler.java
+34
-0
modules/activiti-engine/src/main/java/org/activiti/engine/impl/db/TableMetaDataCache.java
.../java/org/activiti/engine/impl/db/TableMetaDataCache.java
+23
-0
modules/activiti-engine/src/main/java/org/activiti/engine/impl/db/TableMetaDataCacheHandler.java
...rg/activiti/engine/impl/db/TableMetaDataCacheHandler.java
+41
-0
modules/activiti-engine/src/main/resources/org/activiti/db/ibatis/repository.mapping.xml
...n/resources/org/activiti/db/ibatis/repository.mapping.xml
+18
-0
modules/activiti-engine/src/main/resources/org/activiti/db/ibatis/variable.mapping.xml
...ain/resources/org/activiti/db/ibatis/variable.mapping.xml
+33
-2
未找到文件。
modules/activiti-engine/pom.xml
浏览文件 @
f71bae8b
<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/xsd/maven-4.0.0.xsd"
>
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<name>
Activiti - Engine
</name>
<groupId>
org.activiti
</groupId>
<artifactId>
activiti-engine
</artifactId>
<name>
Activiti - Engine
</name>
<groupId>
org.activiti
</groupId>
<artifactId>
activiti-engine
</artifactId>
<parent>
<groupId>
org.activiti
</groupId>
<artifactId>
activiti-root
</artifactId>
<relativePath>
../..
</relativePath>
<version>
5.0.rc1-SNAPSHOT
</version>
</parent>
<parent>
<groupId>
org.activiti
</groupId>
<artifactId>
activiti-root
</artifactId>
<relativePath>
../..
</relativePath>
<version>
5.0.rc1-SNAPSHOT
</version>
</parent>
<dependencies>
<dependency>
<groupId>
org.activiti
</groupId>
<artifactId>
activiti-pvm
</artifactId>
</dependency>
<dependency>
<groupId>
org.mybatis
</groupId>
<artifactId>
mybatis
</artifactId>
</dependency>
<dependency>
<groupId>
javax.el
</groupId>
<artifactId>
el-api
</artifactId>
</dependency>
<dependency>
<groupId>
de.odysseus.juel
</groupId>
<artifactId>
juel-impl
</artifactId>
</dependency>
<dependency>
<groupId>
org.codehaus.groovy
</groupId>
<artifactId>
groovy-all
</artifactId>
</dependency>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.apache.ant
</groupId>
<artifactId>
ant
</artifactId>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
com.h2database
</groupId>
<artifactId>
h2
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.mockito
</groupId>
<artifactId>
mockito-core
</artifactId>
<scope>
test
</scope>
</dependency>
<!-- required for building with JDK 5 -->
<dependency>
<groupId>
org.livetribe
</groupId>
<artifactId>
livetribe-jsr223
</artifactId>
</dependency>
<dependency>
<groupId>
com.sun.xml.bind
</groupId>
<artifactId>
jaxb-impl
</artifactId>
</dependency>
<dependency>
<groupId>
wsdl4j
</groupId>
<artifactId>
wsdl4j
</artifactId>
</dependency>
<dependency>
<groupId>
javax.xml
</groupId>
<artifactId>
jaxb-api
</artifactId>
</dependency>
<dependency>
<groupId>
com.sun.xml.bind
</groupId>
<artifactId>
jaxb-xjc
</artifactId>
</dependency>
<!-- EMAIL -->
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-email
</artifactId>
</dependency>
<dependency>
<groupId>
org.subethamail
</groupId>
<artifactId>
subethasmtp-wiser
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
xerces
</groupId>
<artifactId>
xercesImpl
</artifactId>
</dependency>
</dependencies>
<repositories>
<repository>
<id>
alfresco
</id>
<url>
http://maven.alfresco.com/nexus/content/groups/public
</url>
</repository>
</repositories>
<!-- build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/*TestCase.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build -->
<dependencies>
<dependency>
<groupId>
org.activiti
</groupId>
<artifactId>
activiti-pvm
</artifactId>
</dependency>
<dependency>
<groupId>
org.mybatis
</groupId>
<artifactId>
mybatis
</artifactId>
</dependency>
<dependency>
<groupId>
javax.el
</groupId>
<artifactId>
el-api
</artifactId>
</dependency>
<dependency>
<groupId>
de.odysseus.juel
</groupId>
<artifactId>
juel-impl
</artifactId>
</dependency>
<dependency>
<groupId>
org.codehaus.groovy
</groupId>
<artifactId>
groovy-all
</artifactId>
</dependency>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.apache.ant
</groupId>
<artifactId>
ant
</artifactId>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
com.h2database
</groupId>
<artifactId>
h2
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.mockito
</groupId>
<artifactId>
mockito-core
</artifactId>
<scope>
test
</scope>
</dependency>
<!-- required for building with JDK 5 -->
<dependency>
<groupId>
org.livetribe
</groupId>
<artifactId>
livetribe-jsr223
</artifactId>
</dependency>
<dependency>
<groupId>
com.sun.xml.bind
</groupId>
<artifactId>
jaxb-impl
</artifactId>
</dependency>
<dependency>
<groupId>
wsdl4j
</groupId>
<artifactId>
wsdl4j
</artifactId>
</dependency>
<dependency>
<groupId>
javax.xml
</groupId>
<artifactId>
jaxb-api
</artifactId>
</dependency>
<dependency>
<groupId>
com.sun.xml.bind
</groupId>
<artifactId>
jaxb-xjc
</artifactId>
</dependency>
<profiles>
<profile>
<id>
checkspring
</id>
<properties>
<skipTests>
true
</skipTests>
</properties>
</profile>
<profile>
<id>
distro
</id>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-source-plugin
</artifactId>
<version>
2.1.1
</version>
<executions>
<execution>
<id>
attach-sources
</id>
<phase>
package
</phase>
<goals>
<goal>
jar-no-fork
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- database qa profile -->
<profile>
<id>
database
</id>
<activation>
<property>
<name>
database
</name>
</property>
</activation>
<dependencies>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<version>
5.1.6
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
postgresql
</groupId>
<artifactId>
postgresql
</artifactId>
<version>
8.4-701.jdbc4
</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>
maven-antrun-plugin
</artifactId>
<!--
only worked with this version, there might be a bug with antrun
see http://jira.codehaus.org/browse/MANTRUN-109
-->
<version>
1.4
</version>
<executions>
<execution>
<id>
database-test-create-schema
</id>
<phase>
process-test-classes
</phase>
<goals>
<goal>
run
</goal>
</goals>
<configuration>
<tasks>
<echo
message=
"CREATING SCHEMA AND UPDATING PROPERTIES ${database} #{database} @{database} "
/>
<ant
antfile=
"${basedir}/../../qa/db/build.xml"
target=
"create.db.schema"
inheritAll=
"false"
>
<property
name=
"test_classpath"
refid=
"maven.test.classpath"
/>
<property
name=
"database"
value=
"${database}"
/>
</ant>
<ant
antfile=
"${basedir}/../../qa/db/build.xml"
target=
"create.activiti.prop"
>
<property
name=
"database"
value=
"${database}"
/>
</ant>
</tasks>
</configuration>
</execution>
<execution>
<id>
database-test-drop-schema
</id>
<phase>
prepare-package
</phase>
<goals>
<goal>
run
</goal>
</goals>
<configuration>
<tasks>
<echo
message=
"DROPPING SCHEMA ${database} #{database} @{database} "
/>
<ant
antfile=
"${basedir}/../../qa/db/build.xml"
target=
"drop.db.schema"
inheritAll=
"false"
>
<property
name=
"test_classpath"
refid=
"maven.test.classpath"
/>
<property
name=
"database"
value=
"${database}"
/>
</ant>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>
oracle
</id>
<activation>
<property>
<name>
database
</name>
<value>
oracle
</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>
com.oracle.jdbc
</groupId>
<artifactId>
ojdbc5
</artifactId>
<version>
11.2.0.1.0
</version>
<scope>
test
</scope>
</dependency>
</dependencies>
</profile>
</profiles>
<!-- EMAIL -->
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-email
</artifactId>
</dependency>
<dependency>
<groupId>
org.subethamail
</groupId>
<artifactId>
subethasmtp-wiser
</artifactId>
<scope>
test
</scope>
</dependency>
<reporting>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-javadoc-plugin
</artifactId>
<configuration>
<excludePackageNames>
org.activiti.impl*,org.activiti.engine.impl*
</excludePackageNames>
</configuration>
</plugin>
</plugins>
</reporting>
<dependency>
<groupId>
xerces
</groupId>
<artifactId>
xercesImpl
</artifactId>
</dependency>
</dependencies>
<repositories>
<repository>
<id>
alfresco
</id>
<url>
http://maven.alfresco.com/nexus/content/groups/public
</url>
</repository>
</repositories>
<!--
build> <plugins> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <configuration>
<excludes> <exclude>**/*TestCase.java</exclude> </excludes>
</configuration> </plugin> </plugins> </build
-->
<profiles>
<profile>
<id>
checkspring
</id>
<properties>
<skipTests>
true
</skipTests>
</properties>
</profile>
<profile>
<id>
distro
</id>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-source-plugin
</artifactId>
<version>
2.1.1
</version>
<executions>
<execution>
<id>
attach-sources
</id>
<phase>
package
</phase>
<goals>
<goal>
jar-no-fork
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- database qa profile -->
<profile>
<id>
database
</id>
<activation>
<property>
<name>
database
</name>
</property>
</activation>
<dependencies>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<version>
5.1.6
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
postgresql
</groupId>
<artifactId>
postgresql
</artifactId>
<version>
8.4-701.jdbc4
</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>
maven-antrun-plugin
</artifactId>
<!--
only worked with this version, there might be a bug with antrun
see http://jira.codehaus.org/browse/MANTRUN-109
-->
<version>
1.4
</version>
<executions>
<execution>
<id>
database-test-create-schema
</id>
<phase>
process-test-classes
</phase>
<goals>
<goal>
run
</goal>
</goals>
<configuration>
<tasks>
<echo
message=
"CREATING SCHEMA AND UPDATING PROPERTIES ${database} #{database} @{database} "
/>
<ant
antfile=
"${basedir}/../../qa/db/build.xml"
target=
"create.db.schema"
inheritAll=
"false"
>
<property
name=
"test_classpath"
refid=
"maven.test.classpath"
/>
<property
name=
"database"
value=
"${database}"
/>
</ant>
<ant
antfile=
"${basedir}/../../qa/db/build.xml"
target=
"create.activiti.prop"
>
<property
name=
"database"
value=
"${database}"
/>
</ant>
</tasks>
</configuration>
</execution>
<execution>
<id>
database-test-drop-schema
</id>
<phase>
prepare-package
</phase>
<goals>
<goal>
run
</goal>
</goals>
<configuration>
<tasks>
<echo
message=
"DROPPING SCHEMA ${database} #{database} @{database} "
/>
<ant
antfile=
"${basedir}/../../qa/db/build.xml"
target=
"drop.db.schema"
inheritAll=
"false"
>
<property
name=
"test_classpath"
refid=
"maven.test.classpath"
/>
<property
name=
"database"
value=
"${database}"
/>
</ant>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>
oracle
</id>
<activation>
<property>
<name>
database
</name>
<value>
oracle
</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>
com.oracle.jdbc
</groupId>
<artifactId>
ojdbc5
</artifactId>
<version>
11.2.0.1.0
</version>
<scope>
test
</scope>
</dependency>
</dependencies>
</profile>
</profiles>
<reporting>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-javadoc-plugin
</artifactId>
<configuration>
<excludePackageNames>
org.activiti.impl*,org.activiti.engine.impl*
</excludePackageNames>
</configuration>
</plugin>
</plugins>
</reporting>
</project>
modules/activiti-engine/src/main/java/org/activiti/engine/impl/db/DbManagementSession.java
浏览文件 @
f71bae8b
...
...
@@ -109,12 +109,25 @@ public class DbManagementSession implements ManagementSession, Session {
.
getSqlSession
()
.
getConnection
()
.
getMetaData
();
DbMetaDataHandler
databaseMetaDataHandler
=
TableMetaDataCacheHandler
.
getInstance
().
getDatabaseHandler
(
metaData
);
TableMetaData
resultCached
=
null
;
if
(
(
resultCached
=
databaseMetaDataHandler
.
getFromCache
(
tableName
))
!=
null
)
{
return
resultCached
;
}
else
{
tableName
=
databaseMetaDataHandler
.
handleTableName
(
tableName
);
}
ResultSet
resultSet
=
metaData
.
getColumns
(
null
,
null
,
tableName
,
null
);
while
(
resultSet
.
next
())
{
String
name
=
resultSet
.
getString
(
"COLUMN_NAME"
);
String
type
=
resultSet
.
getString
(
"TYPE_NAME"
);
result
.
addColumnMetaData
(
name
,
type
);
}
databaseMetaDataHandler
.
addToCache
(
result
);
}
catch
(
SQLException
e
)
{
throw
new
ActivitiException
(
"Could not retrieve database metadata: "
+
e
.
getMessage
());
}
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/db/DbMetaDataHandler.java
0 → 100644
浏览文件 @
f71bae8b
/* Licensed 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.activiti.engine.impl.db
;
import
org.activiti.engine.management.TableMetaData
;
/**
* @author Christian Mlder
*/
public
interface
DbMetaDataHandler
{
public
String
handleTableName
(
String
table
);
public
void
addToCache
(
TableMetaData
metaData
);
public
TableMetaData
getFromCache
(
String
tableName
);
}
modules/activiti-engine/src/main/java/org/activiti/engine/impl/db/DbSqlSessionFactory.java
浏览文件 @
f71bae8b
...
...
@@ -61,12 +61,20 @@ public class DbSqlSessionFactory implements SessionFactory, ProcessEngineConfigu
protected
static
final
Map
<
String
,
Map
<
String
,
String
>>
databaseSpecificStatements
=
new
HashMap
<
String
,
Map
<
String
,
String
>>();
static
{
//mysql specific
addDatabaseSpecificStatement
(
"mysql"
,
"selectTaskByQueryCriteria"
,
"selectTaskByQueryCriteria_mysql"
);
addDatabaseSpecificStatement
(
"mysql"
,
"selectNextJobsToExecute"
,
"selectNextJobsToExecute_mysql"
);
addDatabaseSpecificStatement
(
"mysql"
,
"selectProcessDefinitionsByQueryCriteria"
,
"selectProcessDefinitionsByQueryCriteria_mysql"
);
addDatabaseSpecificStatement
(
"mysql"
,
"selectProcessDefinitionCountByQueryCriteria"
,
"selectProcessDefinitionCountByQueryCriteria_mysql"
);
addDatabaseSpecificStatement
(
"mysql"
,
"selectDeploymentsByQueryCriteria"
,
"selectDeploymentsByQueryCriteria_mysql"
);
addDatabaseSpecificStatement
(
"mysql"
,
"selectDeploymentCountByQueryCriteria"
,
"selectDeploymentCountByQueryCriteria_mysql"
);
//postgres specific
addDatabaseSpecificStatement
(
"postgres"
,
"insertByteArray"
,
"insertByteArray_postgres"
);
addDatabaseSpecificStatement
(
"postgres"
,
"updateByteArray"
,
"updateByteArray_postgres"
);
addDatabaseSpecificStatement
(
"postgres"
,
"selectByteArrayById"
,
"selectByteArrayById_postgres"
);
addDatabaseSpecificStatement
(
"postgres"
,
"selectResourceByDeploymentIdAndResourceName"
,
"selectResourceByDeploymentIdAndResourceName_postgres"
);
addDatabaseSpecificStatement
(
"postgres"
,
"selectResourcesByDeploymentId"
,
"selectResourcesByDeploymentId_postgres"
);
}
protected
String
databaseName
;
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/db/PostgresDbMetaDataHandler.java
0 → 100644
浏览文件 @
f71bae8b
/* Licensed 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.activiti.engine.impl.db
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.activiti.engine.management.TableMetaData
;
/**
* @author Christian Mlder
*/
public
class
PostgresDbMetaDataHandler
extends
StdDbMetaDataHandler
implements
DbMetaDataHandler
{
@Override
public
void
addToCache
(
TableMetaData
metaData
)
{
toUpperCase
(
metaData
);
super
.
addToCache
(
metaData
);
}
private
void
toUpperCase
(
TableMetaData
metaData
)
{
List
<
String
>
list
=
new
ArrayList
<
String
>();
for
(
String
columnNames
:
metaData
.
getColumnNames
())
{
list
.
add
(
columnNames
.
toUpperCase
());
}
metaData
.
setColumnNames
(
list
);
list
=
new
ArrayList
<
String
>();
for
(
String
columnTypes
:
metaData
.
getColumnTypes
())
{
list
.
add
(
columnTypes
.
toUpperCase
());
}
metaData
.
setColumnTypes
(
list
);
}
@Override
public
String
handleTableName
(
String
table
)
{
return
table
.
toLowerCase
();
}
}
modules/activiti-engine/src/main/java/org/activiti/engine/impl/db/StdDbMetaDataHandler.java
0 → 100644
浏览文件 @
f71bae8b
/* Licensed 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.activiti.engine.impl.db
;
import
org.activiti.engine.management.TableMetaData
;
/**
* @author Christian Mlder
*/
public
class
StdDbMetaDataHandler
implements
DbMetaDataHandler
{
public
void
addToCache
(
TableMetaData
metaData
)
{
TableMetaDataCacheHandler
.
getInstance
().
getMetaDataCache
().
put
(
metaData
.
getTableName
(),
metaData
);
}
public
TableMetaData
getFromCache
(
String
tableName
)
{
return
TableMetaDataCacheHandler
.
getInstance
().
getMetaDataCache
().
get
(
tableName
);
}
public
String
handleTableName
(
String
table
)
{
return
table
;
}
}
modules/activiti-engine/src/main/java/org/activiti/engine/impl/db/TableMetaDataCache.java
0 → 100644
浏览文件 @
f71bae8b
/* Licensed 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.activiti.engine.impl.db
;
import
java.util.HashMap
;
import
org.activiti.engine.management.TableMetaData
;
/**
* @author Christian Mlder
*/
public
class
TableMetaDataCache
extends
HashMap
<
String
,
TableMetaData
>
{
}
modules/activiti-engine/src/main/java/org/activiti/engine/impl/db/TableMetaDataCacheHandler.java
0 → 100644
浏览文件 @
f71bae8b
/* Licensed 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.activiti.engine.impl.db
;
import
java.sql.DatabaseMetaData
;
import
java.sql.SQLException
;
/**
* @author Christian Mlder
*/
public
class
TableMetaDataCacheHandler
{
private
static
TableMetaDataCacheHandler
instance
=
new
TableMetaDataCacheHandler
();
private
TableMetaDataCache
cache
=
new
TableMetaDataCache
();
public
static
TableMetaDataCacheHandler
getInstance
()
{
return
instance
;
}
public
DbMetaDataHandler
getDatabaseHandler
(
DatabaseMetaData
metaData
)
throws
SQLException
{
if
(
metaData
.
getDatabaseProductName
().
equalsIgnoreCase
(
"postgresql"
))
return
new
PostgresDbMetaDataHandler
();
else
return
new
StdDbMetaDataHandler
();
}
public
TableMetaDataCache
getMetaDataCache
()
{
return
cache
;
}
}
modules/activiti-engine/src/main/resources/org/activiti/db/ibatis/repository.mapping.xml
浏览文件 @
f71bae8b
...
...
@@ -250,4 +250,22 @@
select distinct count(D.ID_)
<include
refid=
"selectDeploymentsByQueryCriteriaSql"
/>
</select>
<!-- postgresql specific -->
<resultMap
id=
"resourceResultMap_postgres"
type=
"org.activiti.engine.impl.repository.ResourceEntity"
>
<id
property=
"id"
column=
"ID_"
jdbcType=
"VARCHAR"
/>
<result
property=
"name"
column=
"NAME_"
jdbcType=
"VARCHAR"
/>
<result
property=
"bytes"
column=
"BYTES_"
jdbcType=
"BINARY"
/>
</resultMap>
<select
id=
"selectResourceByDeploymentIdAndResourceName_postgres"
parameterType=
"map"
resultMap=
"resourceResultMap_postgres"
>
select * from ACT_GE_BYTEARRAY
where DEPLOYMENT_ID_ = #{deploymentId}
AND NAME_ = #{resourceName}
</select>
<select
id=
"selectResourcesByDeploymentId_postgres"
parameterType=
"string"
resultMap=
"resourceResultMap_postgres"
>
select * from ACT_GE_BYTEARRAY where DEPLOYMENT_ID_ = #{deploymentId} order by NAME_ asc
</select>
</mapper>
\ No newline at end of file
modules/activiti-engine/src/main/resources/org/activiti/db/ibatis/variable.mapping.xml
浏览文件 @
f71bae8b
...
...
@@ -111,7 +111,7 @@
<delete
id=
"deleteByteArraysForDeployment"
parameterType=
"string"
>
delete from ACT_GE_BYTEARRAY where DEPLOYMENT_ID_ = #{id}
</delete>
<delete
id=
"deleteByteArray"
parameterType=
"string"
>
delete from ACT_GE_BYTEARRAY where ID_ = #{id}
</delete>
...
...
@@ -122,7 +122,7 @@
<id
property=
"id"
column=
"ID_"
jdbcType=
"VARCHAR"
/>
<result
property=
"revision"
column=
"REV_"
jdbcType=
"INTEGER"
/>
<result
property=
"name"
column=
"NAME_"
jdbcType=
"VARCHAR"
/>
<result
property=
"bytes"
column=
"BYTES_"
jdbcType=
"BLOB"
/>
<result
property=
"bytes"
column=
"BYTES_"
jdbcType=
"BLOB"
/>
</resultMap>
<!-- BYTE ARRAY SELECT -->
...
...
@@ -145,4 +145,35 @@
AND NAME_ = #{resourceName}
</select>
<!-- Postgresql specific configuration -->
<resultMap
id=
"byteArrayResultMap_postgres"
type=
"org.activiti.engine.impl.runtime.ByteArrayEntity"
>
<id
property=
"id"
column=
"ID_"
jdbcType=
"VARCHAR"
/>
<result
property=
"revision"
column=
"REV_"
jdbcType=
"INTEGER"
/>
<result
property=
"name"
column=
"NAME_"
jdbcType=
"VARCHAR"
/>
<result
property=
"bytes"
column=
"BYTES_"
jdbcType=
"BINARY"
/>
</resultMap>
<select
id=
"selectByteArrayById_postgres"
parameterType=
"string"
resultMap=
"byteArrayResultMap_postgres"
>
select * from ACT_GE_BYTEARRAY where ID_ = #{id}
</select>
<update
id=
"updateByteArray_postgres"
parameterType=
"org.activiti.engine.impl.runtime.ByteArrayEntity"
>
update ACT_GE_BYTEARRAY
set
REV_ = #{revisionNext, jdbcType=INTEGER},
BYTES_ = #{bytes, jdbcType=BINARY}
where ID_ = #{id}
and REV_ = #{revision, jdbcType=INTEGER}
</update>
<insert
id=
"insertByteArray_postgres"
parameterType=
"org.activiti.engine.impl.runtime.ByteArrayEntity"
>
insert into ACT_GE_BYTEARRAY(ID_, REV_, NAME_, BYTES_, DEPLOYMENT_ID_)
values (
#{id, jdbcType=VARCHAR},
1,
#{name, jdbcType=VARCHAR},
#{bytes, jdbcType=BINARY},
#{deploymentId, jdbcType=VARCHAR}
)
</insert>
</mapper>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录