|
17 | 17 | import org.junit.jupiter.api.Test; |
18 | 18 | import org.locationtech.jts.util.Assert; |
19 | 19 | import org.nebula.contrib.ngbatis.models.data.NgPath; |
| 20 | +import org.nebula.contrib.ngbatis.models.data.NgTriplet; |
20 | 21 | import org.nebula.contrib.ngbatis.utils.Page; |
21 | 22 | import org.springframework.beans.factory.annotation.Autowired; |
22 | 23 | import org.springframework.boot.test.context.SpringBootTest; |
23 | 24 | import ye.weicheng.ngbatis.demo.pojo.Like; |
24 | 25 | import ye.weicheng.ngbatis.demo.pojo.LikeWithRank; |
25 | | -import org.nebula.contrib.ngbatis.models.data.NgTriplet; |
26 | 26 | import ye.weicheng.ngbatis.demo.pojo.Person; |
27 | 27 | import ye.weicheng.ngbatis.demo.repository.TestRepository; |
28 | 28 |
|
@@ -425,25 +425,27 @@ public void insertEdgeSelective() { |
425 | 425 |
|
426 | 426 | repository.insertEdgeSelective(person1, likeWithRank, person2); |
427 | 427 | } |
| 428 | + |
428 | 429 | @Test |
429 | | - public void insertEdgeBatch(){ |
430 | | - List<NgTriplet> ngTripletList = new ArrayList<>(); |
431 | | - for (int i = 0; i < 3; i++) { |
432 | | - Person person1 = new Person(); |
433 | | - person1.setName("p1_"+i); |
434 | | - repository.insertSelective(person1); |
| 430 | + public void insertEdgeBatch() { |
| 431 | + List<NgTriplet<String>> ngTripletList = new ArrayList<>(); |
| 432 | + for (int i = 0; i < 3; i++) { |
| 433 | + Person person1 = new Person(); |
| 434 | + person1.setName("p1_" + i); |
| 435 | + repository.insertSelective(person1); |
435 | 436 |
|
436 | | - Person person2 = new Person(); |
437 | | - person2.setName("p2_"+i); |
438 | | - repository.insertSelective(person2); |
| 437 | + Person person2 = new Person(); |
| 438 | + person2.setName("p2_" + i); |
| 439 | + repository.insertSelective(person2); |
439 | 440 |
|
440 | | - Like like = new Like(); |
441 | | - like.setLikeness(0.87); |
| 441 | + Like like = new Like(); |
| 442 | + like.setLikeness(0.87); |
442 | 443 |
|
443 | | - ngTripletList.add(new NgTriplet(person1,like,person2)); |
444 | | - } |
445 | | - repository.insertEdgeBatch(ngTripletList); |
| 444 | + ngTripletList.add(new NgTriplet<>(person1,like,person2)); |
| 445 | + } |
| 446 | + repository.insertEdgeBatch(ngTripletList); |
446 | 447 | } |
| 448 | + |
447 | 449 | @Test |
448 | 450 | public void upsertEdgeSelective() { |
449 | 451 | Person person1 = new Person(); |
|
0 commit comments