hollow
hollow copied to clipboard
Support transitive primary keys
Several of our model classes use a compound primary key:
Module @PrimaryKey(id.organization, id.name, id.version, id.type) {
ModuleVersionIdentifier id;
ListOfListOfModuleDependency dependencies;
ModuleMetadata metadata;
Owner owner;
}
Rather than define the compound key on each type that uses it, it'd be really useful to be able to define it on the original type, and have references transitively pickup the definition of the key:
Module @PrimaryKey(id) {
ModuleVersionIdentifier id;
...
}
ModuleVersionIdentifier @PrimaryKey(organization, name, version, type) {
String organization;
String name;
String version;
Status status;
ModuleType type;
}
That could also extend to allowing the generated index classes to take an object instance of the generated type, and convert it into a query.