File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed
data-platform/autonomous-database/autonomous-json/SpringBootDemo/src/main/java/com/oracle Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+
2+ package com .oracle ;
3+
4+ import org .springframework .data .annotation .Id ;
5+ import org .springframework .data .mongodb .core .mapping .Document ;
6+ import org .springframework .data .mongodb .core .mapping .Field ;
7+
8+ @ Document (collection = "colors" )
9+ public class Color {
10+ @ Id
11+ private String objectId ;
12+
13+ @ Field (name = "name" )
14+ private String name ;
15+
16+ public Color () {}
17+
18+ public Color (String id , String name ) {
19+ this .objectId = id ;
20+ this .name = name ;
21+ }
22+
23+ public void setObjectId (String id ) {
24+ this .objectId = id ;
25+ }
26+
27+ public String getObjectId () {
28+ return this .objectId ;
29+ }
30+
31+ public void setName (String name ) {
32+ this .name = name ;
33+ }
34+
35+ public String getName () {
36+ return name ;
37+ }
38+
39+ public String toString () {
40+ return this .objectId +" : " +this .name ;
41+ }
42+
43+ @ Override
44+ public final boolean equals (Object o ) {
45+ if (!(o instanceof Color color )) return false ;
46+
47+ return getObjectId ().equals (color .getObjectId ());
48+ }
49+ }
You can’t perform that action at this time.
0 commit comments