Is there a way to do a Ref get with @Load in a query if you only have an ID for a property?
Normally a Ref would look like this:
@Entity
class Car {
@Id Long id;
@Load Ref<Person> driver;
}
But what if you had this:
@Entity
class Car {
@Id Long id;
Long driverId; // You know this is a Person entity
}
Storing Keys as a property in an entity is useful when using Ref with @Load but Keys are at least 4x larger than a simple long ID.
A long is 8 bytes but a key (depending on the entity name) is 16 bytes + 8 bytes for long id + string length of entity name (e.g. 8 bytes) = 32 bytes.
If there is a way to @Load entities without storing keys, it would save a bit of space.