ch.elca.el4j.services.persistence.generic.dao.annotations
Annotation Type ReturnsUnchangedParameter


@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface ReturnsUnchangedParameter

The annotated method returns a parameter without changing it. The annotations' value contains the index of the parameter returned; it defaults to 0, i.e. the first parameter.

More precisely, this annotation states that the method's return value is logically and transitively identical to the value passed. Logically identical means that the returned object has the same logical identity, transitive means that this must hold for all references reachable through it as well. Note that objects without logical identity are trivially logically identical, ending the recursion. Logical identity is defined by the subclass of AbstractIdentityFixer in use.

For instance,

    @ReturnsUnchangedParameter
    T saveOrUpdate(T entity);
means that saving an object returns the saved object, which is logically identical to its former version.

As of JDK 1.5, it is impossible to inherit method annotations when overriding/implementing a method; such annotations must therefore be provided manually.

Author:
Adrian Moos (AMS)
See Also:
AbstractIdentityFixer
File-location:
ReturnsUnchangedParameter
Last check-in date:
2009-08-04 15:35:01 +0200 (Di, 04. Aug 2009) by swismer for revision 3883

Optional Element Summary
 int value
          The index of the parameter returned.
 

value

public abstract int value
The index of the parameter returned. The first parameter has index 0.

Default:
0


Copyright © 2005-2011 ELCA. All Rights Reserved.