2.17.2: 2011-06-17

net.sf.basedb.core.data
Class ChangeHistoryData

java.lang.Object
  extended by net.sf.basedb.core.data.BasicData
      extended by net.sf.basedb.core.data.ChangeHistoryData
All Implemented Interfaces:
IdentifiableData

public class ChangeHistoryData
extends BasicData

Represents the changes made in a single transaction. This entity records information about the time, user, active project, used plug-in, etc. Changes made to entities in the transaction are recorded with ChangeHistoryDetailData objects.

NOTE! All references to other items are controlled by regular integer values because we don't want foreign keys from the log tables to block deletion of items. A duplicate mapping using many-to-one with a formula attribute is used since we really need the LEFT JOIN functionality in the web interface and the association is also useful for data export which uses metadata to access the properties. The formula mapping is not supported by XDoclet so we have to do this in the hibernate-properties.ChangeHistoryData.xml file.

Missing items are handled by the core layer at runtime. References in the log to missing items may optionally be deleted by a cleanup thread from time to time.

Version:
2.13
Author:
Nicklas
Last modified
$Date: 2009-08-21 08:17:57 +0200 (Fri, 21 Aug 2009) $
Hibernate: class
table="`ChangeHistory`" lazy="false" mutable="false"

Field Summary
private  ClientData client
           
private  Integer clientId
           
private  Set<ChangeHistoryDetailData> details
           
private  JobData job
           
private  Integer jobId
           
private  PluginDefinitionData plugin
           
private  Integer pluginId
           
private  ProjectData project
           
private  Integer projectId
           
private  SessionData session
           
private  int sessionId
           
private  Date time
           
private  UserData user
           
private  int userId
           
 
Constructor Summary
ChangeHistoryData()
           
 
Method Summary
(package private)  ClientData getClient()
           
 Integer getClientId()
          The ID of the client application the user used to make the change.
(package private)  Set<ChangeHistoryDetailData> getDetails()
          This is the inverse end.
(package private)  JobData getJob()
           
 Integer getJobId()
          The ID of the job that was making the changes.
(package private)  PluginDefinitionData getPlugin()
           
 Integer getPluginId()
          The ID of the plug-in that was making the changes.
(package private)  ProjectData getProject()
           
 Integer getProjectId()
          The ID of the project that was active when the changes were made.
(package private)  SessionData getSession()
           
 int getSessionId()
          The ID of the session in which the changes happened.
 Date getTime()
          Get the time of the change.
(package private)  UserData getUser()
           
 int getUserId()
          The ID of the user that made the change.
(package private)  void setClient(ClientData client)
           
 void setClientId(Integer clientId)
           
(package private)  void setDetails(Set<ChangeHistoryDetailData> details)
           
(package private)  void setJob(JobData job)
           
 void setJobId(Integer jobId)
           
(package private)  void setPlugin(PluginDefinitionData plugin)
           
 void setPluginId(Integer pluginId)
           
(package private)  void setProject(ProjectData project)
           
 void setProjectId(Integer projectId)
           
(package private)  void setSession(SessionData session)
           
 void setSessionId(int sessionId)
           
 void setTime(Date time)
           
(package private)  void setUser(UserData user)
           
 void setUserId(int userId)
           
 
Methods inherited from class net.sf.basedb.core.data.BasicData
equals, getId, getVersion, hashCode, setId, setVersion, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

time

private Date time

userId

private int userId

user

private UserData user

sessionId

private int sessionId

session

private SessionData session

clientId

private Integer clientId

client

private ClientData client

projectId

private Integer projectId

project

private ProjectData project

pluginId

private Integer pluginId

plugin

private PluginDefinitionData plugin

jobId

private Integer jobId

job

private JobData job

details

private Set<ChangeHistoryDetailData> details
Constructor Detail

ChangeHistoryData

public ChangeHistoryData()
Method Detail

getTime

public Date getTime()
Get the time of the change.

Returns:
A Date object
Hibernate: property
column="`time`" type="timestamp" not-null="true"

setTime

public void setTime(Date time)

getUserId

public int getUserId()
The ID of the user that made the change.

Hibernate: property
type="int"
Hibernate: column
name="`user_id`" not-null="true"

setUserId

public void setUserId(int userId)

getUser

UserData getUser()

setUser

void setUser(UserData user)

getSessionId

public int getSessionId()
The ID of the session in which the changes happened.

Hibernate: property
type="int"
Hibernate: column
name="`session_id`" not-null="true"

setSessionId

public void setSessionId(int sessionId)

getSession

SessionData getSession()

setSession

void setSession(SessionData session)

getClientId

public Integer getClientId()
The ID of the client application the user used to make the change.

Hibernate: property
type="int"
Hibernate: column
name="`client_id`" not-null="false"

setClientId

public void setClientId(Integer clientId)

getClient

ClientData getClient()

setClient

void setClient(ClientData client)

getProjectId

public Integer getProjectId()
The ID of the project that was active when the changes were made.

Hibernate: property
type="int"
Hibernate: column
name="`project_id`" not-null="false"

setProjectId

public void setProjectId(Integer projectId)

getProject

ProjectData getProject()

setProject

void setProject(ProjectData project)

getPluginId

public Integer getPluginId()
The ID of the plug-in that was making the changes.

Hibernate: property
type="int"
Hibernate: column
name="`plugin_id`" not-null="false"

setPluginId

public void setPluginId(Integer pluginId)

getPlugin

PluginDefinitionData getPlugin()

setPlugin

void setPlugin(PluginDefinitionData plugin)

getJobId

public Integer getJobId()
The ID of the job that was making the changes.

Hibernate: property
type="int"
Hibernate: column
name="`job_id`" not-null="false"

setJobId

public void setJobId(Integer jobId)

getJob

JobData getJob()

setJob

void setJob(JobData job)

getDetails

Set<ChangeHistoryDetailData> getDetails()
This is the inverse end.

See Also:
ChangeHistoryDetailData.getChangeHistory()
Hibernate: set
lazy="true" inverse="true" cascade="delete"
Hibernate: collection-key
column="`history_id`"
Hibernate: collection-one-to-many
class="net.sf.basedb.core.data.ChangeHistoryDetailData"

setDetails

void setDetails(Set<ChangeHistoryDetailData> details)

2.17.2: 2011-06-17