commentGenerator.addGeneralMethodComment(method, introspectedTable);
topLevelClass.addMethod(method);
// add field, getter, setter for orderby clause
Field field = new Field();
field.setVisibility(JavaVisibility.PROTECTED);
field.setType(FullyQualifiedJavaType.getStringInstance());
field.setName("orderByClause"); //$NON-NLS-1$
commentGenerator.addFieldComment(field, introspectedTable);
topLevelClass.addField(field);
method = new Method();
method.setVisibility(JavaVisibility.PUBLIC);
method.setName("setOrderByClause"); //$NON-NLS-1$
method.addParameter(new Parameter(FullyQualifiedJavaType
.getStringInstance(), "orderByClause")); //$NON-NLS-1$
method.addBodyLine("this.orderByClause = orderByClause;"); //$NON-NLS-1$
commentGenerator.addGeneralMethodComment(method, introspectedTable);
topLevelClass.addMethod(method);
method = new Method();
method.setVisibility(JavaVisibility.PUBLIC);
method.setReturnType(FullyQualifiedJavaType.getStringInstance());
method.setName("getOrderByClause"); //$NON-NLS-1$
method.addBodyLine("return orderByClause;"); //$NON-NLS-1$
commentGenerator.addGeneralMethodComment(method, introspectedTable);
topLevelClass.addMethod(method);
// add field, getter, setter for distinct
field = new Field();
field.setVisibility(JavaVisibility.PROTECTED);
field.setType(FullyQualifiedJavaType.getBooleanPrimitiveInstance());
field.setName("distinct"); //$NON-NLS-1$
commentGenerator.addFieldComment(field, introspectedTable);
topLevelClass.addField(field);
method = new Method();
method.setVisibility(JavaVisibility.PUBLIC);
method.setName("setDistinct"); //$NON-NLS-1$
method.addParameter(new Parameter(FullyQualifiedJavaType
.getBooleanPrimitiveInstance(), "distinct")); //$NON-NLS-1$
method.addBodyLine("this.distinct = distinct;"); //$NON-NLS-1$
commentGenerator.addGeneralMethodComment(method, introspectedTable);
topLevelClass.addMethod(method);
method = new Method();
method.setVisibility(JavaVisibility.PUBLIC);
method.setReturnType(FullyQualifiedJavaType
.getBooleanPrimitiveInstance());
method.setName("isDistinct"); //$NON-NLS-1$
method.addBodyLine("return distinct;"); //$NON-NLS-1$
commentGenerator.addGeneralMethodComment(method, introspectedTable);
topLevelClass.addMethod(method);
// add field and methods for the list of ored criteria
field = new Field();
field.setVisibility(JavaVisibility.PROTECTED);
FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType(
"java.util.List<Criteria>"); //$NON-NLS-1$
field.setType(fqjt);
field.setName("oredCriteria"); //$NON-NLS-1$
commentGenerator.addFieldComment(field, introspectedTable);
topLevelClass.addField(field);
method = new Method();
method.setVisibility(JavaVisibility.PUBLIC);