String getWhereClause ( ) { final StringGrabber sgWhere = new StringGrabber ( ) ; List < Field > primaryKeyFieldList = getPrimaryKeyFieldList ( ) ; if ( primaryKeyFieldList . size ( ) > 0 ) { sgWhere . append ( "WHERE " ) ; for ( Field field : primaryKeyFieldList ) { DBColumn dbColumn = field . getAnnotation ( DBColumn . class ) ; sgWhere . append ( dbColumn . columnName ( ) ) ; sgWhere . append ( " = ? AND " ) ; } sgWhere . removeTail ( 5 ) ; } return sgWhere . toString ( ) ; }
generate where clause of current model class