Compare commits

...
Author SHA1 Message Date
Rob Bygrave 1ba8bc4557 [maven-release-plugin] prepare release avaje-ebeanorm-3.3.4 2014-05-22 20:02:26 +12:00
Rob Bygrave a234bd1201 Merge pull request #129 from jroper/java16-compat
Backport to JDK 6
2014-05-22 19:36:32 +12:00
James Roper 1c0c0893b6 Backport to JDK 6
Replaced all uses of ju.Objects.hashCode and ju.Objects.equals with a
copy of their implementations inlined into the code.

Also changed source/target for compiler plugin.

To test, I compiled my own avaje launchagent against 6, and changed to
use that in the pom, compiled/tested the whole project using JDK 7,
then ran mvn surefire:test using JDK 6 - running surefire:test ensures
that mvn doesn't try to recompile everything against 6, since that's not
possible because of some of the delegate classes having delegate methods
to JDK 7 jdbc classes.
2014-05-22 15:20:21 +10:00
Rob Bygrave ebbc560ae8 [maven-release-plugin] prepare for next development iteration 2014-05-19 01:03:43 +12:00
Rob Bygrave fcb9df05ad [maven-release-plugin] prepare release avaje-ebeanorm-3.3.3 2014-05-19 01:03:31 +12:00
Rob Bygrave 3de79b211a Change version in pom to 3.3.3-SNAPSHOT in preparation for release 2014-05-19 01:02:13 +12:00
Rob Bygrave d93952a920 Backport of fix for #56 - Using findIterate with MySQL streams 2014-05-19 00:59:05 +12:00
6 changed files with 17 additions and 13 deletions
+10 -1
View File
@@ -9,7 +9,7 @@
<groupId>org.avaje.ebeanorm</groupId> <groupId>org.avaje.ebeanorm</groupId>
<artifactId>avaje-ebeanorm</artifactId> <artifactId>avaje-ebeanorm</artifactId>
<version>3.3.2</version> <version>3.3.4</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>avaje-ebeanorm</name> <name>avaje-ebeanorm</name>
@@ -167,6 +167,15 @@
<!-- Enhance the meta beans --> <!-- Enhance the meta beans -->
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.avaje.ebeanorm</groupId> <groupId>org.avaje.ebeanorm</groupId>
<artifactId>avaje-ebeanorm-mavenenhancer</artifactId> <artifactId>avaje-ebeanorm-mavenenhancer</artifactId>
@@ -1,7 +1,6 @@
package com.avaje.ebean.bean; package com.avaje.ebean.bean;
import java.io.Serializable; import java.io.Serializable;
import java.util.Objects;
/** /**
* Identifies a unique node of an object graph. * Identifies a unique node of an object graph.
@@ -70,7 +69,7 @@ public final class ObjectGraphNode implements Serializable {
public int hashCode() { public int hashCode() {
int hc = 31 * originQueryPoint.hashCode(); int hc = 31 * originQueryPoint.hashCode();
hc = 31 * hc + Objects.hashCode(path); hc = 31 * hc + (path == null ? 0 : path.hashCode());
return hc; return hc;
} }
@@ -83,7 +82,7 @@ public final class ObjectGraphNode implements Serializable {
} }
ObjectGraphNode e = (ObjectGraphNode) obj; ObjectGraphNode e = (ObjectGraphNode) obj;
return Objects.equals(e.path, path) return ((e.path == path) || (e.path != null && e.path.equals(path)))
&& e.originQueryPoint.equals(originQueryPoint); && e.originQueryPoint.equals(originQueryPoint);
} }
} }
@@ -1,7 +1,5 @@
package com.avaje.ebeaninternal.api; package com.avaje.ebeaninternal.api;
import java.util.Objects;
/** /**
* A hash for a query plan. * A hash for a query plan.
*/ */
@@ -26,7 +24,7 @@ public class HashQueryPlan {
public int hashCode() { public int hashCode() {
int hc = planHash; int hc = planHash;
hc = hc * 31 + bindCount; hc = hc * 31 + bindCount;
hc = hc * 31 + Objects.hashCode(rawSql); hc = hc * 31 + (rawSql == null ? 0 : rawSql.hashCode());
return hc; return hc;
} }
@@ -41,6 +39,6 @@ public class HashQueryPlan {
HashQueryPlan e = (HashQueryPlan) obj; HashQueryPlan e = (HashQueryPlan) obj;
return e.planHash == planHash return e.planHash == planHash
&& e.bindCount == bindCount && e.bindCount == bindCount
&& Objects.equals(e.rawSql, rawSql); && ((e.rawSql == rawSql) || (e.rawSql != null && e.rawSql.equals(rawSql)));
} }
} }
@@ -1,7 +1,5 @@
package com.avaje.ebeaninternal.api; package com.avaje.ebeaninternal.api;
import java.util.Objects;
/** /**
* Used to build HashQueryPlan instances. * Used to build HashQueryPlan instances.
*/ */
@@ -33,7 +31,7 @@ public class HashQueryPlanBuilder {
* Add an object to the hash calculation. * Add an object to the hash calculation.
*/ */
public HashQueryPlanBuilder add(Object object) { public HashQueryPlanBuilder add(Object object) {
planHash = planHash * 31 + Objects.hashCode(object); planHash = planHash * 31 + (object == null ? 0 : object.hashCode());
return this; return this;
} }
@@ -3,7 +3,6 @@ package com.avaje.ebeaninternal.server.expression;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Objects;
import java.util.Set; import java.util.Set;
import com.avaje.ebean.event.BeanQueryRequest; import com.avaje.ebean.event.BeanQueryRequest;
@@ -115,7 +114,7 @@ class AllEqualsExpression implements SpiExpression {
int hc = 31; int hc = 31;
for (Object value : propMap.values()) { for (Object value : propMap.values()) {
hc = hc * 31 + Objects.hashCode(value); hc = hc * 31 + (value == null ? 0 : value.hashCode());
} }
return hc; return hc;
@@ -386,6 +386,7 @@ public class CQuery<T> implements DbReadContext, CancelableQuery {
if (forwardOnlyHint) { if (forwardOnlyHint) {
// Use forward only hints for large resultset processing (Issue 56, MySql specific) // Use forward only hints for large resultset processing (Issue 56, MySql specific)
pstmt = conn.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); pstmt = conn.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
pstmt.setFetchSize(Integer.MIN_VALUE);
} else { } else {
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
} }