File tree 4 files changed +32
-1
lines changed
src/main/java/org/soujava/samples/mongodb/products
4 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 4
4
import jakarta .nosql .Embeddable ;
5
5
6
6
@ Embeddable (Embeddable .EmbeddableType .GROUPING )
7
- public record Category (@ Column String name , @ Column String description ) {
7
+ public class Category {
8
+
9
+ @ Column
10
+ private String name ;
11
+
12
+ @ Column
13
+ private String description ;
8
14
}
Original file line number Diff line number Diff line change 1
1
package org .soujava .samples .mongodb .products ;
2
2
3
+ import jakarta .json .bind .annotation .JsonbVisibility ;
3
4
import jakarta .nosql .Column ;
4
5
import jakarta .nosql .Embeddable ;
6
+ import org .soujava .samples .mongodb .products .infra .FieldVisibilityStrategy ;
5
7
6
8
@ Embeddable (Embeddable .EmbeddableType .GROUPING )
9
+ @ JsonbVisibility (FieldVisibilityStrategy .class )
7
10
public class Manufacturer {
8
11
9
12
@ Column
Original file line number Diff line number Diff line change 1
1
package org .soujava .samples .mongodb .products ;
2
2
3
+ import jakarta .json .bind .annotation .JsonbVisibility ;
3
4
import jakarta .nosql .Column ;
4
5
import jakarta .nosql .Entity ;
5
6
import jakarta .nosql .Id ;
7
+ import org .soujava .samples .mongodb .products .infra .FieldVisibilityStrategy ;
6
8
7
9
import java .util .List ;
8
10
import java .util .Set ;
9
11
10
12
@ Entity
13
+ @ JsonbVisibility (FieldVisibilityStrategy .class )
11
14
public class Product {
12
15
13
16
@ Id
Original file line number Diff line number Diff line change
1
+ package org .soujava .samples .mongodb .products .infra ;
2
+
3
+ import jakarta .json .bind .config .PropertyVisibilityStrategy ;
4
+
5
+ import java .lang .reflect .Field ;
6
+ import java .lang .reflect .Method ;
7
+
8
+ public class FieldVisibilityStrategy implements PropertyVisibilityStrategy {
9
+
10
+ @ Override
11
+ public boolean isVisible (Field field ) {
12
+ return true ;
13
+ }
14
+
15
+ @ Override
16
+ public boolean isVisible (Method method ) {
17
+ return true ;
18
+ }
19
+ }
You can’t perform that action at this time.
0 commit comments