/**
  * Retrieve this object's <code>id</code> value.
  *
  * @return the value of the attribute
  */
 public Number id() {
   try {
     return (Number) EOUtilities.primaryKeyForObject(editingContext(), this).objectForKey("id");
   } catch (Exception e) {
     return er.extensions.eof.ERXConstant.ZeroInteger;
   }
 }
예제 #2
0
 /** obtenir la valeur de la cle primaire a partir d'un Object quand celle-ci est cachee */
 public static Object primaryKeyForObject(
     EOEditingContext eContext, EOEnterpriseObject record, String primaryKeyName) {
   try {
     return EOUtilities.primaryKeyForObject(eContext, record).objectForKey(primaryKeyName);
   } catch (Exception e) {
     e.printStackTrace();
   }
   return null;
 }
예제 #3
0
 public static Object primaryKey(
     EOEditingContext eContext, EOEnterpriseObject record, String primKey) {
   try {
     if (record == null) {
       return null;
     } else {
       NSDictionary keys = EOUtilities.primaryKeyForObject(eContext, record);
       return keys.objectForKey(primKey);
     }
   } // try
   catch (Exception e) {
     e.printStackTrace();
   }
   return null;
 }