package it.mice.voila.runtime.entity;

import java.io.Serializable;

/**
 * Created by IntelliJ IDEA.
 * User: zzy9v4
 * Date: May 23, 2006
 * Time: 3:59:31 PM
 * To change this template use File | Settings | File Templates.
 */
public interface CoreEntity extends Serializable {

    String getObjectKey();

    /**
     * Initialize the ID part of the bean
     * according to the string tokenized from "||" received in input.
     * @param key Key ID in format pk1||pk2||pk3...<br>
     */
    void setObjectKey(String key);

    /**
     * Return the complete entity representation in string format.
     * It is useful in bean storing in the ActionForms which do not use the session
     * and so need to be completely loaded.
     * @return  Bean representation in format pk1||pk2||pk3...<br>
     */
    String getObjectDump();

    /**
     * Initialize the whole bean
     * according to the string tokenized from "||" received in input.
     * @param key Bean representation in format pk1||pk2||pk3...<br>
     */
    void setObjectDump(String key);

    /**
     * Check the primary key of the entity is completly null.
     * @return "true" if the primary key is not set,
     *         "false" if the primary key is set, even if only partially.
     */
    boolean isPkNull();

    /**
     * Check the primary key of the entity is completly not-null.
     * @return "true" if the primary key is fully set,
     *         "false" if the primary key is not set, even if only partially.
     */
    boolean isPkNotNull();

    /**
     * Return itself. Used as a work-arounBased for struts taglibs as iterate, etc...
     *
     * @return EntityListGeneric - itself
     */
    CoreEntity getThis();
}
