Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 960 → Rev 961

/hostadmiral/trunk/src/ak/hostadmiral/core/model/GeneralModelObject.java
0,0 → 1,103
package ak.hostadmiral.core.model;
 
import java.util.Date;
import ak.hostadmiral.util.ModelException;
import ak.hostadmiral.util.ModelSecurityException;
 
public abstract class GeneralModelObject
implements ModelObject
{
private Long id;
private Boolean enabled;
private String comment;
private Date modStamp;
private User modUser;
 
/**
*
* @hibernate.id generator-class="native"
*/
public Long getId()
{
return id;
}
 
protected void setId(Long id)
{
this.id = id;
}
 
/**
*
* @hibernate.property
*/
public Boolean getEnabled()
{
return enabled;
}
 
protected void setEnabled(Boolean enabled)
{
this.enabled = enabled;
}
 
public void setEnabled(User editor, Boolean enabled)
throws ModelException
{
if(!editableBy(editor))
throw new ModelSecurityException();
 
this.enabled = enabled;
}
 
/**
*
* @hibernate.property
*/
public String getComment()
{
return comment;
}
 
protected void setComment(String comment)
{
this.comment = comment;
}
 
public void setComment(User editor, String comment)
throws ModelException
{
if(!editableBy(editor))
throw new ModelSecurityException();
 
this.comment = comment;
}
 
/**
*
* @hibernate.timestamp column="mod_stamp"
*/
public Date getModStamp()
{
return modStamp;
}
 
protected void setModStamp(Date modStamp)
{
this.modStamp = modStamp;
}
 
/**
*
* @hibernate.many-to-one column="mod_user"
*/
public User getModUser()
{
return modUser;
}
 
protected void setModUser(User modUser)
{
this.modUser = modUser;
}
}