标签: fetch

git fetch不会获取所有分支

我已经克隆了一个存储库,之后其他人创建了一个新的分支,我想开始研究它.我阅读了手册,看起来很简单.奇怪的是它不起作用,我发现的所有帖子都表明我做的是正确的.因此,我会让自己受到抨击,因为这一定有明显的错误:

似乎是正确的行动

git fetch
git branch -a
* master
  remotes/origin/HEAD --> origin/master
  remotes/origin/master
git checkout -b dev-gml origin/dev-gml
Run Code Online (Sandbox Code Playgroud)

此时出现问题,由于某些原因git fetch我无法看到dev-gml远程分支.为什么不?如果我新近克隆存储库,它就在那里,所以远程分支肯定存在:

$ mkdir ../gitest
$ cd ../gitest
$ git clone https://github.com/example/proj.git
Cloning into proj...
remote: Counting objects: 1155, done.
remote: Compressing objects: 100% (383/383), done.
remote: Total 1155 (delta 741), reused 1155 (delta 741)
Receiving objects: 100% (1155/1155), 477.22 KiB | 877 KiB/s, done.
Resolving deltas: 100% (741/741), done.
$ cd projdir
$ git branch -a …
Run Code Online (Sandbox Code Playgroud)

git branch fetch git-fetch

162
推荐指数
8
解决办法
10万
查看次数

Hibernate中JOIN和JOIN FETCH之间的区别

请帮助我了解在哪里使用常规JOIN以及JOIN FETCH的位置.

例如,如果我们有这两个查询

FROM Employee emp
JOIN emp.department dep
Run Code Online (Sandbox Code Playgroud)

和

FROM Employee emp
JOIN FETCH emp.department dep
Run Code Online (Sandbox Code Playgroud)

它们之间有什么区别吗?如果是的话,哪一个使用的时候?

java hibernate join hql fetch

158
推荐指数
5
解决办法
17万
查看次数

从ReadableStream对象中检索数据?

如何从ReadableStream对象获取信息?

我正在使用Fetch API,我没有从文档中看到这一点.

正文作为ReadableStream返回,我只想访问此流中的属性.在浏览器开发工具的响应下,我似乎将这些信息以Javascript对象的形式组织到属性中.

fetch('http://192.168.5.6:2000/api/car', obj)
    .then((res) => {
        if(res.status == 200) {
            console.log("Success :" + res.statusText);   //works just fine
        }
        else if(res.status == 400) {
            console.log(JSON.stringify(res.body.json());  //res.body is undefined.
        }

        return res.json();
    })
Run Code Online (Sandbox Code Playgroud)

提前致谢.

javascript fetch node.js reactjs

98
推荐指数
8
解决办法
8万
查看次数

在NHibernate Linq提供程序中获取vs FetchMany

NHibernate渴望加载可以使用Fetch和完成FetchMany,如在Mike Hadlow博客上的NHibernate Linq Eager Fetching中所述.

这两种方法有什么区别,在什么情况下都会使用?

linq nhibernate fetch eager-loading

74
推荐指数
1
解决办法
2万
查看次数

PDO :: fetchAll与PDO ::在循环中获取

只是一个简单的问题.

在循环中使用PDO :: fetchAll()和PDO :: fetch()之间是否有任何性能差异(对于大型结果集)?

我正在获取用户定义类的对象,如果这有任何区别.

我最初没有受过教育的假设是fetchAll可能更快,因为PDO可以在一个语句中执行多个操作,而mysql_query只能执行一个.但是我对PDO的内部工作知之甚少,而且文档没有说明这一点,以及fetchAll()是否只是一个转储到数组中的PHP端循环.

有帮助吗?

php mysql pdo fetch

69
推荐指数
4
解决办法
8万
查看次数

查询指定的连接提取,但提取的关联的所有者不在选择列表中

我正在选择两个id列但指定了错误:

org.hibernate.QueryException: **query specified join fetching, but the owner of the fetched association was not present in the select list** 

[FromElement{explicit,not a collection join,fetch join,fetch non-lazy properties,classAlias=r,role=null,tableName=REVISIONS,tableAlias=revision1_,origin=ENTITY_CHANGED_IN_REVISION entitychan0_,columns={entitychan0_.REV_ID ,className=ru.csbi.registry.domain.envers.Revision}}] [ select ec.id as entityChangeId, r.id as revisionId from ru.csbi.registry.domain.envers.EntityChange as ec  inner join fetch ec.revision as r  where ec.groupEntityId = :groupEntityId and ec.groupName = :groupName  and r.timestamp < :entityDateFrom  and r.timestamp > :entityDateTo  and (        ec.revisionType in (0, 5, 1, 4, 2 )       and not ( ec.otherGroupEntityModified = false and …
Run Code Online (Sandbox Code Playgroud)

hibernate join fetch

67
推荐指数
3
解决办法
7万
查看次数

React useEffect 导致:无法对未安装的组件执行 React 状态更新

获取数据时,我得到:无法对未安装的组件执行 React 状态更新。该应用程序仍然有效,但反应表明我可能导致内存泄漏。

这是一个空操作,但它表明您的应用程序中存在内存泄漏。要修复,请取消 useEffect 清理函数中的所有订阅和异步任务。”

为什么我不断收到此警告?

我尝试研究这些解决方案:

https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal

https://developer.mozilla.org/en-US/docs/Web/API/AbortController

但这仍然给了我警告。

const  ArtistProfile = props => {
  const [artistData, setArtistData] = useState(null)
  const token = props.spotifyAPI.user_token

  const fetchData = () => {
    const id = window.location.pathname.split("/").pop()
    console.log(id)
    props.spotifyAPI.getArtistProfile(id, ["album"], "US", 10)
    .then(data => {setArtistData(data)})
  }
  useEffect(() => {
    fetchData()
    return () => { props.spotifyAPI.cancelRequest() }
  }, [])
  
  return (
    <ArtistProfileContainer>
      <AlbumContainer>
        {artistData ? artistData.artistAlbums.items.map(album => {
          return (
            <AlbumTag
              image={album.images[0].url}
              name={album.name}
              artists={album.artists}
              key={album.id}
            />
          )
        })
        : null}
      </AlbumContainer>
    </ArtistProfileContainer> …
Run Code Online (Sandbox Code Playgroud)

javascript fetch reactjs react-hooks

67
推荐指数
6
解决办法
16万
查看次数

使用多部分表单数据获取帖子

我正在获取这样的URL:

fetch(url, {
  mode: 'no-cors',
  method: method || null,
  headers: {
    'Accept': 'application/json, application/xml, text/plain, text/html, *.*',
    'Content-Type': 'multipart/form-data'
  },
  body: JSON.stringify(data) || null,
}).then(function(response) {
  console.log(response.status)
  console.log("response");
  console.log(response)
})
Run Code Online (Sandbox Code Playgroud)

我的API期望数据是multipart/form-data这样的,我正在使用content-type这种类型......但是它给了我一个状态代码为400的响应.

我的代码出了什么问题?

javascript fetch fetch-api

65
推荐指数
2
解决办法
10万
查看次数

Hibernate获取策略 - 何时使用"join"以及何时使用"select"?

大多数Hibernate关联都支持"fetch"参数:

fetch="join|select"
Run Code Online (Sandbox Code Playgroud)

"select"是默认值.

如何决定使用哪一个关联?

我尝试将所有内容从"选择"更改为"加入"应用程序范围 - 生成的查询数量减少了10倍,但性能保持完全相同(甚至变得更糟糕).

谢谢.

hibernate fetch

47
推荐指数
2
解决办法
5万
查看次数

Spring Data JPA和NamedEntityGraphs

目前我正在努力只能获取我需要的数据.findAll()方法需要根据其被调用的位置获取数据.我不想最终为每个实体图编写不同的方法.此外,我会避免调用实体管理员并自己形成(重复)查询.基本上我想在findAll方法中使用构建,但是使用我喜欢的实体图.任何机会?

@Entity
@Table(name="complaints")
@NamedEntityGraphs({
    @NamedEntityGraph(name="allJoinsButMessages", attributeNodes = {
            @NamedAttributeNode("customer"),
            @NamedAttributeNode("handling_employee"),
            @NamedAttributeNode("genre")
    }),
    @NamedEntityGraph(name="allJoins", attributeNodes = {
            @NamedAttributeNode("customer"),
            @NamedAttributeNode("handling_employee"),
            @NamedAttributeNode("genre"),
            @NamedAttributeNode("complaintMessages")
    }),
    @NamedEntityGraph(name="noJoins", attributeNodes = {

    })
})
public class Complaint implements Serializable{
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue
    private long id;

    private Timestamp date;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "customer")
    private User customer;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "handling_employee")
    private User handling_employee;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name="genre")
    private Genre genre;

    private boolean closed;

    @OneToMany(mappedBy = "complaint", fetch = …
Run Code Online (Sandbox Code Playgroud)

jpa fetch spring-data-jpa entitygraph

47
推荐指数
4
解决办法
3万
查看次数