コード例 #1
0
  public SDMSTriggerQueue create(
      SystemEnvironment env,
      Long p_smeId,
      Long p_trId,
      Long p_nextTriggerTime,
      Integer p_timesChecked,
      Integer p_timesTriggered)
      throws SDMSException {
    Long p_creatorUId = env.cEnv.uid();
    Long p_createTs = env.txTime();
    Long p_changerUId = env.cEnv.uid();
    Long p_changeTs = env.txTime();

    if (env.tx.mode == SDMSTransaction.READONLY) {

      throw new FatalException(new SDMSMessage(env, "01110182049", "TriggerQueue"));
    }
    validate(
        env,
        p_smeId,
        p_trId,
        p_nextTriggerTime,
        p_timesChecked,
        p_timesTriggered,
        p_creatorUId,
        p_createTs,
        p_changerUId,
        p_changeTs);

    env.tx.beginSubTransaction(env);
    SDMSTriggerQueueGeneric o =
        new SDMSTriggerQueueGeneric(
            env,
            p_smeId,
            p_trId,
            p_nextTriggerTime,
            p_timesChecked,
            p_timesTriggered,
            p_creatorUId,
            p_createTs,
            p_changerUId,
            p_changeTs);

    SDMSTriggerQueue p;
    try {
      env.tx.addToChangeSet(env, o.versions, true);
      env.tx.addToTouchSet(env, o.versions, true);
      table.put(env, o.id, o.versions);
      env.tx.commitSubTransaction(env);
      p = (SDMSTriggerQueue) (o.toProxy());
      p.current = true;
    } catch (SDMSException e) {
      p = (SDMSTriggerQueue) (o.toProxy());
      p.current = true;
      env.tx.rollbackSubTransaction(env);
      throw e;
    }

    if (!checkCreatePrivs(env, p))
      throw new AccessViolationException(p.accessViolationMessage(env, "01402270738"));

    return p;
  }
コード例 #2
0
 public static SDMSTriggerQueue getObject(SystemEnvironment env, Long id, long version)
     throws SDMSException {
   return (SDMSTriggerQueue) table.get(env, id, version);
 }