Justin Koke avatar Justin Koke committed a9a57f9

Fixing Hibernate 3 implementation and ofbiz m2 deps.

The current implementation of Hibernate 3 was not using the newer DTD, resulting in WARN's on startup.
Also we should not be using session.load as a way to check if a propertyset item exists (as per Hibernate API docs)
Some of the callers to findByKey would assume null if the object did not exist, but .load will always return a proxy.

Also OfBiz is long dead in a few ways, so I have moved the dependencies to use internal specific JIRA artifcats of the
OfBiz modules

Comments (0)

Files changed (7)

+*.iml
+*.ipr
+*.iws
+.classpath
+.project
+.settings/
+target/
+.clover/
+*.log
+*.log.?
+.idea/

providers/hibernate2/src/main/java/com/opensymphony/module/propertyset/hibernate/PropertySetItemImpl.hbm.xml

-<?xml version="1.0"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
-
-<hibernate-mapping>
-    <class name="com.opensymphony.module.propertyset.hibernate.PropertySetItemImpl" table="OS_PROPERTYENTRY">
-        <composite-id>
-            <key-property name="entityName" column="entity_name" length="125" />
-            <key-property name="entityId" column="entity_id" />
-            <key-property name="key" column="entity_key" />
-        </composite-id>
-
-        <property name="type" column="key_type" />
-        <property name="booleanVal" column="boolean_val" />
-        <property name="doubleVal" column="double_val" />
-        <property name="stringVal" column="string_val" />
-        <property name="longVal" column="long_val" />
-        <property name="intVal" column="int_val" />
-        <property name="dateVal" type="timestamp" column="date_val" />
-    </class>
-	<query name="all_keys"><![CDATA[
-		select item.key from item in class com.opensymphony.module.propertyset.hibernate.PropertySetItem
-		where item.entityName = :entityName and item.entityId = :entityId
-	]]></query>
-	<query name="all_keys_with_type"><![CDATA[
-		select item.key from item in class com.opensymphony.module.propertyset.hibernate.PropertySetItem
-		where item.entityName = :entityName and item.entityId = :entityId and item.type = :type
-	]]></query>
-	<query name="all_keys_like"><![CDATA[
-		select item.key from item in class com.opensymphony.module.propertyset.hibernate.PropertySetItem
-		where item.entityName = :entityName and item.entityId = :entityId and item.key LIKE :like
-	]]></query>
-	<query name="all_keys_with_type_like"><![CDATA[
-		select item.key from item in class com.opensymphony.module.propertyset.hibernate.PropertySetItem
-		where item.entityName = :entityName and item.entityId = :entityId
-		and item.type = :type and item.key LIKE :like
-	]]></query>
-
-</hibernate-mapping>

providers/hibernate2/src/main/resources/com/opensymphony/module/propertyset/hibernate/PropertySetItemImpl.hbm.xml

+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
+
+<hibernate-mapping>
+    <class name="com.opensymphony.module.propertyset.hibernate.PropertySetItemImpl" table="OS_PROPERTYENTRY">
+        <composite-id>
+            <key-property name="entityName" column="entity_name" length="125" />
+            <key-property name="entityId" column="entity_id" />
+            <key-property name="key" column="entity_key" />
+        </composite-id>
+
+        <property name="type" column="key_type" />
+        <property name="booleanVal" column="boolean_val" />
+        <property name="doubleVal" column="double_val" />
+        <property name="stringVal" column="string_val" />
+        <property name="longVal" column="long_val" />
+        <property name="intVal" column="int_val" />
+        <property name="dateVal" type="timestamp" column="date_val" />
+    </class>
+	<query name="all_keys"><![CDATA[
+		select item.key from item in class com.opensymphony.module.propertyset.hibernate.PropertySetItem
+		where item.entityName = :entityName and item.entityId = :entityId
+	]]></query>
+	<query name="all_keys_with_type"><![CDATA[
+		select item.key from item in class com.opensymphony.module.propertyset.hibernate.PropertySetItem
+		where item.entityName = :entityName and item.entityId = :entityId and item.type = :type
+	]]></query>
+	<query name="all_keys_like"><![CDATA[
+		select item.key from item in class com.opensymphony.module.propertyset.hibernate.PropertySetItem
+		where item.entityName = :entityName and item.entityId = :entityId and item.key LIKE :like
+	]]></query>
+	<query name="all_keys_with_type_like"><![CDATA[
+		select item.key from item in class com.opensymphony.module.propertyset.hibernate.PropertySetItem
+		where item.entityName = :entityName and item.entityId = :entityId
+		and item.type = :type and item.key LIKE :like
+	]]></query>
+
+</hibernate-mapping>

providers/hibernate3/src/main/java/com/opensymphony/module/propertyset/hibernate3/HibernatePropertySetDAOUtils.java

     // ~ Methods
     // ////////////////////////////////////////////////////////////////
     public static PropertySetItem getItem(Session session, String entityName, Long entityId, String key) throws HibernateException {
-        return (PropertySetItem) session.load(PropertySetItemImpl.class, new PropertySetItemImpl(entityName, entityId.longValue(), key));
+        return (PropertySetItem) session.get(PropertySetItemImpl.class, new PropertySetItemImpl(entityName, entityId.longValue(), key));
     }
 
     /**

providers/hibernate3/src/main/java/com/opensymphony/module/propertyset/hibernate3/PropertySetItemImpl.hbm.xml

-<?xml version="1.0"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
-
-<hibernate-mapping>
-    <class name="com.opensymphony.module.propertyset.hibernate3.PropertySetItemImpl" table="OS_PROPERTYENTRY">
-        <composite-id>
-            <key-property name="entityName" column="entity_name" length="125" />
-            <key-property name="entityId" column="entity_id" />
-            <key-property name="key" column="entity_key" />
-        </composite-id>
-
-        <property name="type" column="key_type" />
-        <property name="booleanVal" column="boolean_val" />
-        <property name="doubleVal" column="double_val" />
-        <property name="stringVal" column="string_val" />
-        <property name="longVal" column="long_val" />
-        <property name="intVal" column="int_val" />
-        <property name="dateVal" type="timestamp" column="date_val" />
-    </class>
-	<query name="all_keys"><![CDATA[
-		select item.key from item in class com.opensymphony.module.propertyset.hibernate3.PropertySetItem
-		where item.entityName = :entityName and item.entityId = :entityId
-	]]></query>
-	<query name="all_keys_with_type"><![CDATA[
-		select item.key from item in class com.opensymphony.module.propertyset.hibernate3.PropertySetItem
-		where item.entityName = :entityName and item.entityId = :entityId and item.type = :type
-	]]></query>
-	<query name="all_keys_like"><![CDATA[
-		select item.key from item in class com.opensymphony.module.propertyset.hibernate3.PropertySetItem
-		where item.entityName = :entityName and item.entityId = :entityId and item.key LIKE :like
-	]]></query>
-	<query name="all_keys_with_type_like"><![CDATA[
-		select item.key from item in class com.opensymphony.module.propertyset.hibernate3.PropertySetItem
-		where item.entityName = :entityName and item.entityId = :entityId
-		and item.type = :type and item.key LIKE :like
-	]]></query>
-
-</hibernate-mapping>

providers/hibernate3/src/main/resources/com/opensymphony/module/propertyset/hibernate3/PropertySetItemImpl.hbm.xml

+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping>
+    <class name="com.opensymphony.module.propertyset.hibernate3.PropertySetItemImpl" table="OS_PROPERTYENTRY">
+        <composite-id>
+            <key-property name="entityName" column="entity_name" length="125" />
+            <key-property name="entityId" column="entity_id" />
+            <key-property name="key" column="entity_key" />
+        </composite-id>
+
+        <property name="type" column="key_type" />
+        <property name="booleanVal" column="boolean_val" />
+        <property name="doubleVal" column="double_val" />
+        <property name="stringVal" column="string_val" />
+        <property name="longVal" column="long_val" />
+        <property name="intVal" column="int_val" />
+        <property name="dateVal" type="timestamp" column="date_val" />
+    </class>
+	<query name="all_keys"><![CDATA[
+		select item.key from item in class com.opensymphony.module.propertyset.hibernate3.PropertySetItem
+		where item.entityName = :entityName and item.entityId = :entityId
+	]]></query>
+	<query name="all_keys_with_type"><![CDATA[
+		select item.key from item in class com.opensymphony.module.propertyset.hibernate3.PropertySetItem
+		where item.entityName = :entityName and item.entityId = :entityId and item.type = :type
+	]]></query>
+	<query name="all_keys_like"><![CDATA[
+		select item.key from item in class com.opensymphony.module.propertyset.hibernate3.PropertySetItem
+		where item.entityName = :entityName and item.entityId = :entityId and item.key LIKE :like
+	]]></query>
+	<query name="all_keys_with_type_like"><![CDATA[
+		select item.key from item in class com.opensymphony.module.propertyset.hibernate3.PropertySetItem
+		where item.entityName = :entityName and item.entityId = :entityId
+		and item.type = :type and item.key LIKE :like
+	]]></query>
+
+</hibernate-mapping>

providers/ofbiz2/pom.xml

 			<version>${project.version}</version>
 		</dependency>
 		<dependency>
-			<groupId>org.ofbiz.ofbcore</groupId>
-			<artifactId>ofbcore-share</artifactId>
-			<version>2.1.1</version>
+			<groupId>org.ofbiz</groupId>
+			<artifactId>ofbcore-jira-share</artifactId>
+			<version>2.1.8</version>
 		</dependency>
 		<dependency>
-			<groupId>org.ofbiz.ofbcore</groupId>
-			<artifactId>ofbcore-entity</artifactId>
-			<version>2.1.1</version>
+			<groupId>org.ofbiz</groupId>
+			<artifactId>ofbcore-jira-entity</artifactId>
+			<version>2.1.7</version>
 		</dependency>
 	</dependencies>
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.