小编Muk*_*mar的帖子

如何将本地Spring Cloud任务项目jar文件注册到Spring Cloud数据流仪表板

我正在尝试将本地 Spring Cloud 任务 jar 文件注册到 Spring Cloud 任务数据流图形界面中。注册应用程序时,未识别本地路径,并且未启用“注册”按钮。我的 jar 文件位置是C:\STS-WORK_SPACE\SPRING-BATCH\SCDFBatch\target\SCDFBatch-0.0.1-SNAPSHOT.jar,我在仪表板中提供的路径是file:///C:/STS-WORK_SPACE/SPRING -BATCH/SCDFBatch/target/SCDFBatch-0.0.1-SNAPSHOT.jar。如果我在这里错了,请纠正我。我这里需要有人帮助。

spring spring-cloud-dataflow

5
推荐指数
1
解决办法
3007
查看次数

外键未保存在 Spring Rest 应用程序中

我正在尝试使用 Spring Data JPA 实现双向一对多关系。我已经创建了用于保存和获取数据的测试用例,并且映射中没有问题,并且数据都保存在两个表中。但是当我尝试通过点击 Post 请求来创建数据时,外键没有被保存。客户和电话之间的映射是双向的一对多。

一对多1应用程序

package com.jwt.onetomany;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class OneToMany1Application {

    public static void main(String[] args) {
        SpringApplication.run(OneToMany1Application.class, args);
    }
}
Run Code Online (Sandbox Code Playgroud)

演示控制器

package com.jwt.onetomany.controller;

import java.net.URI;
import java.util.List;

import org.apache.tomcat.jni.Poll;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;

import com.jwt.onetomany.entity.Customer;
import com.jwt.onetomany.repo.CustomerRepository;

@RestController
public class DemoController {

    @Autowired
    CustomerRepository customerRepository;

    @GetMapping("/getall")
    ResponseEntity<List<Customer>> getAllCustomers() {

        Iterable<Customer> findAll = customerRepository.findAll();
        List<Customer> customers …
Run Code Online (Sandbox Code Playgroud)

rest hibernate spring-data-jpa spring-restcontroller spring-rest

3
推荐指数
1
解决办法
5706
查看次数