gt:         if (this.getId() == null)
context: /* 
   *  TNTConcept Easy Enterprise Management by Autentia Real Bussiness Solution S.L.  
   *	Copyright (C) 2007 Autentia Real Bussiness Solution S.L.					   
   *	
   * 	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 2
   * 	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, write to the Free Software
   * 	Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
   *
   * 	Autentia Real Bussiness Solution S.L.
   * 	Tlf: +34 91 675 33 06, +34 655 99 11 72
   * 	Fax: +34 91 656 65 04
   * 	info@autentia.com																
   */
  
  package com.autentia.intra.businessobject;
  
  import com.autentia.intra.dao.ITransferObject;
  import com.autentia.intra.dao.hibernate.UserDAO;
  
  import java.io.Serializable;
  import java.util.Calendar;
  import java.util.Date;
  
  /**
   * Transfer object to store Activitys
   *
   * @author stajanov code generator
   */
  public class Activity implements Serializable, ITransferObject {
      /**
       * Serial version field
       */
      private static final long serialVersionUID = -1L;
  
  /* activity - generated by stajanov (do not edit/delete) */
  
      // Fields
  
  
      private Integer id;
  
  
      private Date startDate;
  
  
      private int duration;
  
  
      private String description;
  
  
      private boolean billable;
  
  
      private Integer departmentId;
  
  
      private Date insertDate;
  
  
      private Date updateDate;
  
  
      private User user;
  
  
      private ProjectRole role;
  
  
      private ProjectEnsayo ensayo;
      private Project project;
  
      public Project getProject() {
          if (project == null && ensayo != null)
              return ensayo.getProject();
          else if (project == null && role != null)
              return role.getProject();
          else
              return project;
      }
  
      public void setProject(Project project) {
          this.project = project;
      }
  
      // Setters and getters
  
  
      public Integer getId() {
          return id;
      }
  
      private void setId(Integer id) {
          this.id = id;
      }
  
  
      public Date getStartDate() {
          return startDate;
      }
  
      public void setStartDate(Date startDate) {
          this.startDate = startDate;
      }
  
  
      public int getDuration() {
          return duration;
      }
  
      public void setDuration(int duration) {
          this.duration = duration;
      }
  
  
      public String getDescription() {
          return description;
      }
  
      public void setDescription(String description) {
          this.description = description;
      }
  
  
      public boolean isBillable() {
          return billable;
      }
  
      public void setBillable(boolean billable) {
          this.billable = billable;
      }
  
  
      public Integer getDepartmentId() {
          return departmentId;
      }
  
      public void setDepartmentId(Integer departmentId) {
          this.departmentId = departmentId;
      }
  
  
      public Date getInsertDate() {
          return insertDate;
      }
  
      public void setInsertDate(Date insertDate) {
          this.insertDate = insertDate;
      }
  
  
      public Date getUpdateDate() {
          return updateDate;
      }
  
      public void setUpdateDate(Date updateDate) {
          this.updateDate = updateDate;
      }
  
  
      public User getUser() {
          return user;
      }
  
      public void setUser(User user) {
          this.user = user;
      }
  
  
      public ProjectRole getRole() {
          return role;
      }
  
      public void setRole(ProjectRole role) {
          this.role = role;
          if (role != null)
              this.project = role.getProject();
      }
  
      public ProjectEnsayo getEnsayo() {
          return ensayo;
      }
  
      public void setEnsayo(ProjectEnsayo ensayo) {
          this.ensayo = ensayo;
          if (ensayo != null)
              this.project = ensayo.getProject();
      }
  
      public Integer getOwnerId() {
          return user.getId();
      }
  
  
      public void setOwnerId(Integer ownerId) {
          user = UserDAO.getDefault().getById(ownerId);
      }
  
  
      @Override
      public boolean equals(Object that) {
          try {
              if (that == null)
                  return false;
              else
                  return this.getId().equals(((Activity) that).getId());
          } catch (Exception e) {
              return false;
          }
      }
  
      @Override
      public int hashCode() {
  