//
// Copyright 2009 Robin Komiwes, Bruno Verachten, Christophe Cordenier
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
package com.wooki.domain.model.activity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import com.wooki.domain.model.User;
import com.wooki.domain.model.WookiEntity;
/**
* This class is used to follow the activity on the wooki elements.
*
* @author ccordenier
*/
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "Activities")
public abstract class Activity<T> extends WookiEntity
{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "activity_id", nullable = false)
private Long id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "user_id", nullable = false)
private User user;
@Column(name = "resourceUnavailable", nullable = true)
private boolean resourceUnavailable;
public Long getId()
{
return id;
}
public void setId(Long id)
{
this.id = id;
}
public User getUser()
{
return user;
}
public void setUser(User user)
{
this.user = user;
}
public boolean isResourceUnavailable()
{
return resourceUnavailable;
}
public void setResourceUnavailable(boolean resourceUnavailable)
{
this.resourceUnavailable = resourceUnavailable;
}
public abstract T getType();
public abstract void setType(T type);
}