package pl.openrest.filters.predicate.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import pl.openrest.filters.query.annotation.Join;
/**

 * @author Szymon Konicki
 *
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Predicate {
	/**
	 * Flag indicating whether this predicate could be used in filters
	 * query parameter
	 * 
	 */
	boolean exported() default true;

	String name() default "";

	boolean defaultedPageable() default true;

	/**
	 * Flag indicating whether this expression method could be used as search method in url /{repository}/search/{searchMethod}
	 */
	
	boolean search() default false;
	
	
	/**
	 * Joins that will be added to query
	 * 
	 */

	Join[] joins() default {};
}

@@ -256,20 +256,24 @@
 n.Join;%0A
+%0A
 /**%0A
+ * 
 %0A * @aut
@@ -392,22 +392,28 @@
 icate %7B%0A
-%09/**%0A%09
+    /**%0A    
  * Flag 
@@ -470,20 +470,16 @@
  filters
-%0A%09 *
  query p
@@ -491,19 +491,28 @@
 ter%0A
-%09 * %0A%09 */%0A%09
+     * %0A     */%0A    
 bool
@@ -541,17 +541,20 @@
  true;%0A%0A
-%09
+    
 String n
@@ -572,17 +572,20 @@
 lt %22%22;%0A%0A
-%09
+    
 boolean 
@@ -619,22 +619,28 @@
  true;%0A%0A
-%09/**%0A%09
+    /**%0A    
  * Flag 
@@ -759,58 +759,85 @@
 od%7D%0A
-%09 */%0A%09%0A%09boolean search() default false;%0A%09%0A%09%0A%09/**%0A%09
+     */%0A%0A    PredicateType type() default PredicateType.SEARCH;%0A%0A    /**%0A    
  * J
@@ -873,20 +873,29 @@
 ery%0A
-%09 * %0A%09
+     * %0A    
  */%0A%0A
-%09
+    
 Join
@@ -916,11 +916,74 @@
 ault %7B%7D;
+%0A%0A    public enum PredicateType %7B%0A        SEARCH, FILTER;%0A    %7D
 %0A%7D%0A

Change boolean flag search to PredicateType