mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-18 14:58:47 +00:00
#350 - ENH: Add @History findVersions() query ... returning historic versions for a given bean using history view
This commit is contained in:
1 parent
61a0651439
commit
1ec2f74df9
29 files changed
+500
-111
No files matched your search
@@ -163,6 +163,8 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
|
||||
*/
|
||||
private Timestamp asOf;
|
||||
|
||||
private TemporalMode temporalMode = TemporalMode.CURRENT;
|
||||
|
||||
private int bufferFetchSizeHint;
|
||||
|
||||
private boolean usageProfiling = true;
|
||||
@@ -288,6 +290,7 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
|
||||
}
|
||||
|
||||
public DefaultOrmQuery<T> asOf(Timestamp asOfDateTime) {
|
||||
this.temporalMode = (asOfDateTime != null) ? TemporalMode.AS_OF : TemporalMode.CURRENT;
|
||||
this.asOf = asOfDateTime;
|
||||
return this;
|
||||
}
|
||||
@@ -617,7 +620,7 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
|
||||
|
||||
@Override
|
||||
public TemporalMode getTemporalMode() {
|
||||
return asOf == null ? TemporalMode.CURRENT : TemporalMode.AS_OF;
|
||||
return temporalMode;
|
||||
}
|
||||
|
||||
public boolean isAsOfQuery() {
|
||||
@@ -952,6 +955,12 @@ public class DefaultOrmQuery<T> implements SpiQuery<T> {
|
||||
server.findEach(this, consumer, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Version<T>> findVersions() {
|
||||
this.temporalMode = TemporalMode.VERSIONS;
|
||||
return server.findVersions(this, null);
|
||||
}
|
||||
|
||||
public QueryIterator<T> findIterate() {
|
||||
return server.findIterate(this, null);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user