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

org.kie.internal.task.api.TaskPersistenceContext Maven / Gradle / Ivy

Go to download

The Drools and jBPM internal API which is NOT backwards compatible between releases.

There is a newer version: 10.0.0
Show newest version
/*
 * Copyright 2015 Red Hat, Inc. and/or its affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 *
 *      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.kie.internal.task.api;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.kie.api.task.UserGroupCallback;
import org.kie.api.task.model.Attachment;
import org.kie.api.task.model.Comment;
import org.kie.api.task.model.Content;
import org.kie.api.task.model.Group;
import org.kie.api.task.model.OrganizationalEntity;
import org.kie.api.task.model.Task;
import org.kie.api.task.model.TaskSummary;
import org.kie.api.task.model.User;
import org.kie.internal.task.api.model.Deadline;

public interface TaskPersistenceContext {

	Task findTask(Long taskId);

	Task persistTask(Task task);

	Task updateTask(Task task);

	Task removeTask(Task task);

	Group findGroup(String groupId);

	Group persistGroup(Group group);

	Group updateGroup(Group group);

	Group removeGroup(Group group);

	User findUser(String userId);

	User persistUser(User user);

	User updateUser(User user);

	User removeUser(User user);

	OrganizationalEntity findOrgEntity(String orgEntityId);

	OrganizationalEntity persistOrgEntity(OrganizationalEntity orgEntity);

	OrganizationalEntity updateOrgEntity(OrganizationalEntity orgEntity);

	OrganizationalEntity removeOrgEntity(OrganizationalEntity orgEntity);

	Content findContent(Long contentId);

	Content persistContent(Content content);

	Content updateContent(Content content);

	Content removeContent(Content content);

	Long findTaskIdByContentId(Long contentId);

	Attachment findAttachment(Long attachmentId);

	Attachment persistAttachment(Attachment attachment);

	Attachment updateAttachment(Attachment attachment);

	Attachment removeAttachment(Attachment attachment);

	Comment findComment(Long commentId);

	Comment persistComment(Comment comment);

	Comment updateComment(Comment comment);

	Comment removeComment(Comment comment);

	Deadline findDeadline(Long deadlineId);

	Deadline persistDeadline(Deadline deadline);

	Deadline updateDeadline(Deadline deadline);

	Deadline removeDeadline(Deadline deadline);

	/*
	 * Query related methods
	 */

	 T queryWithParametersInTransaction(String queryName, Map params, Class clazz);

     T queryWithParametersInTransaction(String queryName, boolean singleResult, Map params, Class clazz);

	 T queryAndLockWithParametersInTransaction(String queryName, Map params, boolean singleResult, Class clazz);

	 T queryInTransaction(String queryName, Class clazz);

	 T queryStringInTransaction(String queryString, Class clazz );

     T queryStringWithParametersInTransaction(String queryString, boolean singleResult, Map params, Class clazz );

	 T queryStringWithParametersInTransaction(String queryString,  Map params, Class clazz );

	 T queryAndLockStringWithParametersInTransaction(String queryName, Map params, boolean singleResult, Class clazz);

    int executeUpdateString(String updateString);

    HashMap addParametersToMap(Object ... parameterValues);

    /*
     * Following are optional methods that are more like extension to
     * default data model to allow flexible add-ons
     */
	 T persist(T object);

	 T find(Class entityClass, Object primaryKey);

	 T remove(T entity);

     T merge(T entity);

    /*
     * life cycle methods
     */
    boolean isOpen();

    void joinTransaction();

    void close();

    /*
     * JPA Query methods
     */

    List doTaskSummaryCriteriaQuery(String userId, UserGroupCallback userGroupCallback, Object queryWhere);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy