Advertisement
pakuula

QueryField

Feb 10th, 2021
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.44 KB | None | 0 0
  1. package org.example.query;
  2.  
  3. import java.lang.annotation.*;
  4.  
  5. // Keep annotation in generated byte code
  6. @Retention(RetentionPolicy.RUNTIME)
  7. // Compiler hint: the annotation should be applied to fields only
  8. @Target(ElementType.FIELD)
  9. public @interface QueryField {
  10.     // Custom field name in the generated query string
  11.     public String name() default "";
  12.     // If `true` the field value must be non-null
  13.     public boolean required() default true;
  14. }
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement