You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: notes - newLearnings
+17
Original file line number
Diff line number
Diff line change
@@ -3,3 +3,20 @@ profile pic is saved in database, but it slows the application to load from ther
3
3
therefore will be generating & storing in an external directory,
4
4
so frontend can access it directly as a resource.
5
5
External directly - because storing new user uploads or img changes in 'src/resource/' folder is not recommended during runtime, it may work during development, but once it is packaged into a jar, any directory or files inside the src folder are not accessible for runtime operations like file creation or modification.
6
+
7
+
-> every small change asks demands for best user experience vs
8
+
9
+
-> making use of @OrderBy("[ColumnName] [SortDir]") on
10
+
Hibernate will return the list of seasons sorted by seasonNo in ascending order without requiring any manual sorting in Java or a custom query.
11
+
the @OrderBy annotation in JPA can only be applied to collection-based relationships (i.e. @OneToMany or @ManyToMany) that involve a parent-child mapping, such as @OneToMany or @ManyToMany relationships.
12
+
13
+
-> in this code :
14
+
15
+
```
16
+
@Formula(value = "(SELECT COALESCE(SUM(ep.runtime), 0) FROM episode AS ep"
17
+
+" WHERE ep.tmdb_id = tmdb_id"
18
+
+" AND ep.season_no > 0)")
19
+
private int totalRuntime = 0;
20
+
```
21
+
22
+
the Query in the formula returns a number or null if not used COALESCE, in case it returns null, then int cannot handle it even if it has default set to 0
0 commit comments