question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide IdentifiedRef.set/WrappedEntity.toRef method

See original GitHub issue

Assign values to IdentifiedRefs is currently pretty clunky:

    const client = new Client();
    client.email = "bob@client.com";
    await em.persistAndFlush(client);

    const project = new Project();
    project.client = context.em.getRepository(Client).getReference(client.id, true);

It’d be nice to be able to do:

project.client.set(client);

Or

project.client = client.toRef();

Where toRef was a new method on WrappedEntity.

Or is there a similarly succinct way of doing this that I’m not seeing?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
B4nancommented, Dec 10, 2019

Reference.set and WrappedEntity.toReference are now both available in 3.0.0-rc.3.

0reactions
B4nancommented, Jan 12, 2020

Having that reference object always present, possibly wrapping null value.

Read more comments on GitHub >

github_iconTop Results From Across the Web

openapi - Swagger schema properties ignored when using $ref
A possible workaround is to wrap $ref into allOf - this can be used to "add" attributes to a $ref but not override...
Read more >
Defining Entities - MikroORM
Including { wrappedEntity: true } in your Ref property definitions will wrap the reference, providing access to helper methods like .load and .unwrap ......
Read more >
Spring Data JPA - Reference Documentation
Spring Data JPA provides repository support for the Jakarta Persistence ... exposes a complete set of methods to manipulate your entities.
Read more >
Analysis Text with graphics
Unfortunately there is no way to have text wrap around an image ... Notice that these bullets have a very small indent setting...
Read more >
ASP.NET Core Razor components - Microsoft Learn
A component's UI is defined using Razor syntax, which consists of Razor ... Component references provide a way to reference a component ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found