
net.smartlab.web.history.HistorizedBusinessObject Maven / Gradle / Ivy
/*
* The SmartWeb Framework
* Copyright (C) 2004-2006
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* For further informations on the SmartWeb Framework please visit
*
* http://smartweb.sourceforge.net
*/
package net.smartlab.web.history;
import java.io.Serializable;
import java.sql.Timestamp;
/**
* TODO documentation
*
* @author rlogiacco
*/
public interface HistorizedBusinessObject {
/**
* Returns the id.
*
* @return the id.
* @hibernate.id
* @uml.property name="id"
*/
public HistoryId getHistoryId();
/**
* Sets the id.
*
* @param historyId the id to set.
* @uml.property name="id"
*/
public void setHistoryId(HistoryId historyId);
/**
* TODO documentation
*
* @return
* @hibernate.property column="modified"
*/
public Timestamp getLastModified();
/**
* TODO documentation
*
* @param timestamp
*/
public void setLastModified(Timestamp timestamp);
public static class HistoryId implements Serializable {
private static final long serialVersionUID = -1087450948763335029L;
/**
* The reference part of this identifier.
*
* @uml.property name="ref"
*/
private Serializable ref;
private Timestamp lastModified;
/**
* A reference back to the primary key of the unlocalized referent
* object.
*
* @return returns the reference
part.
* @hibernate.property column="`ref`"
* @uml.property name="ref"
*/
public Serializable getRef() {
return ref;
}
/**
* TODO documentation
*
* @param ref the ref
part to set.
* @uml.property name="ref"
*/
public void setRef(Serializable ref) {
this.ref = ref;
}
/**
* TODO documentation
*
* @return returns the lastModified
part.
* @hibernate.property column="`modified`"
* @uml.property name="lastModified"
*/
public Timestamp getLastModified() {
return lastModified;
}
/**
* TODO documentation
*
* @param lastModified the lastModified
part to set.
* @uml.property name="lastModified"
*/
public void setLastModified(Timestamp lastModified) {
this.lastModified = lastModified;
}
/**
* @see java.lang.Object#equals(java.lang.Object)
*/
public boolean equals(Object obj) {
if (obj instanceof HistoryId) {
return ((HistoryId)obj).ref.equals(ref) && ((HistoryId)obj).lastModified.equals(lastModified);
} else {
return false;
}
}
/**
* @see java.lang.Object#hashCode()
*/
public int hashCode() {
return ref.hashCode() + (lastModified.hashCode() >> 29);
}
/**
* @see java.lang.Object#toString()
*/
public String toString() {
return "ref = " + ref.toString() + " modified = " + lastModified;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy