Provide IdentifiedRef.set/WrappedEntity.toRef method
See original GitHub issueAssign 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:
- Created 4 years ago
- Comments:9 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Reference.set
andWrappedEntity.toReference
are now both available in3.0.0-rc.3
.Having that reference object always present, possibly wrapping null value.