Java tutorial
/******************************************************************************* * This file is part of Eldar Works. * * Eldar Works is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Eldar Works 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Eldar Works. If not, see <http://www.gnu.org/licenses/>. * Copyright (c) 2012. Phillip Sanderson ******************************************************************************/ package com.eldar.models; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import java.io.Serializable; /** * @author Phillip Sanderson * Date: 10/05/12 * Time: 11:07 PM */ public class Base implements Serializable { public Base() { setCreatedDate(DateTime.now(DateTimeZone.UTC)); setModifiedDate(getCreatedDate()); } protected long id; /** * Date and time the object was created. */ private DateTime createdDate; private DateTime modifiedDate; public long getId() { return id; } public void setId(long id) { this.id = id; } public DateTime getCreatedDate() { return createdDate; } public void setCreatedDate(DateTime createdDate) { this.createdDate = createdDate; } public DateTime getModifiedDate() { return modifiedDate; } public void setModifiedDate(DateTime modifiedDate) { this.modifiedDate = modifiedDate; } }