001package org.avaje.ebean.typequery; 002 003/** 004 * Base property for date and date time types. 005 * 006 * @param <R> the root query bean type 007 * @param <D> the date time type 008 */ 009public abstract class PBaseDate<R,D> extends TQProperty<R> { 010 011 /** 012 * Construct with a property name and root instance. 013 * 014 * @param name property name 015 * @param root the root query bean instance 016 */ 017 public PBaseDate(String name, R root) { 018 super(name , root); 019 } 020 021 /** 022 * Construct with additional path prefix. 023 */ 024 public PBaseDate(String name, R root, String prefix) { 025 super(name, root, prefix); 026 } 027 028 /** 029 * Is equal to. 030 * 031 * @param value the equal to bind value 032 * @return the root query bean instance 033 */ 034 public R equalTo(D value) { 035 expr().eq(name, value); 036 return root; 037 } 038 039 /** 040 * Same as greater than. 041 * 042 * @param value the equal to bind value 043 * @return the root query bean instance 044 */ 045 public R after(D value) { 046 expr().gt(name, value); 047 return root; 048 } 049 050 /** 051 * Same as less than. 052 * 053 * @param value the equal to bind value 054 * @return the root query bean instance 055 */ 056 public R before(D value) { 057 expr().lt(name, value); 058 return root; 059 } 060 061 /** 062 * Is equal to. 063 * 064 * @param value the equal to bind value 065 * @return the root query bean instance 066 */ 067 public R eq(D value) { 068 expr().eq(name, value); 069 return root; 070 } 071 072 /** 073 * Greater than. 074 * 075 * @param value the equal to bind value 076 * @return the root query bean instance 077 */ 078 public R gt(D value) { 079 expr().gt(name, value); 080 return root; 081 } 082 083 /** 084 * Less than. 085 * 086 * @param value the equal to bind value 087 * @return the root query bean instance 088 */ 089 public R lt(D value) { 090 expr().lt(name, value); 091 return root; 092 } 093 094 /** 095 * Greater than or equal to. 096 * 097 * @param value the equal to bind value 098 * @return the root query bean instance 099 */ 100 public R ge(D value) { 101 expr().ge(name, value); 102 return root; 103 } 104 105 /** 106 * Less than or equal to. 107 * 108 * @param value the equal to bind value 109 * @return the root query bean instance 110 */ 111 public R le(D value) { 112 expr().le(name, value); 113 return root; 114 } 115 116 /** 117 * Between lower and upper values. 118 * 119 * @param lower the lower bind value 120 * @param upper the upper bind value 121 * @return the root query bean instance 122 */ 123 public R between(D lower, D upper) { 124 expr().between(name, lower, upper); 125 return root; 126 } 127}