mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-22 15:10:02 +00:00
Merge branch 'master' into wip/EntityBeanIntercept-interface
This commit is contained in:
51 files changed
+230
-207
No files matched your search
+7
-7
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>ebean-parent</artifactId>
|
||||
<groupId>io.ebean</groupId>
|
||||
<version>13.3.0-SNAPSHOT</version>
|
||||
<version>13.3.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>ebean-core</artifactId>
|
||||
@@ -41,19 +41,19 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-api</artifactId>
|
||||
<version>13.3.0-SNAPSHOT</version>
|
||||
<version>13.3.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-core-type</artifactId>
|
||||
<version>13.3.0-SNAPSHOT</version>
|
||||
<version>13.3.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-externalmapping-api</artifactId>
|
||||
<version>13.3.0-SNAPSHOT</version>
|
||||
<version>13.3.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -144,21 +144,21 @@
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-h2</artifactId>
|
||||
<version>13.3.0-SNAPSHOT</version>
|
||||
<version>13.3.1-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-postgres</artifactId>
|
||||
<version>13.3.0-SNAPSHOT</version>
|
||||
<version>13.3.1-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.ebean</groupId>
|
||||
<artifactId>ebean-platform-sqlserver</artifactId>
|
||||
<version>13.3.0-SNAPSHOT</version>
|
||||
<version>13.3.1-SNAPSHOT</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -524,7 +524,7 @@ public final class OrmQueryRequest<T> extends BeanRequest implements SpiOrmQuery
|
||||
}
|
||||
if (result instanceof BeanList) {
|
||||
OrderBy<T> orderBy = query.getOrderBy();
|
||||
if (orderBy != null) {
|
||||
if (orderBy != null && !orderBy.isEmpty()) {
|
||||
// in memory sort after merging the cache hits with the DB hits
|
||||
beanDescriptor.sort(((BeanList<T>) result).getActualList(), orderBy.toStringFormat());
|
||||
}
|
||||
@@ -543,7 +543,7 @@ public final class OrmQueryRequest<T> extends BeanRequest implements SpiOrmQuery
|
||||
@Override
|
||||
public List<T> beanCacheHits() {
|
||||
OrderBy<T> orderBy = query.getOrderBy();
|
||||
if (orderBy != null) {
|
||||
if (orderBy != null && !orderBy.isEmpty()) {
|
||||
beanDescriptor.sort(cacheBeans, orderBy.toStringFormat());
|
||||
}
|
||||
return cacheBeans;
|
||||
@@ -552,7 +552,7 @@ public final class OrmQueryRequest<T> extends BeanRequest implements SpiOrmQuery
|
||||
@Override
|
||||
public <K> Map<K, T> beanCacheHitsAsMap() {
|
||||
OrderBy<T> orderBy = query.getOrderBy();
|
||||
if (orderBy != null) {
|
||||
if (orderBy != null && !orderBy.isEmpty()) {
|
||||
beanDescriptor.sort(cacheBeans, orderBy.toStringFormat());
|
||||
}
|
||||
return cacheBeansToMap();
|
||||
|
||||
+21
-4
@@ -7,12 +7,14 @@ import javax.persistence.DiscriminatorType;
|
||||
import java.sql.Types;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
/**
|
||||
* Represents a node in the Inheritance tree.
|
||||
* Holds information regarding Super Subclass support.
|
||||
*/
|
||||
public final class DeployInheritInfo {
|
||||
public final class DeployInheritInfo implements Comparable<DeployInheritInfo> {
|
||||
|
||||
/**
|
||||
* the default discriminator column according to the JPA 1.0 spec.
|
||||
@@ -27,7 +29,7 @@ public final class DeployInheritInfo {
|
||||
private String columnDefn;
|
||||
private final Class<?> type;
|
||||
private Class<?> parent;
|
||||
private final ArrayList<DeployInheritInfo> children = new ArrayList<>();
|
||||
private final Set<DeployInheritInfo> children = new TreeSet<>();
|
||||
|
||||
/**
|
||||
* Create for a given type.
|
||||
@@ -74,7 +76,7 @@ public final class DeployInheritInfo {
|
||||
/**
|
||||
* Return the child nodes.
|
||||
*/
|
||||
public List<DeployInheritInfo> children() {
|
||||
public Set<DeployInheritInfo> children() {
|
||||
return children;
|
||||
}
|
||||
|
||||
@@ -251,7 +253,22 @@ public final class DeployInheritInfo {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "InheritInfo[" + type.getName() + "]" + " root[" + parent.getName() + "]" + " disValue[" + discriminatorStringValue + "]";
|
||||
String root = parent == null ? null : parent.getName();
|
||||
String name = type == null ? null : type.getName();
|
||||
return "InheritInfo[" + name + "]" + " root[" + root + "]" + " disValue[" + discriminatorStringValue + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(DeployInheritInfo o) {
|
||||
if (o == this || o.discriminatorStringValue == null && discriminatorStringValue == null) {
|
||||
return 0;
|
||||
} else if (o.discriminatorStringValue == null) {
|
||||
return 1;
|
||||
} else if (discriminatorStringValue == null) {
|
||||
return -1;
|
||||
} else {
|
||||
return discriminatorStringValue.compareTo(o.discriminatorStringValue);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user