コード例 #1
0
  /**
   * This method either returns an existing FrameworkPrimaryKey, or will attempt to create the
   * correct one. If using stored procedures a simple shell representation of the
   * FrameworkPrimaryKey will be created. If using AIB generated embedded SQL, an attempt to
   * generate a unique id for each key field of the S_Framework_Entry_UIPrimaryKey class will be
   * created. To generate your own id, overload method <i>String generateUID()</i>.
   *
   * @return FrameworkPrimaryKey
   */
  protected FrameworkPrimaryKey getFrameworkPrimaryKeyShell() {
    FrameworkPrimaryKey primaryKey = getValueObject().getFrameworkPrimaryKey();

    // if there is non-null, non-empty primary key, use it, otherwise, create one
    if (primaryKey != null && primaryKey.isEmpty() == false) return (primaryKey);
    else {
      S_Framework_Entry_UIPrimaryKey key = new S_Framework_Entry_UIPrimaryKey(new String("1"));
      getValueObject().setFrameworkPrimaryKey(key);
      return (key);
    }
  }
コード例 #2
0
 /**
  * Creates an unpopulated valueObject.
  *
  * @return IFrameworkValueObject
  */
 protected IFrameworkValueObject createValueObject(FrameworkPrimaryKey key) {
   IS_Framework_Entry_UIValueObject valueObject =
       new S_Framework_Entry_UIValueObject(
           new S_Framework_Entry_UIPrimaryKey(key.getValuesAsCollection()));
   return (valueObject);
 }