<commit_before>/*
 * =============================================================================
 * Copyright 1998-2012, IAESTE Internet Development Team. All rights reserved.
 * -----------------------------------------------------------------------------
 * Project: IntraWeb Services (iws-persistence) - net.iaeste.iws.persistence.BasicDao
 * -----------------------------------------------------------------------------
 * This software is provided by the members of the IAESTE Internet Development
 * Team (IDT) to IAESTE A.s.b.l. It is for internal use only and may not be
 * redistributed. IAESTE A.s.b.l. is not permitted to sell this software.
 *
 * This software is provided "as is"; the IDT or individuals within the IDT
 * cannot be held legally responsible for any problems the software may cause.
 * =============================================================================
 */
package net.iaeste.iws.persistence;

import net.iaeste.iws.persistence.entities.IWSEntity;
import net.iaeste.iws.persistence.entities.Mergeable;
import net.iaeste.iws.persistence.entities.MonitoringEntity;

import java.util.List;

/**
 * Contains the most basic database functionality, perstisting and deleting.
 *
 * @author  <NAME> / last $Author:$
 * @version $Revision:$ / $Date:$
 * @since   1.7
 */
public interface BasicDao {

    /**
     * Persist the given Entity into the database.
     *
     * @param entity Entity to persist
     */
    void persist(IWSEntity entity);

    /**
     * Persist a monitored Entity to the database. The Monitoring mechanism will
     * check the Entity, to see how it should be monitored, and then save both
     * the monitored information and the Entity in the database.
     *
     * @param authentication Information about the user invoking the request
     * @param entity         Entity to persist
     */
    void persist(Authentication authentication, IWSEntity entity);

    /**
     * Monitors and merges the new Entity values into the old Entity Object, and
     * persists both the monitored information and the old Entity in the
     * database.
     *
     * @param authentication Information about the user invoking the request
     * @param oldEntity      Entity to persist
     * @param newEntity      Changes to merge into the old Entity
     */
    <T extends Mergeable<T>> void persist(Authentication authentication, T oldEntity, T newEntity);

    /**
     * Deletes the given Entity from the database.
     *
     * @param entity Entity to delete
     */
    void delete(IWSEntity entity);

    /**
     * Finds the monitored history for a given Entity, and returns it.
     *
     * @param entity The Entity to find the history for
     * @return List of the Entity history
     */
    List<MonitoringEntity> findHistory(IWSEntity entity);
}
<commit_msg>Made the "old" persist method deprecated.<commit_after>/*
 * =============================================================================
 * Copyright 1998-2012, IAESTE Internet Development Team. All rights reserved.
 * -----------------------------------------------------------------------------
 * Project: IntraWeb Services (iws-persistence) - net.iaeste.iws.persistence.BasicDao
 * -----------------------------------------------------------------------------
 * This software is provided by the members of the IAESTE Internet Development
 * Team (IDT) to IAESTE A.s.b.l. It is for internal use only and may not be
 * redistributed. IAESTE A.s.b.l. is not permitted to sell this software.
 *
 * This software is provided "as is"; the IDT or individuals within the IDT
 * cannot be held legally responsible for any problems the software may cause.
 * =============================================================================
 */
package net.iaeste.iws.persistence;

import net.iaeste.iws.persistence.entities.IWSEntity;
import net.iaeste.iws.persistence.entities.Mergeable;
import net.iaeste.iws.persistence.entities.MonitoringEntity;

import java.util.List;

/**
 * Contains the most basic database functionality, perstisting and deleting.
 *
 * @author  <NAME> / last $Author:$
 * @version $Revision:$ / $Date:$
 * @since   1.7
 */
public interface BasicDao {

    /**
     * Persist the given Entity into the database.
     *
     * @param entity Entity to persist
     * @deprecated please use one of the other persist methods, this one cannot
     *             work with the monitoring
     */
    @Deprecated
    void persist(IWSEntity entity);

    /**
     * Persist a monitored Entity to the database. The Monitoring mechanism will
     * check the Entity, to see how it should be monitored, and then save both
     * the monitored information and the Entity in the database.
     *
     * @param authentication Information about the user invoking the request
     * @param entity         Entity to persist
     */
    void persist(Authentication authentication, IWSEntity entity);

    /**
     * Monitors and merges the new Entity values into the old Entity Object, and
     * persists both the monitored information and the old Entity in the
     * database.
     *
     * @param authentication Information about the user invoking the request
     * @param oldEntity      Entity to persist
     * @param newEntity      Changes to merge into the old Entity
     */
    <T extends Mergeable<T>> void persist(Authentication authentication, T oldEntity, T newEntity);

    /**
     * Deletes the given Entity from the database.
     *
     * @param entity Entity to delete
     */
    void delete(IWSEntity entity);

    /**
     * Finds the monitored history for a given Entity, and returns it.
     *
     * @param entity The Entity to find the history for
     * @return List of the Entity history
     */
    List<MonitoringEntity> findHistory(IWSEntity entity);
}

{'fraction_non_alphanumeric': 0.17464691698243195, 'fraction_numerical': 0.003444712366517396, 'mean_word_length': 2.5757389162561575, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3524038', 'n_tokens_mistral': 1488, 'n_tokens_neox': 1403, 'n_words': 581}