Exemplo n.º 1
0
  /**
   * Sets the link type in local data and the database.
   *
   * @param sType, the link type for this link.
   * @exception java.sql.SQLException
   * @exception com.compendium.core.datamodel.ModelSessionException
   */
  public void setType(String sType) throws SQLException, ModelSessionException {

    if (this.sType.equals(sType)) return;

    if (oModel == null) throw new ModelSessionException("Model is null in Link.setType");

    if (oSession == null) throw new ModelSessionException("Session is null in Link.setType");

    // call link service to update database
    ILinkService ls = oModel.getLinkService();
    ls.setType(oSession, sId, this.sType, sType);

    setTypeLocal(sType);
  }
Exemplo n.º 2
0
  /**
   * Sets the label of this link, both locally and in the DATABASE.
   *
   * @param String label, The label of this link .
   * @exception java.sql.SQLException
   * @exception java.sql.ModelSessionException
   */
  public void setLabel(String label) throws SQLException, ModelSessionException {

    if (label.equals(sLabel)) return;

    if (oModel == null) throw new ModelSessionException("Model is null in Link.setLabel");
    if (oSession == null) {
      oSession = oModel.getSession();
      if (oSession == null) throw new ModelSessionException("Session is null in Link.setLabel");
    }

    Date date = new Date();
    setModificationDateLocal(date);
    ILinkService ls = oModel.getLinkService();
    ls.setLabel(oSession, sId, label, date);

    setLabelLocal(label);
  }