Author: alex.guizar(a)jboss.com
Date: 2008-12-28 18:46:48 -0500 (Sun, 28 Dec 2008)
New Revision: 3566
Added:
jbpm3/branches/aguizar/modules/core/src/main/resources/org/jbpm/db/hibernate.types.sybase.hbm.xml
Modified:
jbpm3/branches/aguizar/modules/core/src/main/java/org/jbpm/db/hibernate/TextType.java
jbpm3/branches/aguizar/modules/core/src/main/resources/hibernate.mapping.default.xml
jbpm3/branches/aguizar/modules/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml
jbpm3/branches/aguizar/modules/core/src/test/resources/log4j.xml
Log:
JBPM-1818: database-specific type definition files
Modified:
jbpm3/branches/aguizar/modules/core/src/main/java/org/jbpm/db/hibernate/TextType.java
===================================================================
---
jbpm3/branches/aguizar/modules/core/src/main/java/org/jbpm/db/hibernate/TextType.java 2008-12-28
19:48:15 UTC (rev 3565)
+++
jbpm3/branches/aguizar/modules/core/src/main/java/org/jbpm/db/hibernate/TextType.java 2008-12-28
23:46:48 UTC (rev 3566)
@@ -33,14 +33,10 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.HibernateException;
-import org.hibernate.cfg.Environment;
import org.hibernate.type.Type;
import org.hibernate.usertype.UserType;
import org.hibernate.util.EqualsHelper;
import org.hibernate.util.StringHelper;
-import org.jbpm.JbpmContext;
-import org.jbpm.persistence.db.DbPersistenceServiceFactory;
-import org.jbpm.svc.Services;
/**
* @author Alejandro Guizar
@@ -201,21 +197,10 @@
}
public void setNull(PreparedStatement st, int index) throws HibernateException,
SQLException {
- if (getHibernateDialect().indexOf("Sybase") == -1) {
- st.setNull(index, sqlType());
- }
- else {
- // JBPM-1818: workaround for SQL state JZ0SL: "Unsupported SQL type" with
jConnect
- st.setCharacterStream(index, null, 0);
- }
+ // JBPM-1818: workaround for SQL state JZ0SL: "Unsupported SQL type" with
jConnect
+ st.setCharacterStream(index, null, 0);
}
- private String getHibernateDialect() {
- DbPersistenceServiceFactory factory = (DbPersistenceServiceFactory) JbpmContext
- .getCurrentJbpmContext().getServiceFactory(Services.SERVICENAME_PERSISTENCE);
- return factory.getConfiguration().getProperty(Environment.DIALECT);
- }
-
public Object replace(Object original, Object target, Object owner) throws
HibernateException {
return original;
}
Modified:
jbpm3/branches/aguizar/modules/core/src/main/resources/hibernate.mapping.default.xml
===================================================================
---
jbpm3/branches/aguizar/modules/core/src/main/resources/hibernate.mapping.default.xml 2008-12-28
19:48:15 UTC (rev 3565)
+++
jbpm3/branches/aguizar/modules/core/src/main/resources/hibernate.mapping.default.xml 2008-12-28
23:46:48 UTC (rev 3566)
@@ -3,7 +3,7 @@
<!-- # jbpm mapping files # -->
<!-- ###################### -->
- <!-- hql queries and type defs -->
+ <!-- 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
@@ -13,6 +13,8 @@
<!--
<mapping resource="org/jbpm/sim/bam/hibernate.queries.hbm.xml" />
-->
+ <!-- type definitions (absent for most databases) -->
+ <mapping resource="org/jbpm/db/hibernate.types.${database}.hbm.xml"
/>
<!-- graph.action mapping files -->
<mapping resource="org/jbpm/graph/action/MailAction.hbm.xml"/>
Modified:
jbpm3/branches/aguizar/modules/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml
===================================================================
---
jbpm3/branches/aguizar/modules/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml 2008-12-28
19:48:15 UTC (rev 3565)
+++
jbpm3/branches/aguizar/modules/core/src/main/resources/org/jbpm/db/hibernate.queries.hbm.xml 2008-12-28
23:46:48 UTC (rev 3566)
@@ -6,8 +6,6 @@
<hibernate-mapping>
- <typedef name="text" class="org.jbpm.db.hibernate.TextType"
/>
-
<!-- related to ProcessDefintion -->
<!-- ########################### -->
Added:
jbpm3/branches/aguizar/modules/core/src/main/resources/org/jbpm/db/hibernate.types.sybase.hbm.xml
===================================================================
---
jbpm3/branches/aguizar/modules/core/src/main/resources/org/jbpm/db/hibernate.types.sybase.hbm.xml
(rev 0)
+++
jbpm3/branches/aguizar/modules/core/src/main/resources/org/jbpm/db/hibernate.types.sybase.hbm.xml 2008-12-28
23:46:48 UTC (rev 3566)
@@ -0,0 +1,8 @@
+<?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>
+ <typedef name="text" class="org.jbpm.db.hibernate.TextType"
/>
+</hibernate-mapping>
\ No newline at end of file
Modified: jbpm3/branches/aguizar/modules/core/src/test/resources/log4j.xml
===================================================================
--- jbpm3/branches/aguizar/modules/core/src/test/resources/log4j.xml 2008-12-28 19:48:15
UTC (rev 3565)
+++ jbpm3/branches/aguizar/modules/core/src/test/resources/log4j.xml 2008-12-28 23:46:48
UTC (rev 3566)
@@ -38,9 +38,6 @@
<category name="org.hibernate.SQL">
<priority value="DEBUG" />
</category>
- <category name="org.hibernate.type">
- <priority value="TRACE" />
- </category>
<category name="org.hibernate.connection">
<priority value="TRACE" />
</category>
Show replies by date