public void deleteTenantByIdIdx(long Id) {
   CFSecurityTenantPKey pkey =
       ((ICFSecuritySchema) schema.getBackingStore()).getFactoryTenant().newPKey();
   pkey.setRequiredId(Id);
   ICFSecurityTenantObj obj = readTenant(pkey);
   if (obj != null) {
     ICFSecurityTenantEditObj editObj = (ICFSecurityTenantEditObj) obj.getEdit();
     boolean editStarted;
     if (editObj == null) {
       editObj = (ICFSecurityTenantEditObj) obj.beginEdit();
       if (editObj != null) {
         editStarted = true;
       } else {
         editStarted = false;
       }
     } else {
       editStarted = false;
     }
     if (editObj != null) {
       editObj.delete();
       if (editStarted) {
         editObj.endEdit();
       }
     }
     obj.forget(true);
   }
 }