Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): refactor merging to allow querying by custom type #800

Merged
merged 1 commit into from
Sep 1, 2020

Commits on Sep 1, 2020

  1. feat(core): refactor merging to allow querying by custom type

    This changes internal mechanism of `em.merge()`. Originally it was using
    `EntityAssigner` inside `em.merge()` together with `UoW.merge()`, which
    was called twice. Because of this, the custom types were processed multiple
    times, and the value passed to conversion method was often already converted.
    
    Now we use only the `Hydrator` for this. As a sideproduct of those changes,
    we can now query by custom types.
    
    ```typescript
    @entity()
    class A {
    
      @PrimaryKey({ type: UuidBinaryType })
      id: string = v4();
    
    }
    
    const a = await em.find(A, { id: '...' });
    ```
    
    Closes #739
    B4nan committed Sep 1, 2020
    Configuration menu
    Copy the full SHA
    8d768b3 View commit details
    Browse the repository at this point in the history