agrestio / agrest

Server-side Java REST Framework for easy access to data graphs from various backends
https://agrest.io
Apache License 2.0
80 stars 34 forks source link

Proper handling of ObjectId annotated with @AgId #617

Closed andrus closed 1 year ago

andrus commented 1 year ago

Annotating "objectId" property of a Cayenne object with @AgId creates inconsistencies that cause issues #613 :

@Override
@AgId(readable = false, writable = false)
public ObjectId getObjectId() {
    return super.getObjectId();
}

Let's detect this specific case when merging annotated properties, and generate IDs that are the same as generated by default by CayenneAgEntityCompiler, except for the access rules taken from the annotation.