contactbyidquery.java

来自「Java的框架」· Java 代码 · 共 51 行

JAVA
51
字号
package mcaps.apps.prrm.roaddefect.dao.jdbc.query;

import javax.sql.DataSource;

import mcaps.apps.prrm.roaddefect.dao.util.ContactField;
import mcap.core.base.dao.util.SortOrder;

/**
 * This class extends the ContactQuery class to generate the 
 * precompiled sql query statements to the contact table using
 * the id as query parameter.
 * 
 * @author jov
 * @date Sep 23, 2005
 * @version 1.0.1.0
 */
public class ContactByIdQuery extends ContactQuery {
		
	/**
	 * Default constructor which accepts the datasource and
	 * initialize the super class for creation of precompiled 
	 * sql statement for querying database table. The ID is used 
	 * as query parameter.
	 * @param ds the datasource to the database
	 */
		public ContactByIdQuery(DataSource ds) {
			super(ds,
					ContactField.FIELDS[ContactField.ID] + " = ?",
					new int[]{ContactField.FIELDTYPES[ContactField.ID]});
		}
		
		/**
		 * Constructor which accepts the datasource and
		 * initialize the super class for creation of precompiled 
		 * sql statement for querying database table. The ID is used 
		 * as query parameter. This constructor enable the choice for
		 * sorted query results.
		 * @param ds the datasource to the database
		 * @param sortColumn the column used to sort the records
		 * @param order the sort order for sorting the records
		 */
		public ContactByIdQuery(DataSource ds, int sortColumn, SortOrder order) {
			super(ds,
					ContactField.FIELDS[ContactField.ID] + " = ?",
					new int[]{ContactField.FIELDTYPES[ContactField.ID]},
					sortColumn,
					order);
		}
		
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?