new domainobject to handle notifications
Change-Id: Iaffa213ac003de94d4a3a1344cfdf9db0f212ca2
This commit is contained in:
parent
e6dca29e14
commit
02ebe0a995
@ -0,0 +1,83 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package se.su.dsv.scipro.data.dataobjects;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.persistence.Cacheable;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Lob;
|
||||
import javax.persistence.ManyToMany;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.hibernate.annotations.Cache;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
/**
|
||||
* @author Johan Aschan - aschan@dsv.su.se
|
||||
*
|
||||
*/
|
||||
|
||||
@Entity
|
||||
@Table(name="notification")
|
||||
@Cacheable(true)
|
||||
@Cache(usage= CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
|
||||
public class Notification extends DomainObject{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@GeneratedValue
|
||||
private Long id;
|
||||
|
||||
@Lob
|
||||
private String infoText;
|
||||
|
||||
@ManyToMany
|
||||
private Set<User> subscribers = new HashSet<User>();
|
||||
|
||||
@Override
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the infoText
|
||||
*/
|
||||
public String getInfoText() {
|
||||
return infoText;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param infoText the infoText to set
|
||||
*/
|
||||
public void setInfoText(String infoText) {
|
||||
this.infoText = infoText;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the subscribers
|
||||
*/
|
||||
public Set<User> getSubscribers() {
|
||||
return subscribers;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param subscribers the subscribers to set
|
||||
*/
|
||||
public void setSubscribers(Set<User> subscribers) {
|
||||
this.subscribers = subscribers;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user