小编Owa*_*inD的帖子

如何在断开连接的系统上"repo init"?

我用镜像存储了一个存储库

repo init -u <uri of manifest> --mirror
repo sync
Run Code Online (Sandbox Code Playgroud)

并将其(通过usb)复制到与Internet断开连接的系统以及来自https://gerrit.googlesource.com/git-repo/clone.bundle的repo脚本和repo clone bundle存储库.

我现在想从镜像创建新客户端,但是当我运行命令时.

repo init -u <uri of manifest on mirror>
Run Code Online (Sandbox Code Playgroud)

我收到以下错误.

fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
fatal: error [Errno -2] Name or service not known
Run Code Online (Sandbox Code Playgroud)

所以我有clone.bundle但无法说服repo使用它.

有什么建议?

repository

12
推荐指数
1
解决办法
6593
查看次数

使用Spring Data Rest发布到集合关联

我很难创建一个可以POST的集合关联.我有两个实体,设备和组,具有多对多关系.这样设备可以是零个或多个组,组可以包含零个或多个设备.

我可以通过POST到/ api/devices和/ api/groups /创建新的设备和组实体.从我对文档的阅读中,设备集合中的设备应该有一个RestResource,它表示设备所属的组的集合(即/ api/devices/{deviceId}/groups.这是一个"关联资源",因为它是Set<Group>我的一个实例,我会认为它被认为是一个收集协会.我可以得到和PUT uri-lists到这个协会,但当我发布它,我得到一个404.

列表可能会变得非常大,我希望能够发布一个新的链接到集合关联,而不必下载整个东西修改它和PUT它回来.

documenation说,这应该是支持的,但我有没有运气.

任何建议都将非常感激.

这些域类定义为:

@Entity
public class Device {
    @Id
    @GeneratedValue
    private Long id;

    private String name;

    @ManyToMany(targetEntity = Group.class, cascade = CascadeType.ALL)
    private Set<Group> groups;

    // getters, setters
}
Run Code Online (Sandbox Code Playgroud)

和,

@Entity(name="device_groups")
public class Group {
    @Id @GeneratedValue
    private Long id;

    private String name;

    @ManyToMany(mappedBy = "groups")
    private Set<Device> devices;

    // getters, setters
}
Run Code Online (Sandbox Code Playgroud)

每个人都有一个声明的存储库:

public interface DeviceRepository extends PagingAndSortingRepository<Device, Long> {
}

public interface GroupRepository …
Run Code Online (Sandbox Code Playgroud)

rest spring jpa spring-data-rest

4
推荐指数
1
解决办法
1840
查看次数

标签 统计

jpa ×1

repository ×1

rest ×1

spring ×1

spring-data-rest ×1