View Javadoc
1   package at.rseiler.spbee.core.annotation;
2   
3   import java.lang.annotation.Retention;
4   import java.lang.annotation.RetentionPolicy;
5   import java.lang.annotation.Target;
6   
7   import static java.lang.annotation.ElementType.*;
8   
9   /**
10   * Indicates which constructor should be used to map the result or the stored procedure.
11   * <ul>
12   * <li>
13   * Marks a public constructor in a {@link at.rseiler.spbee.core.annotation.Entity} as mapping constructor. If more than
14   * one mapping constructor is used then different  names can be used. It's not allowed that two constructors have the
15   * same name.
16   * </li>
17   * <li>
18   * Marks a method in a {@link at.rseiler.spbee.core.annotation.Dao} to use the specified mapping constructor.
19   * </li>
20   * <li>
21   * Marks a field in a {@link at.rseiler.spbee.core.annotation.ResultSet} to use the specified mapping constructor.
22   * </li>
23   * </ul>
24   *
25   * @author Reinhard Seiler {@literal <rseiler.developer@gmail.com>}
26   */
27  @Target(value = {CONSTRUCTOR, FIELD, METHOD})
28  @Retention(RetentionPolicy.SOURCE)
29  public @interface MappingConstructor {
30  
31      /**
32       * Defines the name of the mapping constructor.
33       *
34       * @return the name of the mapping constructor
35       */
36      String value() default "default";
37  }