001package org.avaje.ebean.typequery; 002 003/** 004 * BigDecimal property. 005 * 006 * @param <E> the enum specific type 007 * @param <R> the root query bean type 008 */ 009public class PEnum<R,E> 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 PEnum(String name, R root) { 018 super(name, root); 019 } 020 021 /** 022 * Construct with additional path prefix. 023 */ 024 public PEnum(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(E value) { 035 expr().eq(name, value); 036 return root; 037 } 038 039 /** 040 * Is not equal to. 041 * 042 * @param value the equal to bind value 043 * @return the root query bean instance 044 */ 045 public R notEqualTo(E value) { 046 expr().ne(name, value); 047 return root; 048 } 049 050 /** 051 * Is equal to. 052 * 053 * @param value the equal to bind value 054 * @return the root query bean instance 055 */ 056 public R eq(E value) { 057 expr().eq(name, value); 058 return root; 059 } 060 061 /** 062 * Is not equal to. 063 * 064 * @param value the equal to bind value 065 * @return the root query bean instance 066 */ 067 public R ne(E value) { 068 expr().ne(name, value); 069 return root; 070 } 071 072 /** 073 * Is in a list of values. 074 * 075 * @param values the list of enum values for the predicate 076 * @return the root query bean instance 077 */ 078 public R in(E... values) { 079 expr().in(name, values); 080 return root; 081 } 082 083 /** 084 * Is NOT in a list of values. 085 * 086 * @param values the list of enum values for the predicate 087 * @return the root query bean instance 088 */ 089 public R notIn(E... values) { 090 expr().notIn(name, values); 091 return root; 092 } 093 094}