File tree Expand file tree Collapse file tree 5 files changed +18
-2
lines changed
src/main/java/com/going/server/domain Expand file tree Collapse file tree 5 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 1616public class Cluster {
1717 @ Id
1818 @ GeneratedValue
19+ private Long id ;
20+
21+ @ Property ("cluster_id" )
1922 private Long clusterId ;
2023
2124 @ Property ("represent_word" )
Original file line number Diff line number Diff line change 55import org .springframework .data .neo4j .repository .Neo4jRepository ;
66import org .springframework .stereotype .Repository ;
77
8+ import java .util .Optional ;
9+
810@ Repository
911public interface ClusterRepository extends Neo4jRepository <Cluster , Long > {
1012 Cluster findByRepresentWord (String word );
1113
14+ Optional <Cluster > findByClusterId (Long clusterId );
15+
1216 default Cluster getByCluster (Long clusterId ) {
13- return findById (clusterId ).orElseThrow (ClusterNotFoundException ::new );
17+ return findByClusterId (clusterId ).orElseThrow (ClusterNotFoundException ::new );
1418 }
1519}
Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ public class Sentence {
1414
1515 @ Id
1616 @ GeneratedValue
17+ private Long id ;
18+
19+ @ Property ("sentence_id" )
1720 private Long sentenceId ;
1821
1922 @ Property ("sentence" )
Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ public class Word {
1414
1515 @ Id
1616 @ GeneratedValue
17+ private Long id ;
18+
19+ @ Property ("word_id" )
1720 private Long wordId ;
1821
1922 @ Property ("compose_word" )
Original file line number Diff line number Diff line change 66import org .springframework .stereotype .Repository ;
77
88import java .util .List ;
9+ import java .util .Optional ;
910
1011@ Repository
1112public interface WordRepository extends Neo4jRepository <Word , Long > {
13+ Optional <Word > findByWordId (Long wordId );
14+
1215 List <Word > findByCluster_ClusterId (Long clusterId );
1316
1417 default Word getByWord (Long wordId ) {
15- return findById (wordId ).orElseThrow (WordNotFoundException ::new );
18+ return findByWordId (wordId ).orElseThrow (WordNotFoundException ::new );
1619 }
1720}
You can’t perform that action at this time.
0 commit comments