gt:             if (value != null && ! Integer.class.isInstance(value))
context: /**
   * Genji Scrum Tool and Issue Tracker
   * Copyright (C) 2015 Steinbeis GmbH & Co. KG Task Management Solutions
  
   * <a href="http://www.trackplus.com">Genji Scrum Tool</a>
   *
   * This program is free software: you can redistribute it and/or modify
   * it under the terms of the GNU General Public License as published by
   * the Free Software Foundation, either version 3 of the License, or
   * (at your option) any later version.
   *
   * This program is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
   * GNU General Public License for more details.
   *
   * You should have received a copy of the GNU General Public License
   * along with this program. If not, see <http://www.gnu.org/licenses/>.
   */
  
  /* $Id:$ */
  
  package com.aurel.track.persist;
  
  
  import java.math.BigDecimal;
  import java.sql.Connection;
  import java.util.ArrayList;
  import java.util.Collections;
  import java.util.Date;
  import java.util.List;
  
  import org.apache.commons.lang.ObjectUtils;
  import org.apache.torque.TorqueException;
  import org.apache.torque.map.TableMap;
  import org.apache.torque.om.BaseObject;
  import org.apache.torque.om.ComboKey;
  import org.apache.torque.om.DateKey;
  import org.apache.torque.om.NumberKey;
  import org.apache.torque.om.ObjectKey;
  import org.apache.torque.om.SimpleKey;
  import org.apache.torque.om.StringKey;
  import org.apache.torque.om.Persistent;
  import org.apache.torque.util.Criteria;
  import org.apache.torque.util.Transaction;
  
  
  
  import com.aurel.track.persist.TPerson;
  import com.aurel.track.persist.TPersonPeer;
  import com.aurel.track.persist.TCLOB;
  import com.aurel.track.persist.TCLOBPeer;
  
    import org.apache.commons.collections.map.IdentityMap;
  import java.util.Iterator;
  import com.aurel.track.beans.TLastExecutedQueryBean;
  import com.aurel.track.beans.TPersonBean;
  import com.aurel.track.beans.TCLOBBean;
  
  
  
  /**
   * store the last n executed queries with all data needed to execute them again
   *
   * You should not use this class directly.  It should not even be
   * extended all references should be to TLastExecutedQuery
   */
  public abstract class BaseTLastExecutedQuery extends TpBaseObject
  {
      /** The Peer class */
      private static final TLastExecutedQueryPeer peer =
          new TLastExecutedQueryPeer();
  
  
      /** The value for the objectID field */
      private Integer objectID;
  
      /** The value for the person field */
      private Integer person;
  
      /** The value for the queryType field */
      private Integer queryType;
  
      /** The value for the queryClob field */
      private Integer queryClob;
  
      /** The value for the queryKey field */
      private Integer queryKey;
  
      /** The value for the lastExecutedTime field */
      private Date lastExecutedTime;
  
      /** The value for the uuid field */
      private String uuid;
  
  
      /**
       * Get the ObjectID
       *
       * @return Integer
       */
      public Integer getObjectID()
      {
          return objectID;
      }
  
  
      /**
       * Set the value of ObjectID
       *
       * @param v new value
       */
      public void setObjectID(Integer v) 
      {
  
          if (!ObjectUtils.equals(this.objectID, v))
          {
              this.objectID = v;
              setModified(true);
          }
  
  
      }
  
      /**
       * Get the Person
       *
       * @return Integer
       */
      public Integer getPerson()
      {
          return person;
      }
  
  
      /**
       * Set the value of Person
       *
       * @param v new value
       */
      public void setPerson(Integer v) throws TorqueException
      {
  
          if (!ObjectUtils.equals(this.person, v))
          {
              this.person = v;
              setModified(true);
          }
  
  
          if (aTPerson != null && !ObjectUtils.equals(aTPerson.getObjectID(), v))
          {
              aTPerson = null;
          }
  
      }
  
      /**
       * Get the QueryType
       *
       * @return Integer
       */
      public Integer getQueryType()
      {
          return queryType;
      }
  
  
      /**
       * Set the value of QueryType
       *
       * @param v new value
       */
      public void setQueryType(Integer v) 
      {
  
          if (!ObjectUtils.equals(this.queryType, v))
          {
              this.queryType = v;
              setModified(true);
          }
  
  
      }
  
      /**
       * Get the QueryClob
       *
       * @return Integer
       */
      public Integer getQueryClob()
      {
          return queryClob;
      }
  
  
      /**
       * Set the value of QueryClob
       *
       * @param v new value
       */
      public void setQueryClob(Integer v) throws TorqueException
      {
  
          if (!ObjectUtils.equals(this.queryClob, v))
          {
              this.queryClob = v;
              setModified(true);
          }
  
  
          if (aTCLOB != null && !ObjectUtils.equals(aTCLOB.getObjectID(), v))
          {
              aTCLOB = null;
          }
  
      }
  
      /**
       * Get the QueryKey
       *
       * @return Integer
       */
      public Integer getQueryKey()
      {
          return queryKey;
      }
  
  
      /**
       * Set the value of QueryKey
       *
       * @param v new value
       */
      public void setQueryKey(Integer v) 
      {
  
          if (!ObjectUtils.equals(this.queryKey, v))
          {
              this.queryKey = v;
              setModified(true);
          }
  
  
      }
  
      /**
       * Get the LastExecutedTime
       *
       * @return Date
       */
      public Date getLastExecutedTime()
      {
          return lastExecutedTime;
      }
  
  
      /**
       * Set the value of LastExecutedTime
       *
       * @param v new value
       */
      public void setLastExecutedTime(Date v) 
      {
  
          if (!ObjectUtils.equals(this.lastExecutedTime, v))
          {
              this.lastExecutedTime = v;
              setModified(true);
          }
  
  
      }
  
      /**
       * Get the Uuid
       *
       * @return String
       */
      public String getUuid()
      {
          return uuid;
      }
  
  
      /**
       * Set the value of Uuid
       *
       * @param v new value
       */
      public void setUuid(String v) 
      {
  
          if (!ObjectUtils.equals(this.uuid, v))
          {
              this.uuid = v;
              setModified(true);
          }
  
  
      }
  
      
  
  
  
      private TPerson aTPerson;
  
      /**
       * Declares an association between this object and a TPerson object
       *
       * @param v TPerson
       * @throws TorqueException
       */
      public void setTPerson(TPerson v) throws TorqueException
      {
          if (v == null)
          {
              setPerson((Integer) null);
          }
          else
          {
              setPerson(v.getObjectID());
          }
          aTPerson = v;
      }
  
  
      /**
       * Returns the associated TPerson object.
       * If it was not retrieved before, the object is retrieved from
       * the database
       *
       * @return the associated TPerson object
       * @throws TorqueException
       */
      public TPerson getTPerson()
          throws TorqueException
      {
          if (aTPerson == null && (!ObjectUtils.equals(this.person, null)))
          {
              aTPerson = TPersonPeer.retrieveByPK(SimpleKey.keyFor(this.person));
          }
          return aTPerson;
      }
  
      /**
       * Return the associated TPerson object
       * If it was not retrieved before, the object is retrieved from
       * the database using the passed connection
       *
       * @param connection the connection used to retrieve the associated object
       *        from the database, if it was not retrieved before
       * @return the associated TPerson object
       * @throws TorqueException
       */
      public TPerson getTPerson(Connection connection)
          throws TorqueException
      {
          if (aTPerson == null && (!ObjectUtils.equals(this.person, null)))
          {
              aTPerson = TPersonPeer.retrieveByPK(SimpleKey.keyFor(this.person), connection);
          }
          return aTPerson;
      }
  
      /**
       * Provides convenient way to set a relationship based on a
       * ObjectKey, for example
       * <code>bar.setFooKey(foo.getPrimaryKey())</code>
       *
       */
      public void setTPersonKey(ObjectKey key) throws TorqueException
      {
  
          setPerson(new Integer(((NumberKey) key).intValue()));
      }
  
  
  
  
      private TCLOB aTCLOB;
  
      /**
       * Declares an association between this object and a TCLOB object
       *
       * @param v TCLOB
       * @throws TorqueException
       */
      public void setTCLOB(TCLOB v) throws TorqueException
      {
          if (v == null)
          {
              setQueryClob((Integer) null);
          }
          else
          {
              setQueryClob(v.getObjectID());
          }
          aTCLOB = v;
      }
  
  
      /**
       * Returns the associated TCLOB object.
       * If it was not retrieved before, the object is retrieved from
       * the database
       *
       * @return the associated TCLOB object
       * @throws TorqueException
       */
      public TCLOB getTCLOB()
          throws TorqueException
      {
          if (aTCLOB == null && (!ObjectUtils.equals(this.queryClob, null)))
          {
              aTCLOB = TCLOBPeer.retrieveByPK(SimpleKey.keyFor(this.queryClob));
          }
          return aTCLOB;
      }
  
      /**
       * Return the associated TCLOB object
       * If it was not retrieved before, the object is retrieved from
       * the database using the passed connection
       *
       * @param connection the connection used to retrieve the associated object
       *        from the database, if it was not retrieved before
       * @return the associated TCLOB object
       * @throws TorqueException
       */
      public TCLOB getTCLOB(Connection connection)
          throws TorqueException
      {
          if (aTCLOB == null && (!ObjectUtils.equals(this.queryClob, null)))
          {
              aTCLOB = TCLOBPeer.retrieveByPK(SimpleKey.keyFor(this.queryClob), connection);
          }
          return aTCLOB;
      }
  
      /**
       * Provides convenient way to set a relationship based on a
       * ObjectKey, for example
       * <code>bar.setFooKey(foo.getPrimaryKey())</code>
       *
       */
      public void setTCLOBKey(ObjectKey key) throws TorqueException
      {
  
          setQueryClob(new Integer(((NumberKey) key).intValue()));
      }
     
          
      private static List<String> fieldNames = null;
  
      /**
       * Generate a list of field names.
       *
       * @return a list of field names
       */
      public static synchronized List<String> getFieldNames()
      {
          if (fieldNames == null)
          {
              fieldNames = new ArrayList<String>();
              fieldNames.add("ObjectID");
              fieldNames.add("Person");
              fieldNames.add("QueryType");
              fieldNames.add("QueryClob");
              fieldNames.add("QueryKey");
              fieldNames.add("LastExecutedTime");
              fieldNames.add("Uuid");
              fieldNames = Collections.unmodifiableList(fieldNames);
          }
          return fieldNames;
      }
  
      /**
       * Retrieves a field from the object by field (Java) name passed in as a String.
       *
       * @param name field name
       * @return value
       */
      public Object getByName(String name)
      {
          if (name.equals("ObjectID"))
          {
              return getObjectID();
          }
          if (name.equals("Person"))
          {
              return getPerson();
          }
          if (name.equals("QueryType"))
          {
              return getQueryType();
          }
          if (name.equals("QueryClob"))
          {
              return getQueryClob();
          }
          if (name.equals("QueryKey"))
          {
              return getQueryKey();
          }
          if (name.equals("LastExecutedTime"))
          {
              return getLastExecutedTime();
          }
          if (name.equals("Uuid"))
          {
              return getUuid();
          }
          return null;
      }
  
      /**
       * Set a field in the object by field (Java) name.
       *
       * @param name field name
       * @param value field value
       * @return True if value was set, false if not (invalid name / protected field).
       * @throws IllegalArgumentException if object type of value does not match field object type.
       * @throws TorqueException If a problem occurs with the set[Field] method.
       */
      public boolean setByName(String name, Object value )
          throws TorqueException, IllegalArgumentException
      {
          if (name.equals("ObjectID"))
          {
              // Object fields can be null
              if (value != null && ! Integer.class.isInstance(value))
              {
                  throw new IllegalArgumentException("Invalid type of object specified for value in setByName");
              }
              setObjectID((Integer) value);
              return true;
          }
          if (name.equals("Person"))
          {
              // Object fields can be null
              if (value != null && ! Integer.class.isInstance(value))
              {
                  throw new IllegalArgumentException("Invalid type of object specified for value in setByName");
              }
              setPerson((Integer) value);
              return true;
          }
          if (name.equals("QueryType"))
          {
              // Object fields can be null
              if (value != null && ! Integer.class.isInstance(value))
              {
                  throw new IllegalArgumentException("Invalid type of object specified for value in setByName");
              }
              setQueryType((Integer) value);
              return true;
          }
          if (name.equals("QueryClob"))
          {
              // Object fields can be null
  