I have not written a toString method for the two beans involved. The beans contain the instance data along with the getters and setters. Not much else.
Here's the code for the beans:
-----
package org.arbfile.util.webrpt;
import java.io.Serializable;
import java.util.Date;
import java.util.Collection;
import java.util.ArrayList;
import java.util.List;
import java.text.DecimalFormat;
/**
* @hibernate.class table="A_WEB_RPT_REQUEST"
*/
public class WebRptRequest implements Serializable
{
/** A collection of WebRptArg objects */
List argList = new ArrayList();
/** The request id for this request. This value maps to the row id in CCA.A_WEB_RPT_REQUEST. */
private long requestId;
/** The report type, a foriegn key from the CCA.R_WEB_RPT_DEF table. */
private long rptDefId;
/** The status code for this request which maps to the primary key in CCA.R_WEB_RPT_STATUS. */
private String statusCode;
/** The user id that requested this report. */
private long userId;
/** The login id of the user that requested this report. */
private String loginId;
/** The email address to mail the report to after processing. */
private String email;
/** The output type requested by the user. */
private String outputType;
/** The browser type the user will view the report with. */
private String browserType;
/** The user defined description for this report request. */
private String userRptDesc;
/** The user defined days in which to set the expire date for this report request. */
private int expireDays;
/** Date the report expires */
private Date expireDate;
/** moddate */
private Date modDate;
/** moduser */
private String modLoginId;
/** moduser */
private Long modUserId;
/**
* The timestamp when this Report Request was logged in the database.
* This will only be used when getting report requests from the database
* for management purposes and is not populated when the report request
* is generated by the user.
*/
private Date timeStamp;
/**
* Default constructor.
*/
public WebRptRequest()
{
requestId = 0;
rptDefId = 0;
statusCode = null;
userId = 0;
loginId = null;
email = null;
outputType = null;
browserType = null;
userRptDesc = null;
timeStamp = null;
expireDays = 10;
expireDate = null;
}
/**
* Constructor which populates the object.
* @param requestId The new request's request id.
* @param reportType The new request's type.
* @param statusCode The status of this request.
* @param userId The new user id that requested the report.
* @param loginId The login id that generated the request.
* @param email The email address the report is to be mailed to.
* @param outputType The format to output the report in.
* @param browserType The browser the user will view the report with.
*/
public WebRptRequest(long requestId, long reportType, String statusCode,
long userId, String loginId, String email,
String outputType, String browserType, int expireDays)
{
this.requestId = requestId;
this.rptDefId = reportType;
this.statusCode = statusCode;
this.userId = userId;
this.loginId = loginId;
this.email = email;
this.outputType = outputType;
this.browserType = browserType;
this.expireDays = expireDays;
}
/**
* Get the request Id.
* @return The request Id.
*
* @hibernate.id column="request_id"
* type="long"
* generator-class="sequence"
* @hibernate.generator-param name="sequence"
* value="A_WEB_RPT_REQUEST_ID_SEQ"
*/
public long getRequestId()
{
return this.requestId;
}
/**
* Set the request Id.
* @param requestId The new value for requestId.
*/
public void setRequestId(long requestId)
{
this.requestId = requestId;
}
/**
* Get the report type.
* @return The report type for this object.
*
* @hibernate.property column="RPT_DEF_ID"
* type="long"
*/
public long getRptDefId()
{
return this.rptDefId;
}
/**
* Sets the report type for this object.
* @param rptDefId The new value for the report type.
*/
public void setRptDefId(long rptDefId)
{
this.rptDefId = rptDefId;
}
/**
* Get the status code for this report request.
* @return The status code.
*
* @hibernate.property column="STATUS_CODE"
* type="string"
*/
public String getStatusCode()
{
return this.statusCode;
}
/**
* Sets the status code for this report request.
* @param statusCode The new value for the status code.
*/
public void setStatusCode(String statusCode)
{
this.statusCode = statusCode;
}
/**
* Get the userid that created this report request.
* @return The userid.
*
* @hibernate.property column="USER_ID"
* type="long"
*/
public long getUserId()
{
return this.userId;
}
/**
* Sets the userid for the report request.
* @param userId The new value for the userId.
*/
public void setUserId(long userId)
{
this.userId = userId;
}
/**
* Get the login id for the report request.
* @return The login id currently associated with this report request.
*
* @hibernate.property column="LOGIN_ID"
* type="string"
*/
public String getLoginId()
{
return this.loginId;
}
/**
* Sets the login id for this report request.
* @param loginId The login id to associate with this report request.
*/
public void setLoginId(String loginId)
{
this.loginId = loginId;
}
/**
* Get the email to send the report to.
* @return The email address for this report request.
*
* @hibernate.property column="EMAIL"
* type="string"
*/
public String getEmail()
{
return this.email;
}
/**
* Sets the email address to send the report to.
* @param email The email address for this report request.
*/
public void setEmail(String email)
{
this.email = email;
}
/**
* Get the output type for this report request.
* @return The output type.
*
* @hibernate.property column="OUTPUT_TYPE"
* type="string"
*/
public String getOutputType()
{
return this.outputType;
}
/**
* Sets the output type for this report.
* @param outputType The value to set the output type to.
*/
public void setOutputType(String outputType)
{
this.outputType = outputType;
}
/**
* Get the browser type for this report request.
* @return The browser type used to view the report.
*
* @hibernate.property column="BROWSER_TYPE"
* type="string"
*/
public String getBrowserType()
{
return browserType;
}
/**
* Sets the browser type for this report request.
* @param browserType The browser that will be used.
*/
public void setBrowserType(String browserType)
{
this.browserType = browserType;
}
/**
* Get the user defined report request description.
* @return The report description.
*
* @hibernate.property column="USER_RPT_DESC"
* type="string"
*/
public String getUserRptDesc()
{
return userRptDesc;
}
/**
* Sets the user defined report request description.
* @param userRptDesc The description entered by the user to associate with this request.
*/
public void setUserRptDesc(String userRptDesc)
{
this.userRptDesc = userRptDesc;
}
/**
* Get the time stamp when this request was created in the database.
* @return The time stamp.
*
*/
public Date getTimeStamp()
{
return timeStamp;
}
/**
* Sets the time stamp for when this request was created in the database.
* @param timeStamp The time stamp for when the request was created.
*/
public void setTimeStamp(Date timeStamp)
{
this.timeStamp = timeStamp;
}
/**
* Adds the given WebRptArg object to the collection of arguments
* @param arg The webRptArg to add to the collection of web report arguments
*/
public void addArg(WebRptArg arg)
{
this.argList.add(arg);
}
/**
* Get the number of days from the current request date when this report request will expire.
* @return The number of days from the report request until the report request expires.
*/
public int getExpireDays()
{
return expireDays;
}
/**
* Sets the number of days from the current request date when this report request will expire.
*/
public void setExpireDays(int expireDays)
{
this.expireDays = expireDays;
}
/**
* gets expire date
* @return expire date
* @hibernate.property column="EXPIRE_DATE"
* type="date"
*/
public Date getExpireDate()
{
return expireDate;
}
/**
* sets expire date
* @param expireDate
*/
public void setExpireDate(Date expireDate)
{
this.expireDate = expireDate;
}
/**
* gets mod date
* @return mod date
* @hibernate.property column="MODDATE"
* type="date"
*/
public Date getModDate()
{
return modDate;
}
public void setModDate(Date modDate)
{
this.modDate = modDate;
}
/**
* gets modLoginId
* @return modLoginId
* @hibernate.property column="MODLOGIN_ID"
* type="string"
*/
public String getModLoginId()
{
return modLoginId;
}
public void setModLoginId(String modLoginId)
{
this.modLoginId = modLoginId;
}
/**
* gets mod user id
* @return moduserid
* @hibernate.property column="MODUSER_ID"
* type="long"
*/
public Long getModUserId()
{
return modUserId;
}
public void setModUserId(Long modUserId)
{
this.modUserId = modUserId;
}
/**
* This contains a collection of all of the arguments used in this report request
* @return
* @hibernate.list lazy="false"
* name="argList"
* inverse="false"
* @hibernate.collection-one-to-many class="org.arbfile.util.webrpt.WebRptArg"
* column="REQUEST_ID"
* @hibernate.collection-key column="REQUEST_ID"
* @hibernate.collection-index column="RPT_WEB_RPT_ARG_ID" type="long"
*/
public List getArgList()
{
return argList;
}
public void setArgList(List argList)
{
this.argList= argList;
}
/**
* This method returns a file path based on the path and output type of the requested file
* @return The formatted file path including the directory mapping and file type
*/
public static String formatFilePath(String filePath, long requestId, String outputType)
{
String ret = "";
if (filePath != null && outputType != null)
{
// build the file name based on the id and type
DecimalFormat df = new DecimalFormat ("0000000000");
ret = filePath + df.format(requestId) + "." + outputType;
}
return ret;
}
}
-----
package org.arbfile.util.webrpt;
/**
* Web Report Argument Bean
*
* @hibernate.class table="A_WEB_RPT_REQ_ARGS"
*/
public class WebRptArg
{
long argId;
long requestId;
int argOrder;
String argValue;
String argType;
public WebRptArg(int argOrder, String argValue, String argType)
{
if (argOrder < 0)
{
}
if (! WebRptConstants.isValidArgType(argType))
{
}
this.argOrder = argOrder;
this.argValue = argValue;
this.argType = argType;
}
public WebRptArg()
{
}
/**
* @return arg order
*
* @hibernate.id column="RPT_WEB_RPT_ARG_ID"
* type="long"
* generator-class="sequence"
* @hibernate.generator-param name="sequence"
* value="A_WEB_RPT_REQ_ARGS_ID_SEQ"
*/
public long getArgId()
{
return argId;
}
public void setArgId(long argId)
{
this.argId = argId;
}
/**
* @return requestid
*
* @hibernate.property column="REQUEST_ID"
* type="long"
*/
public long getRequestId()
{
return requestId;
}
public void setRequestId(long requestId)
{
this.requestId = requestId;
}
// /**
// * @return arg order
// *
// * @hibernate.many-to-one column="REQUEST_ID"
// * not-null="true"
// * class="org.arbfile.util.webrpt.WebRptRequest"
// */
// public WebRptRequest getWebRptRequest()
// {
// return webRptRequest;
// }
//
// public void setWebRptRequest(WebRptRequest webRptRequest)
// {
// this.webRptRequest = webRptRequest;
// }
/**
* @return arg order
*
* @hibernate.property column="ARG_ORDER"
* type="int"
*/
public int getArgOrder()
{
return argOrder;
}
public void setArgOrder(int argOrder)
{
this.argOrder = argOrder;
}
/**
* @return arg order
*
* @hibernate.property column="ARG_VALUE"
* type="string"
*/
public String getArgValue()
{
return argValue;
}
public void setArgValue(String argValue)
{
this.argValue = argValue;
}
/**
* @return arg type
*
* @hibernate.property column="ARG_TYPE"
* type="string"
*/
public String getArgType()
{
return argType;
}
public void setArgType(String argType)
{
this.argType = argType;
}
}
_________________ Bill Pfeiffer
|