/*
* Copyright (C) 2010-2015 Stichting Akvo (Akvo Foundation)
*
* This file is part of Akvo FLOW.
*
* Akvo FLOW is free software: you can redistribute it and modify it under the terms of
* the GNU Affero General Public License (AGPL) as published by the Free Software Foundation,
* either version 3 of the License or any later version.
*
* Akvo FLOW 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 Affero General Public License included below for more details.
*
* The full license text can also be seen at <http://www.gnu.org/licenses/agpl.html>.
*/
package com.gallatinsystems.framework.domain;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.Inheritance;
import javax.jdo.annotations.InheritanceStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import com.google.appengine.api.datastore.Key;
/**
* base class for all persistent objects. It defines 5 fields common to all persistent objects (key
* plus 4 audit fields).
*
* @author Christopher Fagiani
*/
@PersistenceCapable
@Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
public abstract class BaseDomain implements Serializable {
private static final long serialVersionUID = 7824199813334027150L;
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
protected Key key;
protected Date createdDateTime;
protected Date lastUpdateDateTime;
protected Long lastUpdateUserId;
protected Long createUserId;
protected List<Long> ancestorIds;
public Key getKey() {
return key;
}
public void setKey(Key key) {
this.key = key;
}
public Date getCreatedDateTime() {
return createdDateTime;
}
public void setCreatedDateTime(Date createdDateTime) {
this.createdDateTime = createdDateTime;
}
public Date getLastUpdateDateTime() {
return lastUpdateDateTime;
}
public void setLastUpdateDateTime(Date lastUpdateDateTime) {
this.lastUpdateDateTime = lastUpdateDateTime;
}
public Long getLastUpdateUserId() {
return lastUpdateUserId;
}
public void setLastUpdateUserId(Long lastUpdateUserId) {
this.lastUpdateUserId = lastUpdateUserId;
}
public Long getCreateUserId() {
return createUserId;
}
public void setCreateUserId(Long createUserId) {
this.createUserId = createUserId;
}
public List<Long> getAncestorIds() {
return ancestorIds;
}
public void setAncestorIds(List<Long> ancestorIds) {
this.ancestorIds = ancestorIds;
}
}