IssueResourceBean.java :  » Groupware » LibreSource » org » libresource » bugtracker » ejb » Java Open Source

Java Open Source » Groupware » LibreSource 
LibreSource » org » libresource » bugtracker » ejb » IssueResourceBean.java
/**
 * LibreSource
 * Copyright (C) 2004-2008 Artenum SARL / INRIA
 * http://www.libresource.org - contact@artenum.com
 *
 * This file is part of the LibreSource software, 
 * which can be used and distributed under license conditions.
 * The license conditions are provided in the LICENSE.TXT file 
 * at the root path of the packaging that enclose this file. 
 * More information can be found at 
 * - http://dev.libresource.org/home/license
 *
 * Initial authors :
 *
 * Guillaume Bort / INRIA
 * Francois Charoy / Universite Nancy 2
 * Julien Forest / Artenum
 * Claude Godart / Universite Henry Poincare
 * Florent Jouille / INRIA
 * Sebastien Jourdain / INRIA / Artenum
 * Yves Lerumeur / Artenum
 * Pascal Molli / Universite Henry Poincare
 * Gerald Oster / INRIA
 * Mariarosa Penzi / Artenum
 * Gerard Sookahet / Artenum
 * Raphael Tani / INRIA
 *
 * Contributors :
 *
 * Stephane Bagnier / Artenum
 * Amadou Dia / Artenum-IUP Blois
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */
package org.libresource.bugtracker.ejb;

import org.libresource.LibresourceResourceBase;

import org.libresource.bugtracker.util.IssueResourceUtil;

import java.util.Date;

import javax.ejb.CreateException;
import javax.ejb.FinderException;


/**
 * A libresource Bug
 *
 * @libresource.resource name="Issue" service="LibresourceBugTracker"
 *
 * @ejb.finder
 *     signature= "java.util.Collection findByAssignee(java.lang.String login)"
 *     query ="SELECT OBJECT(i) FROM IssueResource i WHERE i.resolution = 'UNRESOLVED' AND i.assignee = ?1"
 *     transaction-type="Supports"
 */
public abstract class IssueResourceBean extends LibresourceResourceBase {
    /**
     * @ejb.create-method
     */
    public String ejbCreate(int issueId, String summary, String body, String type, String priority, String resolution, String author, String assignee,
        Date creationDate) throws CreateException {
        setId(IssueResourceUtil.generateGUID(this));
        setIssueId(issueId);
        setSummary(summary);
        setBody(body);
        setType(type);
        setPriority(priority);
        setResolution(resolution);
        setAuthorName(author);
        setAssignee(assignee);
        setCreationDate(creationDate);
        setUpdateDate(new Date());

        return null;
    }

    // ejbselect methods

    /**
     * @ejb.select
     *     query ="SELECT COUNT(i) FROM IssueResource AS i"
     *     result-type-mapping="Local"
     */
    public abstract int ejbSelectCountIssues() throws FinderException;

    /**
     * @ejb.home-method
     */
    public int ejbHomeCountIssues() throws javax.ejb.FinderException {
        return ejbSelectCountIssues();
    }

    // persistents fields

    /**
     * @ejb.persistent-field
     * @ejb.interface-method
     * @ejb.value-object match="libresource"
     * @ejb.transaction type="Supports"
     */
    public abstract String getId();

    /**
     * @ejb.persistent-field
     * @ejb.interface-method
     * @ejb.transaction type="Mandatory"
     */
    public abstract void setId(String id);

    /**
     * @ejb.interface-method
     * @ejb.value-object match="libresource"
     * @ejb.transaction type="Supports"
     */
    public String getShortResourceName() {
        return getSummary();
    }

    /**
     * @ejb.persistent-field
     * @ejb.interface-method
     * @ejb.value-object match="libresource"
     * @ejb.transaction type="Supports"
     */
    public abstract int getIssueId();

    /**
     * @ejb.persistent-field
     * @ejb.interface-method
     * @ejb.transaction type="Mandatory"
     */
    public abstract void setIssueId(int issueId);

    /**
     * @ejb.persistent-field
     * @ejb.interface-method
     * @ejb.value-object match="libresource"
     * @ejb.transaction type="Supports"
     */
    public abstract String getSummary();

    /**
     * @ejb.persistent-field
     * @ejb.interface-method
     * @ejb.transaction type="Mandatory"
     */
    public abstract void setSummary(String summary);

    /**
     * @ejb.persistent-field
     * @ejb.interface-method
     * @ejb.value-object match="libresource"
     * @ejb.transaction type="Supports"
     */
    public abstract String getBody();

    /**
     * @ejb.persistent-field
     * @ejb.interface-method
     * @ejb.transaction type="Mandatory"
     */
    public abstract void setBody(String body);

    /**
     * @ejb.persistent-field
     * @ejb.interface-method
     * @ejb.value-object match="libresource"
     * @ejb.transaction type="Supports"
     */
    public abstract String getAuthorName();

    /**
     * @ejb.persistent-field
     * @ejb.interface-method
     * @ejb.transaction type="Mandatory"
     */
    public abstract void setAuthorName(String authorName);

    /**
     * @ejb.persistent-field
     * @ejb.interface-method
     * @ejb.value-object match="libresource"
     * @ejb.transaction type="Supports"
     */
    public abstract Date getCreationDate();

    /**
     * @ejb.persistent-field
     * @ejb.interface-method
     * @ejb.transaction type="Mandatory"
     */
    public abstract void setCreationDate(Date date);

    /**
     * @ejb.persistent-field
     * @ejb.interface-method
     * @ejb.value-object match="libresource"
     * @ejb.transaction type="Supports"
     */
    public abstract Date getUpdateDate();

    /**
     * @ejb.persistent-field
     * @ejb.interface-method
     * @ejb.transaction type="Mandatory"
     */
    public abstract void setUpdateDate(Date date);

    /**
     * @ejb.persistent-field
     * @ejb.interface-method
     * @ejb.value-object match="libresource"
     * @ejb.transaction type="Supports"
     */
    public abstract String getType();

    /**
     * @ejb.persistent-field
     * @ejb.interface-method
     * @ejb.transaction type="Mandatory"
     */
    public abstract void setType(String type);

    /**
     * @ejb.persistent-field
     * @ejb.interface-method
     * @ejb.value-object match="libresource"
     * @ejb.transaction type="Supports"
     */
    public abstract String getPriority();

    /**
     * @ejb.persistent-field
     * @ejb.interface-method
     * @ejb.transaction type="Mandatory"
     */
    public abstract void setPriority(String priority);

    /**
     * @ejb.persistent-field
     * @ejb.interface-method
     * @ejb.value-object match="libresource"
     * @ejb.transaction type="Supports"
     */
    public abstract String getResolution();

    /**
     * @ejb.persistent-field
     * @ejb.interface-method
     * @ejb.transaction type="Mandatory"
     */
    public abstract void setResolution(String resolution);

    /**
     * @ejb.persistent-field
     * @ejb.interface-method
     * @ejb.value-object match="libresource"
     * @ejb.transaction type="Supports"
     */
    public abstract String getAssignee();

    /**
     * @ejb.persistent-field
     * @ejb.interface-method
     * @ejb.transaction type="Mandatory"
     */
    public abstract void setAssignee(String assignee);
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.