
com.yahoo.elide.annotation.EntityId Maven / Gradle / Ivy
/*
* Copyright 2024, the original author or authors.
* Licensed under the Apache License, Version 2.0
* See LICENSE file in project root for terms.
*/
package com.yahoo.elide.annotation;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
/**
* Indicates the field or property that represents the identity of the entity.
*
* This is intended to be used if the primary key undesirably leaks information
* about the record and to designate another field or property as the entity
* identifier.
*
* Another option instead of using another field or column as the entity
* identifier is to obfuscate the id directly.
*
* The following are some things to consider when choosing the entity id.
*
* - Opaque token
* - Cryptographically secure
* - Implementation only based on Randomness
* - Predictability of the ID
* - Leaks the count of items
* - Leaks information about the machine/process
* - Leaks the date of creation
*
*/
@Target({ METHOD, FIELD })
@Retention(RUNTIME)
public @interface EntityId {
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy