Protocol.java 1.91 KB
package it.softecspa.fileproxy.db;
/*
 * @(#)Protocol.java	1.7.1,126 custom	2014-06-15T22:00:00Z UTC
 * Built automatically by REVERSER
 */

import it.softecspa.database.dbconnect.ConnectionManager;
import it.softecspa.database.dbconnect.DatabaseStatement;
import it.softecspa.database.dbconnect.NoRecordFoundException;
import it.softecspa.fileproxy.db.criterias.ProtocolCriteria;
import it.softecspa.kahuna.sql.SqlWriter;

import java.sql.SQLException;

/**
 * Customizable manager for table T015_PROTOCOL
 * Class auto generated by REVERSER, version 1.7.1,126 custom
 * 
 * @author il Vera
 */
public class Protocol extends it.softecspa.fileproxy.db.skins.ProtocolSkin {

	public Protocol() {
		super();
	}

	/**
	 * Extract bean using key
	 */
	public Protocol(ConnectionManager cm, Integer protocol) throws NoRecordFoundException, SQLException {
		super(cm, protocol);
	}

	/**
	 * Execute select * with criteria
	 * @throws SQLException if there is an error in your query
	 */
	public static Protocol[] select(ProtocolCriteria criteria) throws SQLException {
		SqlWriter sql = criteria.getSelect();
		return (Protocol[])(new Protocol()).getRows(criteria.getConnectionManager(), sql.costruisciSelect());
	}

	/**
	 * Customizable update method
	 * @param updateType operation to execute
	 * @param dbs DatabaseStatement that perform operation
	 * @return number of update rows or new autoincrement id
	 * @throws SQLException if there is an error in your query
	 */
	@Override
	public int updateRecord(UpdateType updateType, DatabaseStatement dbs) throws SQLException {
		// Insert here your custom code
		return super.updateRecord(updateType, dbs);
	}
	
	@Override
	public Protocol clone() {
		try {
			Protocol c = (Protocol) super.clone();
			// Insert custom clonable objects
			return c;
		} catch (CloneNotSupportedException e) {
			throw new RuntimeException(e);
		}
	}

}