package com.capgemini.reports.teamcenter.queries.saved;

import com.capgemini.framework.teamcenter.authent.TcSession;
import com.capgemini.framework.teamcenter.queries.saved.AbstractReplicatedQuery;
import com.teamcenter.soa.client.model.strong.ItemRevision;

/**
 * Class which allow to findAll change notice which is rely on a part.
 */
public class ChangeNoticeR07Query extends AbstractReplicatedQuery<ItemRevision, ChangeNoticeR07Query> {
    /**
     * Query name of Teamcenter for request in Unit objects.
     */
    private static final String QUERY_SUFFIX_CHANGE_FROM_PART = "ChangeNotice_R07";
    private static final String PARAM_PART_ID = "part_id";
    private static final String PARAM_PART_REVISION = "part_revision";

    /**
     * Constructor to build a Query for ChangeItem objects from a Part.
     *
     * @param session the session for the connection
     */
    public ChangeNoticeR07Query(final TcSession session) {
        super(session, QUERY_SUFFIX_CHANGE_FROM_PART);
    }

    @Override
    public ChangeNoticeR07Query searchID(final String partId) {
        return this.addParam(AbstractReplicatedQuery.REPCOL_PREFIX + PARAM_PART_ID, partId);
    }


    @Override
    public ChangeNoticeR07Query searchRevision(final String partRevision) {
        return this.addParam(AbstractReplicatedQuery.REPCOL_PREFIX + PARAM_PART_REVISION, partRevision);
    }

    @Override
    protected ChangeNoticeR07Query selfCast() {
        return this;
    }
}
