code: private void requirePkInitialized(CodeBuilder b, String methodName) {
          // Add code to call method which we are about to define.
          b.loadThis();
          b.invokeVirtual(methodName, null, null);
  
          // Now define new method, discarding original builder object.
          b = new CodeBuilder(mClassFile.addMethod(Modifiers.PROTECTED, methodName, null, null));
          b.loadThis();
          b.invokeVirtual(IS_REQUIRED_PK_INITIALIZED_METHOD_NAME, TypeDesc.BOOLEAN, null);
          Label pkInitialized = b.createLabel();
          b.ifZeroComparisonBranch(pkInitialized, "!=");
          CodeBuilderUtil.throwException
              (b, IllegalStateException.class, "Primary key not fully specified");
          pkInitialized.setLocation();
          b.returnVoid();
      }
docs: Generates code that verifies that all primary keys are initialized.
  
  @param b builder that will invoke generated method
  @param methodName name to give to generated method