Annotation Interface TypeDiscriminator


@Documented @Retention(RUNTIME) @Target(METHOD) public @interface TypeDiscriminator
The annotation that be grouping conditional mapping definitions.

How to use:

 public interface UserMapper {
   @Select("SELECT id, name, type FROM users ORDER BY id")
   @TypeDiscriminator(
     column = "type",
     javaType = String.class,
     cases = {
       @Case(value = "1", type = PremiumUser.class),
       @Case(value = "2", type = GeneralUser.class),
       @Case(value = "3", type = TemporaryUser.class)
     }
   )
   List<User> selectAll();
 }
 
Author:
Clinton Begin