net.sf.jagzilla.hibernate
Class Attachment

java.lang.Object
  extended bynet.sf.jagzilla.hibernate.XmlObjectImpl
      extended bynet.sf.jagzilla.hibernate.Attachment
All Implemented Interfaces:
XmlObject

public class Attachment
extends XmlObjectImpl

represents a record in the table attachments. This class has several field wich must be non-null: TODO: add list of non-nullable fields for adding the file data, see the method setTheData(byte[]).

Author:
mgriffa
See Also:
setTheData(byte[])

Constructor Summary
Attachment()
           
 
Method Summary
 int getBugId()
           
 java.util.Date getCreation()
           
 java.lang.String getDescription()
           
 java.lang.String getFilename()
           
 int getId()
           
 short getIsObsolete()
           
 short getIsPatch()
           
 java.lang.String getMimeType()
           
 int getSubmitterId()
           
 java.sql.Blob getTheData()
           
 byte[] getTheDataBytes()
          TODO: make this work : castor.field set-method="setTheDataBytes"
 void loadFromXml(java.io.Reader reader)
          load the object data from xml.
 void setBugId(int bugId)
           
 void setCreation(java.util.Date creation)
           
 void setDescription(java.lang.String description)
           
 void setFilename(java.lang.String filename)
           
 void setId(int id)
           
 void setIsObsolete(short isObsolete)
           
 void setIsPatch(short isPatch)
           
 void setMimeType(java.lang.String mimeType)
           
 void setSubmitterId(int submitterId)
           
 void setTheData(java.sql.Blob theData)
           
 void setTheData(byte[] theData)
          creates a blob from the byte[] received.
 void setTheDataBytes(byte[] bytes)
           
 java.lang.String toString()
           
 
Methods inherited from class net.sf.jagzilla.hibernate.XmlObjectImpl
equals, getXmlString, loadObjectFromXml, setXmlString, toXml
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Attachment

public Attachment()
Method Detail

getBugId

public int getBugId()
Returns:
Returns the bugId.

setBugId

public void setBugId(int bugId)
Parameters:
bugId - The bugId to set.

getCreation

public java.util.Date getCreation()
Returns:
Returns the creation.

setCreation

public void setCreation(java.util.Date creation)
Parameters:
creation - The creation to set.

getDescription

public java.lang.String getDescription()
Returns:
Returns the description.

setDescription

public void setDescription(java.lang.String description)
Parameters:
description - The description to set.

getFilename

public java.lang.String getFilename()
Returns:
Returns the filename.

setFilename

public void setFilename(java.lang.String filename)
Parameters:
filename - The filename to set.

getId

public int getId()
Returns:
Returns the id.

setId

public void setId(int id)
Parameters:
id - The id to set.

getIsObsolete

public short getIsObsolete()
Returns:
Returns the isObsolete.

setIsObsolete

public void setIsObsolete(short isObsolete)
Parameters:
isObsolete - The isObsolete to set.

getIsPatch

public short getIsPatch()
Returns:
Returns the isPatch.

setIsPatch

public void setIsPatch(short isPatch)
Parameters:
isPatch - The isPatch to set.

getMimeType

public java.lang.String getMimeType()
Returns:
Returns the mimeType.

setMimeType

public void setMimeType(java.lang.String mimeType)
Parameters:
mimeType - The mimeType to set.

getSubmitterId

public int getSubmitterId()
Returns:
Returns the submitterId.

setSubmitterId

public void setSubmitterId(int submitterId)
Parameters:
submitterId - The submitterId to set.

toString

public java.lang.String toString()

getTheDataBytes

public byte[] getTheDataBytes()
TODO: make this work : castor.field set-method="setTheDataBytes"

Returns:

setTheDataBytes

public void setTheDataBytes(byte[] bytes)

getTheData

public java.sql.Blob getTheData()
Returns:
Returns the theData.

setTheData

public void setTheData(java.sql.Blob theData)
Parameters:
theData - The theData to set.

setTheData

public void setTheData(byte[] theData)
creates a blob from the byte[] received.

Parameters:
theData -

loadFromXml

public void loadFromXml(java.io.Reader reader)
                 throws java.io.IOException,
                        MappingException,
                        MarshalException,
                        ValidationException
Description copied from interface: XmlObject
load the object data from xml. This method internally uses castor to unmarshall the object form XML.

Parameters:
reader - a reader containing a parseable xml
Throws:
java.io.IOException
MappingException
MarshalException
ValidationException


Distributed under the GPL. By Miguel Griffa. See the Jagzilla project page for more info.