code: private static Constructor<?> getPersistenceStoreConstructor(Class<?> theClass, Class<?>[] interfaces) throws Exception {
          Constructor<?> constructor = null;
          for (Class<?> interfaceClass : interfaces) {
              try {
                  constructor = theClass.getConstructor(new Class[] { interfaceClass });
              } catch (NoSuchMethodException err) {
                  // Ignore this error
              }
              if (constructor != null) {
                  break;
              }
              constructor = getPersistenceStoreConstructor(theClass, interfaceClass.getInterfaces());
              if (constructor != null) {
                  break;
              }
          }
          return constructor;
      }
docs: Returns persistence store object class constructor
  
  @param theClass
  Persistence store class
  @param interfaces
  Interfaces that are being implemented by persistence store object class
  @return Constructor
  @throws Exception