All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.liferay.portal.model.BaseModel Maven / Gradle / Ivy

Go to download

Contains interfaces for the portal services. Interfaces are only loaded by the global class loader and are shared by all plugins.

There is a newer version: 7.0.0-nightly
Show newest version
/**
 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library 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 Lesser General Public License for more
 * details.
 */

package com.liferay.portal.model;

import com.liferay.portal.service.ServiceContext;
import com.liferay.portlet.expando.model.ExpandoBridge;

import java.io.Serializable;

import java.util.Map;

/**
 * The base interface for all model classes. This interface should never need to
 * be used directly.
 *
 * @author Brian Wing Shun Chan
 * @see    com.liferay.portal.model.impl.BaseModelImpl
 */
public interface BaseModel
	extends ClassedModel, Cloneable, Comparable, Serializable {

	/**
	 * Creates a shallow clone of this model instance.
	 *
	 * @return the shallow clone of this model instance
	 */
	public Object clone();

	/**
	 * Returns the expando bridge for this model instance.
	 *
	 * @return the expando bridge for this model instance
	 */
	@Override
	public ExpandoBridge getExpandoBridge();

	public Map getModelAttributes();

	/**
	 * Returns the primary key of this model instance.
	 *
	 * @return the primary key of this model instance
	 */
	@Override
	public Serializable getPrimaryKeyObj();

	/**
	 * Returns true if this model instance was retrieved from the
	 * entity cache.
	 *
	 * @return true if this model instance was retrieved from the
	 *         entity cache; false otherwise
	 * @see    #setCachedModel(boolean)
	 */
	public boolean isCachedModel();

	/**
	 * Returns true if this model instance is escaped.
	 *
	 * @return true if this model instance is escaped;
	 *         false otherwise
	 */
	public boolean isEscapedModel();

	/**
	 * Returns true if this model instance does not yet exist in
	 * the database.
	 *
	 * @return true if this model instance does not yet exist in
	 *         the database; false otherwise
	 */
	public boolean isNew();

	/**
	 * Reset all original fields to current values.
	 */
	public void resetOriginalValues();

	/**
	 * Sets whether this model instance was retrieved from the entity cache.
	 *
	 * @param cachedModel whether this model instance was retrieved from the
	 *        entity cache
	 * @see   com.liferay.portal.kernel.dao.orm.EntityCache
	 */
	public void setCachedModel(boolean cachedModel);

	public void setExpandoBridgeAttributes(BaseModel baseModel);

	public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge);

	/**
	 * Sets the expando bridge attributes for this model instance to the
	 * attributes stored in the service context.
	 *
	 * @param serviceContext the service context to be applied
	 * @see   com.liferay.portal.service.ServiceContext#getExpandoBridgeAttributes(
	 *        )
	 */
	public void setExpandoBridgeAttributes(ServiceContext serviceContext);

	public void setModelAttributes(Map attributes);

	/**
	 * Sets whether this model instance does not yet exist in the database.
	 *
	 * @param n whether this model instance does not yet exist in the database
	 */
	public void setNew(boolean n);

	/**
	 * Sets the primary key of this model instance.
	 *
	 * @param primaryKeyObj the primary key of this model instance
	 */
	@Override
	public void setPrimaryKeyObj(Serializable primaryKeyObj);

	/**
	 * Returns a cache model object for this entity used by entity cache.
	 *
	 * @return the cache model object
	 */
	public CacheModel toCacheModel();

	/**
	 * Returns a copy of this entity as an escaped model instance by wrapping it
	 * with an {@link com.liferay.portal.kernel.bean.AutoEscapeBeanHandler}.
	 *
	 * @return the escaped model instance
	 * @see    com.liferay.portal.kernel.bean.AutoEscapeBeanHandler
	 */
	public T toEscapedModel();

	public T toUnescapedModel();

	/**
	 * Returns the XML representation of this model instance.
	 *
	 * @return the XML representation of this model instance
	 */
	public String toXmlString();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy