Created by Papa on 8/20/2016.
 
Annotates Id fields of Entities.

@returns {function(any, string)}
@constructor
function Id() {
    return function (targetObject, propertyKey) {
        var entityMetadata = targetObject;
        if (entityMetadata.idProperty) {
            throw "Cannot set primary key to '" + propertyKey + "', it is already set to '" + entityMetadata.idProperty + "'";
        }
        entityMetadata.idProperty = propertyKey;
    };
}