Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openolat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zentraler Informatikdienst
Digitale Medien und Lerntechnologien
olat
openolat
Commits
730c27e9
Commit
730c27e9
authored
4 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-5053: deduplicate the stream of roll calls
parent
ea02eb4b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/modules/lecture/manager/LectureBlockRollCallDAO.java
+10
-3
10 additions, 3 deletions
...olat/modules/lecture/manager/LectureBlockRollCallDAO.java
with
10 additions
and
3 deletions
src/main/java/org/olat/modules/lecture/manager/LectureBlockRollCallDAO.java
+
10
−
3
View file @
730c27e9
...
...
@@ -23,6 +23,7 @@ import java.util.ArrayList;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
...
...
@@ -585,13 +586,19 @@ public class LectureBlockRollCallDAO {
//take in account: firstAddmissionDate and null
Date
now
=
new
Date
();
Set
<
Long
>
rollCallKeys
=
new
HashSet
<>();
Map
<
Long
,
LectureBlockStatistics
>
stats
=
new
HashMap
<>();
dbInstance
.
getCurrentEntityManager
()
.
createQuery
(
sb
.
toString
(),
Object
[].
class
)
.
setParameter
(
"identityKey"
,
identity
.
getKey
())
.
getResultStream
().
forEach
(
rawObject
->
{
int
pos
=
1
;
//jump roll call key
int
pos
=
0
;
//jump roll call key
Long
rollCallKey
=
PersistenceHelper
.
extractLong
(
rawObject
,
pos
++);
if
(
rollCallKeys
.
contains
(
rollCallKey
))
{
return
;
}
rollCallKeys
.
add
(
rollCallKey
);
Long
lecturesAttended
=
PersistenceHelper
.
extractLong
(
rawObject
,
pos
++);
Long
lecturesAbsent
=
PersistenceHelper
.
extractLong
(
rawObject
,
pos
++);
Boolean
absenceAuthorized
;
...
...
@@ -757,7 +764,7 @@ public class LectureBlockRollCallDAO {
Date
now
=
new
Date
();
Map
<
Membership
,
LectureBlockIdentityStatistics
>
stats
=
new
HashMap
<>();
rawQuery
.
getResultStream
().
forEach
(
rawObject
->
{
int
pos
=
0
;
//jump roll call key
int
pos
=
0
;
Long
identityKey
=
(
Long
)
rawObject
[
pos
++];
String
identityName
=
(
String
)
rawObject
[
pos
++];
Long
lecturesAttended
=
PersistenceHelper
.
extractLong
(
rawObject
,
pos
++);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment