org.acegisecurity.domain.PersistableEntity Maven / Gradle / Ivy
/* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
*
* 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 org.acegisecurity.domain;
import java.io.Serializable;
/**
* An interface that indicates an object is a persistable entity.
*
*
* A persistable entity is any object that is capable of being persisted,
* typically via a {@link org.acegisecurity.domain.dao.Dao} implementation.
*
*
* @author Ben Alex
* @version $Id: PersistableEntity.java 1496 2006-05-23 13:38:33Z benalex $
*/
public interface PersistableEntity {
//~ Methods ========================================================================================================
/**
* Provides a common getter for the persistence layer to obtain an identity, irrespective of the actual
* type of identity used.Typically a subclass will delegate to a public SomePrimitiveWrapper
* getId()
method. The necessity for the getInternalId()
abstract method is solely because
* the persistence layer needs a way of obtaining the identity irrespective of the actual identity implementation
* choice.
* Returning null
from this method will indicate the object has never been saved. This
* will likely be relied on by some Dao
implementations.
*
* @return the persistence identity of this instance
*/
public abstract Serializable getInternalId();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy